From 5bd87867377b5acbf7a76d75513230a45083c18d Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Sun, 5 May 2024 12:22:17 +0200 Subject: [PATCH] Update entity mapping usage --- .../api/rewriters/EntityRewriterBase.java | 23 ------------------ .../packets/EntityPackets1_14.java | 23 ++++++++++-------- .../packets/EntityPackets1_16.java | 19 ++++++++------- .../packets/EntityPackets1_16_2.java | 11 ++++++--- .../packets/EntityPackets1_17.java | 18 ++++++++------ .../data/mappings-1.14to1.13.2.nbt | Bin 15127 -> 15311 bytes .../viabackwards/data/mappings-1.15to1.14.nbt | Bin 5293 -> 5373 bytes .../data/mappings-1.16.2to1.16.nbt | Bin 1087 -> 1159 bytes .../viabackwards/data/mappings-1.16to1.15.nbt | Bin 59760 -> 60099 bytes .../data/mappings-1.17to1.16.2.nbt | Bin 22976 -> 23104 bytes 10 files changed, 40 insertions(+), 54 deletions(-) diff --git a/common/src/main/java/com/viaversion/viabackwards/api/rewriters/EntityRewriterBase.java b/common/src/main/java/com/viaversion/viabackwards/api/rewriters/EntityRewriterBase.java index 58795978..a3f2b334 100644 --- a/common/src/main/java/com/viaversion/viabackwards/api/rewriters/EntityRewriterBase.java +++ b/common/src/main/java/com/viaversion/viabackwards/api/rewriters/EntityRewriterBase.java @@ -23,7 +23,6 @@ import com.viaversion.viabackwards.api.BackwardsProtocol; import com.viaversion.viabackwards.api.entities.storage.EntityData; import com.viaversion.viabackwards.api.entities.storage.WrappedMetadata; import com.viaversion.viaversion.api.connection.UserConnection; -import com.viaversion.viaversion.api.data.Int2IntMapMappings; import com.viaversion.viaversion.api.data.entity.StoredEntityData; import com.viaversion.viaversion.api.data.entity.TrackedEntity; import com.viaversion.viaversion.api.minecraft.ClientWorld; @@ -163,28 +162,6 @@ public abstract class EntityRewriterBase new enum type - */ - @Override - public & EntityType> void mapTypes(EntityType[] oldTypes, Class newTypeClass) { - if (typeMappings == null) { - typeMappings = Int2IntMapMappings.of(); - } - for (EntityType oldType : oldTypes) { - try { - E newType = Enum.valueOf(newTypeClass, oldType.name()); - typeMappings.setNewId(oldType.getId(), newType.getId()); - } catch (IllegalArgumentException ignored) { - // Don't warn - } - } - } - public void registerMetaTypeHandler( @Nullable MetaType itemType, @Nullable MetaType blockStateType, diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_13_2to1_14/packets/EntityPackets1_14.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_13_2to1_14/packets/EntityPackets1_14.java index ffce82c1..2a256419 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_13_2to1_14/packets/EntityPackets1_14.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_13_2to1_14/packets/EntityPackets1_14.java @@ -331,16 +331,6 @@ public class EntityPackets1_14 extends LegacyEntityRewriter { int typeId = meta.metaType().typeId(); if (typeId <= 15) { @@ -499,6 +489,19 @@ public class EntityPackets1_14 extends LegacyEntityRewriterMSrdC(6cUxDDk(T#Os=4i-;+ zKlR?vugjwo+S;kPtrX(B`q3PY?h!St`FRuMl{@KztLAQ}Du delta 12 TcmX?KKD}&%y4dFXVjolhDL)1M diff --git a/common/src/main/resources/assets/viabackwards/data/mappings-1.15to1.14.nbt b/common/src/main/resources/assets/viabackwards/data/mappings-1.15to1.14.nbt index bdf82eac52049fc1bd8c2523006b1e97334f993a..b62aa457c69e7d4bba525e0fc16c7fe12283c35b 100644 GIT binary patch delta 90 zcmZ3h`B!tp7Cv8&)Vz|+lFZa%W(Ka@#Dap6vP@X8)zRv( zv2c{-C!Ew!LK!DG#Tlxo;~W>b#1&d_af2>yaff@XdkhcgV}voLnBxVn2q8(IFjOQ< zCQ=~>BVduK5!wg3PC delta 19 bcmX?nmHERZ<_-P(HXq-AoO|=i(^B#PbAAfR diff --git a/common/src/main/resources/assets/viabackwards/data/mappings-1.17to1.16.2.nbt b/common/src/main/resources/assets/viabackwards/data/mappings-1.17to1.16.2.nbt index e5f490fbf84c8810a24d50d95fe16b96cc5ce282..742748c86eefc9c587d661a7f63aec20b511bffb 100644 GIT binary patch delta 142 zcmX@Gneo6D#tq9=>p4>MN-|3_Q;V4yxN;K<3Q|*oGpkY=7#MOG8JIFt7?~MZiXj4p z+zd>KB|sStAZ7+)79dstVnrZU0%Bz#HUwfLpu&=TAOoZ@3W!09)qpq;~jng9SY=LNF>