From 0e055033483479b91b0df1db129d2cf50c7fd5e5 Mon Sep 17 00:00:00 2001 From: Final Child Date: Mon, 6 Jun 2016 21:56:48 +0900 Subject: [PATCH] Update to MC 1.10-pre1 --- .../spacehq/mc/protocol/MinecraftConstants.java | 4 ++-- .../org/spacehq/mc/protocol/data/MagicValues.java | 2 +- .../protocol/data/game/entity/type/MobType.java | 2 +- .../client/ClientResourcePackStatusPacket.java | 10 +--------- .../world/ServerPlayBuiltinSoundPacket.java | 12 +----------- .../server/world/ServerPlaySoundPacket.java | 15 +++------------ 6 files changed, 9 insertions(+), 36 deletions(-) diff --git a/src/main/java/org/spacehq/mc/protocol/MinecraftConstants.java b/src/main/java/org/spacehq/mc/protocol/MinecraftConstants.java index d0f81b7a..4dfe1d00 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.4"; - public static final int PROTOCOL_VERSION = 110; + public static final String GAME_VERSION = "1.10-pre1"; + public static final int PROTOCOL_VERSION = 204; // 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 b198e8cf..a4f1f5f6 100644 --- a/src/main/java/org/spacehq/mc/protocol/data/MagicValues.java +++ b/src/main/java/org/spacehq/mc/protocol/data/MagicValues.java @@ -306,7 +306,6 @@ public class MagicValues { register(GlobalEntityType.LIGHTNING_BOLT, 1); - register(MobType.ARMOR_STAND, 30); register(MobType.MOB, 48); register(MobType.MONSTER, 49); register(MobType.CREEPER, 50); @@ -341,6 +340,7 @@ public class MagicValues { register(MobType.IRON_GOLEM, 99); register(MobType.HORSE, 100); register(MobType.RABBIT, 101); + register(MobType.POLAR_BEAR, 102); register(MobType.VILLAGER, 120); register(ObjectType.BOAT, 1); diff --git a/src/main/java/org/spacehq/mc/protocol/data/game/entity/type/MobType.java b/src/main/java/org/spacehq/mc/protocol/data/game/entity/type/MobType.java index 5a302d50..f860df23 100644 --- a/src/main/java/org/spacehq/mc/protocol/data/game/entity/type/MobType.java +++ b/src/main/java/org/spacehq/mc/protocol/data/game/entity/type/MobType.java @@ -1,7 +1,6 @@ package org.spacehq.mc.protocol.data.game.entity.type; public enum MobType { - ARMOR_STAND, MOB, MONSTER, CREEPER, @@ -36,5 +35,6 @@ public enum MobType { IRON_GOLEM, HORSE, RABBIT, + POLAR_BEAR, VILLAGER; } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/ClientResourcePackStatusPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/ClientResourcePackStatusPacket.java index 62cf6a71..f1f59fe7 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/ClientResourcePackStatusPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/client/ClientResourcePackStatusPacket.java @@ -10,35 +10,27 @@ import org.spacehq.packetlib.packet.Packet; import java.io.IOException; public class ClientResourcePackStatusPacket implements Packet { - private String hash; private ResourcePackStatus status; @SuppressWarnings("unused") private ClientResourcePackStatusPacket() { } - public ClientResourcePackStatusPacket(String hash, ResourcePackStatus status) { - this.hash = hash; + public ClientResourcePackStatusPacket(ResourcePackStatus status) { this.status = status; } - public String getHash() { - return this.hash; - } - public ResourcePackStatus getStatus() { return this.status; } @Override public void read(NetInput in) throws IOException { - this.hash = in.readString(); this.status = MagicValues.key(ResourcePackStatus.class, in.readVarInt()); } @Override public void write(NetOutput out) throws IOException { - out.writeString(this.hash); out.writeVarInt(MagicValues.value(Integer.class, this.status)); } diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerPlayBuiltinSoundPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerPlayBuiltinSoundPacket.java index f6c5509c..ef17fbe6 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerPlayBuiltinSoundPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerPlayBuiltinSoundPacket.java @@ -70,7 +70,6 @@ public class ServerPlayBuiltinSoundPacket implements Packet { this.y = in.readInt() / 8D; this.z = in.readInt() / 8D; this.volume = in.readFloat(); - this.pitch = in.readUnsignedByte() / 63.5f; } @Override @@ -81,16 +80,7 @@ public class ServerPlayBuiltinSoundPacket implements Packet { out.writeInt((int) (this.y * 8)); out.writeInt((int) (this.z * 8)); out.writeFloat(this.volume); - int pitch = (int) (this.pitch * 63.5f); - if(pitch > 255) { - pitch = 255; - } - - if(pitch < 0) { - pitch = 0; - } - - out.writeByte(pitch); + out.writeFloat(this.pitch); } @Override diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerPlaySoundPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerPlaySoundPacket.java index 1768043b..262ec17c 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerPlaySoundPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/world/ServerPlaySoundPacket.java @@ -78,7 +78,7 @@ public class ServerPlaySoundPacket implements Packet { this.y = in.readInt() / 8D; this.z = in.readInt() / 8D; this.volume = in.readFloat(); - this.pitch = in.readUnsignedByte() / 63f; + this.pitch = in.readFloat(); } @Override @@ -87,7 +87,7 @@ public class ServerPlaySoundPacket implements Packet { if(this.sound instanceof CustomSound) { value = ((CustomSound) this.sound).getName(); } else if(this.sound instanceof BuiltinSound) { - value = MagicValues.value(String.class, (BuiltinSound) this.sound); + value = MagicValues.value(String.class, this.sound); } out.writeString(value); @@ -96,16 +96,7 @@ public class ServerPlaySoundPacket implements Packet { out.writeInt((int) (this.y * 8)); out.writeInt((int) (this.z * 8)); out.writeFloat(this.volume); - int pitch = (int) (this.pitch * 63); - if(pitch > 255) { - pitch = 255; - } - - if(pitch < 0) { - pitch = 0; - } - - out.writeByte(pitch); + out.writeFloat(this.pitch); } @Override