Update ServerSpawnPaintingPacket

This commit is contained in:
Jonas Herzig 2018-07-19 10:04:41 +02:00
parent a9574252e6
commit 8a29f2ff5e
2 changed files with 28 additions and 28 deletions

View file

@ -419,32 +419,32 @@ public class MagicValues {
register(HangingDirection.NORTH, 2);
register(HangingDirection.EAST, 3);
register(PaintingType.KEBAB, "Kebab");
register(PaintingType.AZTEC, "Aztec");
register(PaintingType.ALBAN, "Alban");
register(PaintingType.AZTEC2, "Aztec2");
register(PaintingType.BOMB, "Bomb");
register(PaintingType.PLANT, "Plant");
register(PaintingType.WASTELAND, "Wasteland");
register(PaintingType.POOL, "Pool");
register(PaintingType.COURBET, "Courbet");
register(PaintingType.SEA, "Sea");
register(PaintingType.SUNSET, "Sunset");
register(PaintingType.CREEBET, "Creebet");
register(PaintingType.WANDERER, "Wanderer");
register(PaintingType.GRAHAM, "Graham");
register(PaintingType.MATCH, "Match");
register(PaintingType.BUST, "Bust");
register(PaintingType.STAGE, "Stage");
register(PaintingType.VOID, "Void");
register(PaintingType.SKULL_AND_ROSES, "SkullAndRoses");
register(PaintingType.WITHER, "Wither");
register(PaintingType.FIGHTERS, "Fighters");
register(PaintingType.POINTER, "Pointer");
register(PaintingType.PIG_SCENE, "Pigscene");
register(PaintingType.BURNING_SKULL, "BurningSkull");
register(PaintingType.SKELETON, "Skeleton");
register(PaintingType.DONKEY_KONG, "DonkeyKong");
register(PaintingType.KEBAB, 0);
register(PaintingType.AZTEC, 1);
register(PaintingType.ALBAN, 2);
register(PaintingType.AZTEC2, 3);
register(PaintingType.BOMB, 4);
register(PaintingType.PLANT, 5);
register(PaintingType.WASTELAND, 6);
register(PaintingType.POOL, 7);
register(PaintingType.COURBET, 8);
register(PaintingType.SEA, 9);
register(PaintingType.SUNSET, 10);
register(PaintingType.CREEBET, 11);
register(PaintingType.WANDERER, 12);
register(PaintingType.GRAHAM, 13);
register(PaintingType.MATCH, 14);
register(PaintingType.BUST, 15);
register(PaintingType.STAGE, 16);
register(PaintingType.VOID, 17);
register(PaintingType.SKULL_AND_ROSES, 18);
register(PaintingType.WITHER, 19);
register(PaintingType.FIGHTERS, 20);
register(PaintingType.POINTER, 21);
register(PaintingType.PIG_SCENE, 22);
register(PaintingType.BURNING_SKULL, 23);
register(PaintingType.SKELETON, 24);
register(PaintingType.DONKEY_KONG, 25);
register(ScoreboardPosition.PLAYER_LIST, 0);
register(ScoreboardPosition.SIDEBAR, 1);

View file

@ -55,7 +55,7 @@ public class ServerSpawnPaintingPacket extends MinecraftPacket {
public void read(NetInput in) throws IOException {
this.entityId = in.readVarInt();
this.uuid = in.readUUID();
this.paintingType = MagicValues.key(PaintingType.class, in.readString());
this.paintingType = MagicValues.key(PaintingType.class, in.readVarInt());
this.position = NetUtil.readPosition(in);
this.direction = MagicValues.key(HangingDirection.class, in.readUnsignedByte());
}
@ -64,7 +64,7 @@ public class ServerSpawnPaintingPacket extends MinecraftPacket {
public void write(NetOutput out) throws IOException {
out.writeVarInt(this.entityId);
out.writeUUID(this.uuid);
out.writeString(MagicValues.value(String.class, this.paintingType));
out.writeVarInt(MagicValues.value(Integer.class, this.paintingType));
NetUtil.writePosition(out, this.position);
out.writeByte(MagicValues.value(Integer.class, this.direction));
}