From e1b06d387230ee2a60a780985934700ead850c17 Mon Sep 17 00:00:00 2001 From: creeper123123321 Date: Wed, 1 May 2019 16:37:17 -0300 Subject: [PATCH 1/2] Add some needed tags --- .../Protocol1_14To1_13_2.java | 37 ++++++++++++++++++- 1 file changed, 35 insertions(+), 2 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 5db69490f..47dc71764 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 @@ -148,7 +148,7 @@ public class Protocol1_14To1_13_2 extends Protocol { @Override public void handle(PacketWrapper wrapper) throws Exception { int blockTagsSize = wrapper.read(Type.VAR_INT); - wrapper.write(Type.VAR_INT, blockTagsSize + 3); // block tags + wrapper.write(Type.VAR_INT, blockTagsSize + 5); // block tags for (int i = 0; i < blockTagsSize; i++) { wrapper.passthrough(Type.STRING); Integer[] blockIds = wrapper.passthrough(Type.VAR_INT_ARRAY); @@ -169,8 +169,36 @@ public class Protocol1_14To1_13_2 extends Protocol { wrapper.write(Type.VAR_INT_ARRAY, new Integer[]{ getNewBlockId(150) }); + // Fences and walls tags - used for block connections + wrapper.write(Type.STRING, "minecraft:fences"); + wrapper.write(Type.VAR_INT_ARRAY, new Integer[]{ + 216, + 217, + 218, + 219, + 220, + 221, + 227 + }); + wrapper.write(Type.STRING, "minecraft:walls"); + wrapper.write(Type.VAR_INT_ARRAY, new Integer[]{ + 245, + 246, + 247, + 248, + 249, + 250, + 251, + 252, + 253, + 254, + 255, + 256, + 257, + 258 + }); int itemTagsSize = wrapper.read(Type.VAR_INT); - wrapper.write(Type.VAR_INT, itemTagsSize + 1); // item tags + wrapper.write(Type.VAR_INT, itemTagsSize + 2); // item tags for (int i = 0; i < itemTagsSize; i++) { wrapper.passthrough(Type.STRING); Integer[] itemIds = wrapper.passthrough(Type.VAR_INT_ARRAY); @@ -183,6 +211,11 @@ public class Protocol1_14To1_13_2 extends Protocol { wrapper.write(Type.VAR_INT_ARRAY, new Integer[]{ InventoryPackets.getNewItemId(541) }); + // Arrows tag (used by bow) + wrapper.write(Type.STRING, "minecraft:arrows"); + wrapper.write(Type.VAR_INT_ARRAY, new Integer[]{ + 526, 825, 826 + }); int fluidTagsSize = wrapper.passthrough(Type.VAR_INT); // fluid tags for (int i = 0; i < fluidTagsSize; i++) { wrapper.passthrough(Type.STRING); From e249ea1f0a4b084e88f2d545e14a72019f9e0a2e Mon Sep 17 00:00:00 2001 From: creeper123123321 Date: Wed, 1 May 2019 16:54:09 -0300 Subject: [PATCH 2/2] fix tag ids - not tested --- .../Protocol1_14To1_13_2.java | 29 +++++-------------- 1 file changed, 8 insertions(+), 21 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 47dc71764..d572f45ea 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 @@ -172,30 +172,17 @@ public class Protocol1_14To1_13_2 extends Protocol { // Fences and walls tags - used for block connections wrapper.write(Type.STRING, "minecraft:fences"); wrapper.write(Type.VAR_INT_ARRAY, new Integer[]{ - 216, - 217, - 218, - 219, - 220, - 221, - 227 + 189, + 248, + 472, + 473, + 474, + 475 }); wrapper.write(Type.STRING, "minecraft:walls"); wrapper.write(Type.VAR_INT_ARRAY, new Integer[]{ - 245, - 246, - 247, - 248, - 249, - 250, - 251, - 252, - 253, - 254, - 255, - 256, - 257, - 258 + 271, + 272, }); int itemTagsSize = wrapper.read(Type.VAR_INT); wrapper.write(Type.VAR_INT, itemTagsSize + 2); // item tags