Merge pull request #148 from finalchild/feature/mc-1.9.2-support

Update to MC 1.9.2
This commit is contained in:
Steven Smith 2016-04-03 09:21:15 -07:00
commit 223e5fb29e
7 changed files with 27 additions and 24 deletions

View file

@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.spacehq</groupId>
<artifactId>mcprotocollib</artifactId>
<version>1.9-SNAPSHOT</version>
<version>1.9.2-SNAPSHOT</version>
<packaging>jar</packaging>
<name>MCProtocolLib</name>

View file

@ -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";

View file

@ -86,16 +86,17 @@ public class MagicValues {
private static final Map<Object, List<Object>> values = new HashMap<Object, List<Object>>();
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"));

View file

@ -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;

View file

@ -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,

View file

@ -10,5 +10,5 @@ public enum SoundCategory {
NEUTRAL,
PLAYER,
AMBIENT,
VOICE;
VOICE
}

View file

@ -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));