From be56317d0c56df6086dd6684019f9c92d598f418 Mon Sep 17 00:00:00 2001 From: FlorianMichael Date: Wed, 3 Jul 2024 21:58:19 +0200 Subject: [PATCH] Update VV API usage --- .../rewriter/EntityPacketRewriter20w14infinite.java | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/main/java/net/raphimc/viaaprilfools/protocol/s20w14infinitetov1_16/rewriter/EntityPacketRewriter20w14infinite.java b/src/main/java/net/raphimc/viaaprilfools/protocol/s20w14infinitetov1_16/rewriter/EntityPacketRewriter20w14infinite.java index ab06da2..66f3c57 100644 --- a/src/main/java/net/raphimc/viaaprilfools/protocol/s20w14infinitetov1_16/rewriter/EntityPacketRewriter20w14infinite.java +++ b/src/main/java/net/raphimc/viaaprilfools/protocol/s20w14infinitetov1_16/rewriter/EntityPacketRewriter20w14infinite.java @@ -29,7 +29,6 @@ import com.viaversion.viaversion.protocols.v1_15_2to1_16.packet.ClientboundPackets1_16; import com.viaversion.viaversion.rewriter.EntityRewriter; import com.viaversion.viaversion.util.Key; -import net.raphimc.viaaprilfools.ViaAprilFools; import net.raphimc.viaaprilfools.protocol.s20w14infinitetov1_16.packet.ClientboundPackets20w14infinite; import net.raphimc.viaaprilfools.protocol.s20w14infinitetov1_16.Protocol20w14infiniteTo1_16; @@ -138,8 +137,8 @@ public void register() { if (attributeIdentifier == null) { attributeIdentifier = "minecraft:" + key; if (!Key.isValid(attributeIdentifier)) { - if (!Via.getConfig().isSuppressConversionWarnings() || Via.getManager().isDebug()) { - ViaAprilFools.getPlatform().getLogger().warning("Invalid attribute: " + key); + if (!Via.getConfig().isSuppressConversionWarnings()) { + protocol.getLogger().warning("Invalid attribute: " + key); } actualSize--; wrapper.read(Types.DOUBLE); @@ -172,12 +171,7 @@ public void register() { @Override protected void registerRewrites() { registerEntityDataTypeHandler(Types1_14.ENTITY_DATA_TYPES.itemType, Types1_14.ENTITY_DATA_TYPES.optionalBlockStateType, Types1_14.ENTITY_DATA_TYPES.particleType); - - filter().type(EntityTypes1_16.ABSTRACT_MINECART).index(10).handler((event, meta) -> { - // Convert to new block id - int data = (int) meta.getValue(); - meta.setValue(protocol.getMappingData().getNewBlockStateId(data)); - }); + registerBlockStateHandler(EntityTypes1_16.ABSTRACT_MINECART, 10); filter().type(EntityTypes1_16.ABSTRACT_ARROW).removeIndex(8); }