From 9a26ac380a150ce269c730f09d09133a82e0ad67 Mon Sep 17 00:00:00 2001 From: creeper123123321 Date: Sun, 6 Jan 2019 08:28:08 -0200 Subject: [PATCH 1/3] send signs tags --- .../Protocol1_14To1_13_2.java | 28 ++++++++++++++++--- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14to1_13_2/Protocol1_14To1_13_2.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14to1_13_2/Protocol1_14To1_13_2.java index 9cdef38e5..99057bdb4 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14to1_13_2/Protocol1_14To1_13_2.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14to1_13_2/Protocol1_14To1_13_2.java @@ -119,7 +119,7 @@ public class Protocol1_14To1_13_2 extends Protocol { }); } }); - + registerOutgoing(State.PLAY, 0x52, 0x54); registerOutgoing(State.PLAY, 0x53, 0x55); @@ -129,7 +129,8 @@ public class Protocol1_14To1_13_2 extends Protocol { handler(new PacketHandler() { @Override public void handle(PacketWrapper wrapper) throws Exception { - int blockTagsSize = wrapper.passthrough(Type.VAR_INT); // block tags + int blockTagsSize; + wrapper.write(Type.VAR_INT, (blockTagsSize = wrapper.passthrough(Type.VAR_INT)) + 3); // block tags for (int i = 0; i < blockTagsSize; i++) { wrapper.passthrough(Type.STRING); Integer[] blockIds = wrapper.passthrough(Type.VAR_INT_ARRAY); @@ -137,7 +138,21 @@ public class Protocol1_14To1_13_2 extends Protocol { blockIds[j] = getNewBlockId(blockIds[j]); } } - int itemTagsSize = wrapper.passthrough(Type.VAR_INT); // item tags + // Minecraft crashes if we not send signs tags + wrapper.write(Type.STRING, "minecraft:signs"); + wrapper.write(Type.VAR_INT_ARRAY, new Integer[]{ + getNewBlockId(150), getNewBlockId(155) + }); + wrapper.write(Type.STRING, "minecraft:wall_signs"); + wrapper.write(Type.VAR_INT_ARRAY, new Integer[]{ + getNewBlockId(155) + }); + wrapper.write(Type.STRING, "minecraft:standing_signs"); + wrapper.write(Type.VAR_INT_ARRAY, new Integer[]{ + getNewBlockId(150) + }); + int itemTagsSize; + wrapper.write(Type.VAR_INT, (itemTagsSize = wrapper.read(Type.VAR_INT)) + 1); // item tags for (int i = 0; i < itemTagsSize; i++) { wrapper.passthrough(Type.STRING); Integer[] itemIds = wrapper.passthrough(Type.VAR_INT_ARRAY); @@ -145,12 +160,17 @@ public class Protocol1_14To1_13_2 extends Protocol { itemIds[j] = InventoryPackets.getNewItemId(itemIds[j]); } } + // Should fix fuel shift clicking + wrapper.write(Type.STRING, "minecraft:signs"); + wrapper.write(Type.VAR_INT_ARRAY, new Integer[]{ + InventoryPackets.getNewItemId(541) + }); int fluidTagsSize = wrapper.passthrough(Type.VAR_INT); // fluid tags for (int i = 0; i < fluidTagsSize; i++) { wrapper.passthrough(Type.STRING); wrapper.passthrough(Type.VAR_INT_ARRAY); } - wrapper.write(Type.VAR_INT, 0); // new unknown tags + wrapper.write(Type.VAR_INT, 0); // new entity tags - do we need to send this? } }); } From a27efd94c802e7f11833ba37b35ebad9657924d3 Mon Sep 17 00:00:00 2001 From: creeper123123321 Date: Sun, 6 Jan 2019 08:43:25 -0200 Subject: [PATCH 2/3] oops --- .../protocol1_14to1_13_2/Protocol1_14To1_13_2.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14to1_13_2/Protocol1_14To1_13_2.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14to1_13_2/Protocol1_14To1_13_2.java index 99057bdb4..7edf95ec5 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14to1_13_2/Protocol1_14To1_13_2.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14to1_13_2/Protocol1_14To1_13_2.java @@ -129,8 +129,8 @@ public class Protocol1_14To1_13_2 extends Protocol { handler(new PacketHandler() { @Override public void handle(PacketWrapper wrapper) throws Exception { - int blockTagsSize; - wrapper.write(Type.VAR_INT, (blockTagsSize = wrapper.passthrough(Type.VAR_INT)) + 3); // block tags + int blockTagsSize = wrapper.read(Type.VAR_INT); + wrapper.write(Type.VAR_INT, blockTagsSize + 3); // block tags for (int i = 0; i < blockTagsSize; i++) { wrapper.passthrough(Type.STRING); Integer[] blockIds = wrapper.passthrough(Type.VAR_INT_ARRAY); @@ -151,8 +151,8 @@ public class Protocol1_14To1_13_2 extends Protocol { wrapper.write(Type.VAR_INT_ARRAY, new Integer[]{ getNewBlockId(150) }); - int itemTagsSize; - wrapper.write(Type.VAR_INT, (itemTagsSize = wrapper.read(Type.VAR_INT)) + 1); // item tags + int itemTagsSize = wrapper.read(Type.VAR_INT); + wrapper.write(Type.VAR_INT, itemTagsSize + 1); // item tags for (int i = 0; i < itemTagsSize; i++) { wrapper.passthrough(Type.STRING); Integer[] itemIds = wrapper.passthrough(Type.VAR_INT_ARRAY); From c88655a2a0cbb70b62b9af484dfc91007089af54 Mon Sep 17 00:00:00 2001 From: creeper123123321 Date: Sun, 6 Jan 2019 09:08:29 -0200 Subject: [PATCH 3/3] fix player digging --- .../protocols/protocol1_9to1_8/packets/WorldPackets.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/packets/WorldPackets.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/packets/WorldPackets.java index ef5d836ba..208e9784c 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/packets/WorldPackets.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/packets/WorldPackets.java @@ -267,7 +267,7 @@ public class WorldPackets { public void registerMap() { map(Type.VAR_INT, Type.UNSIGNED_BYTE); // 0 - Status map(Type.POSITION); // 1 - Position - map(Type.UNSIGNED_BYTE); // 2 - Face + map(Type.BYTE); // 2 - Face handler(new PacketHandler() { @Override public void handle(PacketWrapper wrapper) throws Exception {