diff --git a/pom.xml b/pom.xml index e9287256..13fb6770 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 org.spacehq mcprotocollib - 1.9-SNAPSHOT + 1.9.2-SNAPSHOT jar MCProtocolLib diff --git a/src/main/java/org/spacehq/mc/protocol/MinecraftConstants.java b/src/main/java/org/spacehq/mc/protocol/MinecraftConstants.java index e3b8b65c..ed521fe0 100644 --- a/src/main/java/org/spacehq/mc/protocol/MinecraftConstants.java +++ b/src/main/java/org/spacehq/mc/protocol/MinecraftConstants.java @@ -2,8 +2,8 @@ package org.spacehq.mc.protocol; public class MinecraftConstants { // General Constants - public static final String GAME_VERSION = "1.9"; - public static final int PROTOCOL_VERSION = 107; + public static final String GAME_VERSION = "1.9.2"; + public static final int PROTOCOL_VERSION = 109; // General Key Constants public static final String PROFILE_KEY = "profile"; diff --git a/src/main/java/org/spacehq/mc/protocol/data/MagicValues.java b/src/main/java/org/spacehq/mc/protocol/data/MagicValues.java index 22eaa801..d0ccd363 100644 --- a/src/main/java/org/spacehq/mc/protocol/data/MagicValues.java +++ b/src/main/java/org/spacehq/mc/protocol/data/MagicValues.java @@ -86,16 +86,17 @@ public class MagicValues { private static final Map> values = new HashMap>(); static { - register(AttributeType.MAX_HEALTH, "generic.maxHealth"); - register(AttributeType.FOLLOW_RANGE, "generic.followRange"); - register(AttributeType.KNOCKBACK_RESISTANCE, "generic.knockbackResistance"); - register(AttributeType.MOVEMENT_SPEED, "generic.movementSpeed"); - register(AttributeType.ATTACK_DAMAGE, "generic.attackDamage"); - register(AttributeType.ATTACK_SPEED, "generic.attackSpeed"); - register(AttributeType.ARMOR, "generic.armor"); - register(AttributeType.LUCK, "generic.luck"); + register(AttributeType.GENERIC_MAX_HEALTH, "generic.maxHealth"); + register(AttributeType.GENERIC_FOLLOW_RANGE, "generic.followRange"); + register(AttributeType.GENERIC_KNOCKBACK_RESISTANCE, "generic.knockbackResistance"); + register(AttributeType.GENERIC_MOVEMENT_SPEED, "generic.movementSpeed"); + register(AttributeType.GENERIC_ATTACK_DAMAGE, "generic.attackDamage"); + register(AttributeType.GENERIC_ATTACK_SPEED, "generic.attackSpeed"); + register(AttributeType.GENERIC_ARMOR, "generic.armor"); + register(AttributeType.GENERIC_ARMOR_TOUGHNESS, "generic.armorToughness"); + register(AttributeType.GENERIC_LUCK, "generic.luck"); register(AttributeType.HORSE_JUMP_STRENGTH, "horse.jumpStrength"); - register(AttributeType.ZOMBIE_SPAWN_REINFORCEMENTS_CHANCE, "zombie.spawnReinforcements"); + register(AttributeType.ZOMBIE_SPAWN_REINFORCEMENTS, "zombie.spawnReinforcements"); register(ModifierType.CREATURE_FLEE_SPEED_BONUS, UUID.fromString("E199AD21-BA8A-4C53-8D13-6182D5C69D3A")); register(ModifierType.ENDERMAN_ATTACK_SPEED_BOOST, UUID.fromString("020E0DFB-87AE-4653-9556-831010E291A0")); diff --git a/src/main/java/org/spacehq/mc/protocol/data/game/entity/attribute/AttributeType.java b/src/main/java/org/spacehq/mc/protocol/data/game/entity/attribute/AttributeType.java index 451e1a9b..280c5ac0 100644 --- a/src/main/java/org/spacehq/mc/protocol/data/game/entity/attribute/AttributeType.java +++ b/src/main/java/org/spacehq/mc/protocol/data/game/entity/attribute/AttributeType.java @@ -2,16 +2,17 @@ package org.spacehq.mc.protocol.data.game.entity.attribute; public enum AttributeType { - MAX_HEALTH(20, 0, 1024), - FOLLOW_RANGE(32, 0, 2048), - KNOCKBACK_RESISTANCE(0, 0, 1), - MOVEMENT_SPEED(0.699999988079071, 0, 1024), - ATTACK_DAMAGE(2, 0, 2048), - ATTACK_SPEED(4, 0, 1024), - ARMOR(0, 0, 30), - LUCK(0, -1024, 1024), + GENERIC_MAX_HEALTH(20, 0, 1024), + GENERIC_FOLLOW_RANGE(32, 0, 2048), + GENERIC_KNOCKBACK_RESISTANCE(0, 0, 1), + GENERIC_MOVEMENT_SPEED(0.699999988079071, 0, 1024), + GENERIC_ATTACK_DAMAGE(2, 0, 2048), + GENERIC_ATTACK_SPEED(4, 0, 1024), + GENERIC_ARMOR(0, 0, 30), + GENERIC_ARMOR_TOUGHNESS(0, 0, 20), + GENERIC_LUCK(0, -1024, 1024), HORSE_JUMP_STRENGTH(0.7, 0, 2), - ZOMBIE_SPAWN_REINFORCEMENTS_CHANCE(0, 0, 1); + ZOMBIE_SPAWN_REINFORCEMENTS(0, 0, 1); private double def; private double min; diff --git a/src/main/java/org/spacehq/mc/protocol/data/game/world/sound/BuiltinSound.java b/src/main/java/org/spacehq/mc/protocol/data/game/world/sound/BuiltinSound.java index ec1cac1b..575191e8 100644 --- a/src/main/java/org/spacehq/mc/protocol/data/game/world/sound/BuiltinSound.java +++ b/src/main/java/org/spacehq/mc/protocol/data/game/world/sound/BuiltinSound.java @@ -416,6 +416,7 @@ public enum BuiltinSound implements Sound { ITEM_BUCKET_FILL, ITEM_BUCKET_FILL_LAVA, ITEM_CHORUS_FRUIT_TELEPORT, + ITEM_ELYTRA_FLYING, ITEM_FIRECHARGE_USE, ITEM_FLINTANDSTEEL_USE, ITEM_HOE_TILL, diff --git a/src/main/java/org/spacehq/mc/protocol/data/game/world/sound/SoundCategory.java b/src/main/java/org/spacehq/mc/protocol/data/game/world/sound/SoundCategory.java index fe8bd12b..59b76838 100644 --- a/src/main/java/org/spacehq/mc/protocol/data/game/world/sound/SoundCategory.java +++ b/src/main/java/org/spacehq/mc/protocol/data/game/world/sound/SoundCategory.java @@ -10,5 +10,5 @@ public enum SoundCategory { NEUTRAL, PLAYER, AMBIENT, - VOICE; + VOICE } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerJoinGamePacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerJoinGamePacket.java index e20e16a6..8bbf0d3a 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerJoinGamePacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/ServerJoinGamePacket.java @@ -75,7 +75,7 @@ public class ServerJoinGamePacket implements Packet { this.hardcore = (gamemode & 8) == 8; gamemode &= -9; this.gamemode = MagicValues.key(GameMode.class, gamemode); - this.dimension = in.readByte(); + this.dimension = in.readInt(); this.difficulty = MagicValues.key(Difficulty.class, in.readUnsignedByte()); this.maxPlayers = in.readUnsignedByte(); this.worldType = MagicValues.key(WorldType.class, in.readString().toLowerCase()); @@ -91,7 +91,7 @@ public class ServerJoinGamePacket implements Packet { } out.writeByte(gamemode); - out.writeByte(this.dimension); + out.writeInt(this.dimension); out.writeByte(MagicValues.value(Integer.class, this.difficulty)); out.writeByte(this.maxPlayers); out.writeString(MagicValues.value(String.class, this.worldType));