From 5cf9a9f895df42cef57826c4a038a905f6de0b7f Mon Sep 17 00:00:00 2001 From: Final Child Date: Sun, 3 Apr 2016 20:06:54 +0900 Subject: [PATCH 1/5] Bump version to 1.9.2-SNAPSHOT --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From c1332812243e18aab764f7d3f6907ef889b6387e Mon Sep 17 00:00:00 2001 From: Final Child Date: Sun, 3 Apr 2016 20:09:47 +0900 Subject: [PATCH 2/5] Update to MC 1.9.2 --- src/main/java/org/spacehq/mc/protocol/MinecraftConstants.java | 4 ++-- src/main/java/org/spacehq/mc/protocol/data/MagicValues.java | 1 + .../mc/protocol/data/game/entity/attribute/AttributeType.java | 1 + .../mc/protocol/data/game/world/sound/BuiltinSound.java | 1 + 4 files changed, 5 insertions(+), 2 deletions(-) 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..8772ab0e 100644 --- a/src/main/java/org/spacehq/mc/protocol/data/MagicValues.java +++ b/src/main/java/org/spacehq/mc/protocol/data/MagicValues.java @@ -93,6 +93,7 @@ public class MagicValues { register(AttributeType.ATTACK_DAMAGE, "generic.attackDamage"); register(AttributeType.ATTACK_SPEED, "generic.attackSpeed"); register(AttributeType.ARMOR, "generic.armor"); + register(AttributeType.ARMOR_TOUGHNESS, "generic.armorToughness"); register(AttributeType.LUCK, "generic.luck"); register(AttributeType.HORSE_JUMP_STRENGTH, "horse.jumpStrength"); register(AttributeType.ZOMBIE_SPAWN_REINFORCEMENTS_CHANCE, "zombie.spawnReinforcements"); 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..2d04a4a2 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 @@ -9,6 +9,7 @@ public enum AttributeType { ATTACK_DAMAGE(2, 0, 2048), ATTACK_SPEED(4, 0, 1024), ARMOR(0, 0, 30), + ARMOR_TOUGHNESS(0, 0, 20), LUCK(0, -1024, 1024), HORSE_JUMP_STRENGTH(0.7, 0, 2), ZOMBIE_SPAWN_REINFORCEMENTS_CHANCE(0, 0, 1); 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, From cf2282a0be4b8409e90fbf90ef3b7ee22264f250 Mon Sep 17 00:00:00 2001 From: Final Child Date: Sun, 3 Apr 2016 20:25:25 +0900 Subject: [PATCH 3/5] Enhance attribute names --- .../spacehq/mc/protocol/data/MagicValues.java | 20 +++++++++---------- .../game/entity/attribute/AttributeType.java | 20 +++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) 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 8772ab0e..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,17 +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.ARMOR_TOUGHNESS, "generic.armorToughness"); - 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 2d04a4a2..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,17 +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), - ARMOR_TOUGHNESS(0, 0, 20), - 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; From 820da1d45953df33d6ec40eb028fead8dd9fc316 Mon Sep 17 00:00:00 2001 From: Final Child Date: Sun, 3 Apr 2016 20:27:37 +0900 Subject: [PATCH 4/5] Remove SoundCategory's useless semicolon --- .../mc/protocol/data/game/world/sound/SoundCategory.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 } From f8ea9873953160765ba86394fb3326af2106e959 Mon Sep 17 00:00:00 2001 From: Final Child Date: Sun, 3 Apr 2016 20:45:53 +0900 Subject: [PATCH 5/5] Change the type of ServerJoinGamePacket's gamemode to int --- .../protocol/packet/ingame/server/ServerJoinGamePacket.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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));