From b11c5e27c5d7e16c09f3ccad8d48200c479bd1e1 Mon Sep 17 00:00:00 2001 From: KennyTV Date: Wed, 15 Apr 2020 18:24:13 +0200 Subject: [PATCH] 20w16a, fix strider meta --- .../Protocol1_15_2To1_16.java | 40 +++++++++++++++---- .../packets/BlockItemPackets1_16.java | 2 +- .../packets/EntityPackets1_16.java | 9 ++++- .../viabackwards/data/mapping-1.15to1.16.json | 14 ++++++- 4 files changed, 52 insertions(+), 13 deletions(-) diff --git a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_15_2to1_16/Protocol1_15_2To1_16.java b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_15_2to1_16/Protocol1_15_2To1_16.java index f9747423..f3c27cfe 100644 --- a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_15_2to1_16/Protocol1_15_2To1_16.java +++ b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_15_2to1_16/Protocol1_15_2To1_16.java @@ -102,14 +102,6 @@ public class Protocol1_15_2To1_16 extends BackwardsProtocol { return oldId != null ? oldId : -1; }, Protocol1_15_2To1_16::getNewEntityId).register(0x5C, 0x5C); - // Set Jigsaw - registerIncoming(State.PLAY, 0x27, 0x27, new PacketRemapper() { - @Override - public void registerMap() { - handler(PacketWrapper::cancel); - } - }); - registerOutgoing(State.PLAY, 0x43, 0x4E); registerOutgoing(State.PLAY, 0x44, 0x43); @@ -122,6 +114,38 @@ public class Protocol1_15_2To1_16 extends BackwardsProtocol { registerOutgoing(State.PLAY, 0x4C, 0x4B); registerOutgoing(State.PLAY, 0x4D, 0x4C); registerOutgoing(State.PLAY, 0x4E, 0x4D); + + + cancelIncoming(State.PLAY, 0x27); // Set jigsaw + registerIncoming(State.PLAY, 0x10, 0x0F); + registerIncoming(State.PLAY, 0x11, 0x10); + registerIncoming(State.PLAY, 0x12, 0x11); + registerIncoming(State.PLAY, 0x13, 0x12); + registerIncoming(State.PLAY, 0x14, 0x13); + registerIncoming(State.PLAY, 0x15, 0x14); + registerIncoming(State.PLAY, 0x16, 0x15); + registerIncoming(State.PLAY, 0x17, 0x16); + registerIncoming(State.PLAY, 0x18, 0x17); + registerIncoming(State.PLAY, 0x19, 0x18); + registerIncoming(State.PLAY, 0x1A, 0x19); + registerIncoming(State.PLAY, 0x1B, 0x1A); + registerIncoming(State.PLAY, 0x1C, 0x1B); + registerIncoming(State.PLAY, 0x1D, 0x1C); + registerIncoming(State.PLAY, 0x1E, 0x1D); + registerIncoming(State.PLAY, 0x1F, 0x1E); + registerIncoming(State.PLAY, 0x20, 0x1F); + registerIncoming(State.PLAY, 0x21, 0x20); + registerIncoming(State.PLAY, 0x22, 0x21); + registerIncoming(State.PLAY, 0x23, 0x22); + registerIncoming(State.PLAY, 0x24, 0x23); + registerIncoming(State.PLAY, 0x25, 0x24); + registerIncoming(State.PLAY, 0x26, 0x25); + + registerIncoming(State.PLAY, 0x29, 0x28); + registerIncoming(State.PLAY, 0x2A, 0x29); + registerIncoming(State.PLAY, 0x2B, 0x2A); + registerIncoming(State.PLAY, 0x2C, 0x2B); + registerIncoming(State.PLAY, 0x2D, 0x2C); } public static int getNewEntityId(final int oldId) { diff --git a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_15_2to1_16/packets/BlockItemPackets1_16.java b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_15_2to1_16/packets/BlockItemPackets1_16.java index 02be53da..4240e095 100644 --- a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_15_2to1_16/packets/BlockItemPackets1_16.java +++ b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_15_2to1_16/packets/BlockItemPackets1_16.java @@ -98,7 +98,7 @@ public class BlockItemPackets1_16 extends nl.matsv.viabackwards.api.rewriters.It itemRewriter.registerClickWindow(Type.FLAT_VAR_INT_ITEM, 0x09, 0x09); // Creative Inventory Action - itemRewriter.registerCreativeInvAction(Type.FLAT_VAR_INT_ITEM, 0x26, 0x26); + itemRewriter.registerCreativeInvAction(Type.FLAT_VAR_INT_ITEM, 0x27, 0x26); // Acknowledge player digging blockRewriter.registerAcknowledgePlayerDigging(0x08, 0x08); diff --git a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_15_2to1_16/packets/EntityPackets1_16.java b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_15_2to1_16/packets/EntityPackets1_16.java index 9754c794..b4ee3538 100644 --- a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_15_2to1_16/packets/EntityPackets1_16.java +++ b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_15_2to1_16/packets/EntityPackets1_16.java @@ -99,8 +99,7 @@ public class EntityPackets1_16 extends EntityRewriter { mapEntity(Entity1_16Types.EntityType.HOGLIN, Entity1_16Types.EntityType.COW).jsonName("Hoglin"); mapEntity(Entity1_16Types.EntityType.ZOGLIN, Entity1_16Types.EntityType.COW).jsonName("Zoglin"); mapEntity(Entity1_16Types.EntityType.PIGLIN, Entity1_16Types.EntityType.ZOMBIFIED_PIGLIN).jsonName("Piglin"); - mapEntity(Entity1_16Types.EntityType.STRIDER, Entity1_16Types.EntityType.MAGMA_CUBE) - .spawnMetadata(storage -> storage.add(new Metadata(15, MetaType1_14.VarInt, 3))).jsonName("Strider"); + mapEntity(Entity1_16Types.EntityType.STRIDER, Entity1_16Types.EntityType.MAGMA_CUBE).jsonName("Strider"); registerMetaHandler().filter(Entity1_16Types.EntityType.ZOGLIN, 16).removed(); registerMetaHandler().filter(Entity1_16Types.EntityType.HOGLIN, 15).removed(); @@ -108,6 +107,12 @@ public class EntityPackets1_16 extends EntityRewriter { registerMetaHandler().filter(Entity1_16Types.EntityType.PIGLIN, 16).removed(); // charging crossbow registerMetaHandler().filter(Entity1_16Types.EntityType.PIGLIN, 17).removed(); + registerMetaHandler().filter(Entity1_16Types.EntityType.STRIDER, 15).handle(meta -> { + boolean baby = meta.getData().getCastedValue(); + meta.getData().setValue(baby ? 1 : 3); + meta.getData().setMetaType(MetaType1_14.VarInt); + return meta.getData(); + }); registerMetaHandler().filter(Entity1_16Types.EntityType.STRIDER, 16).removed(); registerMetaHandler().filter(Entity1_16Types.EntityType.STRIDER, 17).removed(); registerMetaHandler().filter(Entity1_16Types.EntityType.STRIDER, 18).removed(); diff --git a/core/src/main/resources/assets/viabackwards/data/mapping-1.15to1.16.json b/core/src/main/resources/assets/viabackwards/data/mapping-1.15to1.16.json index 5babb35a..52627bd6 100644 --- a/core/src/main/resources/assets/viabackwards/data/mapping-1.15to1.16.json +++ b/core/src/main/resources/assets/viabackwards/data/mapping-1.15to1.16.json @@ -5674,7 +5674,8 @@ "minecraft:polished_blackstone_button": "minecraft:stone_button[", "minecraft:chiseled_nether_bricks": "minecraft:nether_bricks", "minecraft:cracked_nether_bricks": "minecraft:nether_bricks", - "minecraft:quartz_bricks": "minecraft:quartz_block" + "minecraft:quartz_bricks": "minecraft:quartz_block", + "minecraft:chain": "minecraft:air" }, "items": { "minecraft:crimson_nylium": { @@ -6036,6 +6037,14 @@ "minecraft:cracked_polished_blackstone_bricks": { "id": "minecraft:red_nether_bricks", "name": "1.16 Cracked Polished Blackstone Bricks" + }, + "minecraft:chain": { + "id": "minecraft:iron_bars", + "name": "1.16 Chain" + }, + "minecraft:music_disc_pigstep": { + "id": "minecraft:music_disc_13", + "name": "1.16 Pigstep Music Disc" } }, "sounds": { @@ -6196,6 +6205,7 @@ "music.nether.soul_sand_valley": "music.nether", "music.nether.crimson_forest": "music.nether", "music.nether.warped_forest": "music.nether", - "entity.strider.saddle": "entity.horse.saddle" + "entity.strider.saddle": "entity.horse.saddle", + "music_disc.pigstep": "" } } \ No newline at end of file