From e68ddf42b0dde13ffadc20c6f1fe7825379cc012 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Sat, 21 Oct 2023 13:41:39 +1000 Subject: [PATCH] Update VV usage --- .../packets/BlockItemPackets1_11.java | 6 +++--- .../packets/BlockItemPackets1_12.java | 2 +- .../packets/ItemPackets1_11_1.java | 2 +- .../protocol1_12_2to1_13/data/ParticleMapping.java | 12 ++++++------ .../packets/BlockItemPackets1_13.java | 4 ++-- .../packets/EntityPackets1_13.java | 4 ++-- .../packets/EntityPackets1_14.java | 2 +- .../packets/EntityPackets1_13_1.java | 4 ++-- .../packets/EntityPackets1_16.java | 2 +- .../packets/EntityPackets1_17.java | 4 ++-- .../packets/EntityPackets1_18.java | 8 ++++---- .../packets/EntityPackets1_19.java | 4 ++-- .../packets/BlockItemPackets1_10.java | 2 +- 13 files changed, 28 insertions(+), 28 deletions(-) diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_10to1_11/packets/BlockItemPackets1_11.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_10to1_11/packets/BlockItemPackets1_11.java index 72b54ea1..3a9bb7fd 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_10to1_11/packets/BlockItemPackets1_11.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_10to1_11/packets/BlockItemPackets1_11.java @@ -89,10 +89,10 @@ public class BlockItemPackets1_11 extends LegacyBlockItemRewriter { - Item[] stacks = wrapper.get(Type.ITEM1_8_ARRAY, 0); + Item[] stacks = wrapper.get(Type.ITEM1_8_SHORT_ARRAY, 0); for (int i = 0; i < stacks.length; i++) stacks[i] = handleItemToClient(stacks[i]); @@ -107,7 +107,7 @@ public class BlockItemPackets1_11 extends LegacyBlockItemRewriter Trading diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_11to1_11_1/packets/ItemPackets1_11_1.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_11to1_11_1/packets/ItemPackets1_11_1.java index 5345d692..1055df8a 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_11to1_11_1/packets/ItemPackets1_11_1.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_11to1_11_1/packets/ItemPackets1_11_1.java @@ -40,7 +40,7 @@ public class ItemPackets1_11_1 extends LegacyBlockItemRewriter Trading diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_12_2to1_13/data/ParticleMapping.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_12_2to1_13/data/ParticleMapping.java index 8f8520b6..57fcafde 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_12_2to1_13/data/ParticleMapping.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_12_2to1_13/data/ParticleMapping.java @@ -19,10 +19,10 @@ package com.viaversion.viabackwards.protocol.protocol1_12_2to1_13.data; import com.viaversion.viabackwards.protocol.protocol1_12_2to1_13.Protocol1_12_2To1_13; +import com.viaversion.viaversion.api.minecraft.Particle; import com.viaversion.viaversion.api.minecraft.item.Item; import com.viaversion.viaversion.api.protocol.packet.PacketWrapper; import com.viaversion.viaversion.api.type.Type; -import com.viaversion.viaversion.api.type.types.Particle; import java.util.List; public class ParticleMapping { @@ -36,7 +36,7 @@ public class ParticleMapping { } @Override - public int[] rewrite(Protocol1_12_2To1_13 protocol, List data) { + public int[] rewrite(Protocol1_12_2To1_13 protocol, List> data) { return rewrite((int) data.get(0).getValue()); } @@ -85,7 +85,7 @@ public class ParticleMapping { } @Override - public int[] rewrite(Protocol1_12_2To1_13 protocol, List data) { + public int[] rewrite(Protocol1_12_2To1_13 protocol, List> data) { return null; } }), // (11->30) minecraft:dust -> reddust @@ -112,7 +112,7 @@ public class ParticleMapping { } @Override - public int[] rewrite(Protocol1_12_2To1_13 protocol, List data) { + public int[] rewrite(Protocol1_12_2To1_13 protocol, List> data) { return rewrite(protocol, (Item) data.get(0).getValue()); } @@ -162,7 +162,7 @@ public class ParticleMapping { int[] rewrite(Protocol1_12_2To1_13 protocol, PacketWrapper wrapper) throws Exception; - int[] rewrite(Protocol1_12_2To1_13 protocol, List data); + int[] rewrite(Protocol1_12_2To1_13 protocol, List> data); default boolean isBlockHandler() { return false; @@ -187,7 +187,7 @@ public class ParticleMapping { return handler.rewrite(protocol, wrapper); } - public int[] rewriteMeta(Protocol1_12_2To1_13 protocol, List data) { + public int[] rewriteMeta(Protocol1_12_2To1_13 protocol, List> data) { if (handler == null) return null; return handler.rewrite(protocol, data); } diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_12_2to1_13/packets/BlockItemPackets1_13.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_12_2to1_13/packets/BlockItemPackets1_13.java index 626586fa..8beff0c6 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_12_2to1_13/packets/BlockItemPackets1_13.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_12_2to1_13/packets/BlockItemPackets1_13.java @@ -238,9 +238,9 @@ public class BlockItemPackets1_13 extends com.viaversion.viabackwards.api.rewrit @Override public void register() { map(Type.UNSIGNED_BYTE); - map(Type.ITEM1_13_ARRAY, Type.ITEM1_8_ARRAY); + map(Type.ITEM1_13_ARRAY, Type.ITEM1_8_SHORT_ARRAY); - handler(itemArrayToClientHandler(Type.ITEM1_8_ARRAY)); + handler(itemArrayToClientHandler(Type.ITEM1_8_SHORT_ARRAY)); } }); diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_12_2to1_13/packets/EntityPackets1_13.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_12_2to1_13/packets/EntityPackets1_13.java index 708d0fe8..61076b94 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_12_2to1_13/packets/EntityPackets1_13.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_12_2to1_13/packets/EntityPackets1_13.java @@ -26,15 +26,15 @@ import com.viaversion.viabackwards.protocol.protocol1_12_2to1_13.data.PaintingMa import com.viaversion.viabackwards.protocol.protocol1_12_2to1_13.data.ParticleMapping; import com.viaversion.viabackwards.protocol.protocol1_12_2to1_13.storage.BackwardsBlockStorage; import com.viaversion.viabackwards.protocol.protocol1_12_2to1_13.storage.PlayerPositionStorage1_13; -import com.viaversion.viaversion.api.minecraft.entities.EntityTypes1_13; +import com.viaversion.viaversion.api.minecraft.Particle; import com.viaversion.viaversion.api.minecraft.entities.EntityType; +import com.viaversion.viaversion.api.minecraft.entities.EntityTypes1_13; import com.viaversion.viaversion.api.minecraft.item.Item; import com.viaversion.viaversion.api.minecraft.metadata.Metadata; import com.viaversion.viaversion.api.minecraft.metadata.types.MetaType1_12; import com.viaversion.viaversion.api.protocol.packet.PacketWrapper; import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers; import com.viaversion.viaversion.api.type.Type; -import com.viaversion.viaversion.api.type.types.Particle; import com.viaversion.viaversion.api.type.types.version.Types1_12; import com.viaversion.viaversion.api.type.types.version.Types1_13; import com.viaversion.viaversion.libs.gson.JsonElement; 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 f4c73edd..84bd7b67 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 @@ -27,6 +27,7 @@ import com.viaversion.viabackwards.protocol.protocol1_13_2to1_14.storage.Difficu import com.viaversion.viabackwards.protocol.protocol1_13_2to1_14.storage.EntityPositionStorage1_14; import com.viaversion.viaversion.api.data.entity.EntityTracker; import com.viaversion.viaversion.api.minecraft.ClientWorld; +import com.viaversion.viaversion.api.minecraft.Particle; import com.viaversion.viaversion.api.minecraft.Position; import com.viaversion.viaversion.api.minecraft.VillagerData; import com.viaversion.viaversion.api.minecraft.entities.EntityType; @@ -36,7 +37,6 @@ import com.viaversion.viaversion.api.minecraft.metadata.Metadata; import com.viaversion.viaversion.api.protocol.packet.PacketWrapper; import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers; import com.viaversion.viaversion.api.type.Type; -import com.viaversion.viaversion.api.type.types.Particle; import com.viaversion.viaversion.api.type.types.version.Types1_13_2; import com.viaversion.viaversion.api.type.types.version.Types1_14; import com.viaversion.viaversion.protocols.protocol1_13to1_12_2.ClientboundPackets1_13; diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_13to1_13_1/packets/EntityPackets1_13_1.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_13to1_13_1/packets/EntityPackets1_13_1.java index 4d558615..5c222e3e 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_13to1_13_1/packets/EntityPackets1_13_1.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_13to1_13_1/packets/EntityPackets1_13_1.java @@ -20,13 +20,13 @@ package com.viaversion.viabackwards.protocol.protocol1_13to1_13_1.packets; import com.viaversion.viabackwards.ViaBackwards; import com.viaversion.viabackwards.api.rewriters.LegacyEntityRewriter; import com.viaversion.viabackwards.protocol.protocol1_13to1_13_1.Protocol1_13To1_13_1; -import com.viaversion.viaversion.api.minecraft.entities.EntityTypes1_13; +import com.viaversion.viaversion.api.minecraft.Particle; import com.viaversion.viaversion.api.minecraft.entities.EntityType; +import com.viaversion.viaversion.api.minecraft.entities.EntityTypes1_13; import com.viaversion.viaversion.api.minecraft.item.Item; import com.viaversion.viaversion.api.minecraft.metadata.Metadata; import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers; import com.viaversion.viaversion.api.type.Type; -import com.viaversion.viaversion.api.type.types.Particle; import com.viaversion.viaversion.api.type.types.version.Types1_13; import com.viaversion.viaversion.libs.gson.JsonElement; import com.viaversion.viaversion.protocols.protocol1_13to1_12_2.ClientboundPackets1_13; diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_15_2to1_16/packets/EntityPackets1_16.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_15_2to1_16/packets/EntityPackets1_16.java index fe79727c..681b7d06 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_15_2to1_16/packets/EntityPackets1_16.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_15_2to1_16/packets/EntityPackets1_16.java @@ -24,6 +24,7 @@ import com.viaversion.viabackwards.protocol.protocol1_15_2to1_16.storage.WolfDat import com.viaversion.viaversion.api.Via; import com.viaversion.viaversion.api.data.entity.StoredEntityData; import com.viaversion.viaversion.api.minecraft.ClientWorld; +import com.viaversion.viaversion.api.minecraft.Particle; import com.viaversion.viaversion.api.minecraft.entities.EntityType; import com.viaversion.viaversion.api.minecraft.entities.EntityTypes1_15; import com.viaversion.viaversion.api.minecraft.entities.EntityTypes1_16; @@ -35,7 +36,6 @@ import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers; import com.viaversion.viaversion.api.protocol.remapper.ValueTransformer; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import com.viaversion.viaversion.api.type.Type; -import com.viaversion.viaversion.api.type.types.Particle; import com.viaversion.viaversion.api.type.types.version.Types1_14; import com.viaversion.viaversion.api.type.types.version.Types1_16; import com.viaversion.viaversion.libs.gson.JsonElement; diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_16_4to1_17/packets/EntityPackets1_17.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_16_4to1_17/packets/EntityPackets1_17.java index f84fdf1f..5065b06c 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_16_4to1_17/packets/EntityPackets1_17.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_16_4to1_17/packets/EntityPackets1_17.java @@ -20,13 +20,13 @@ package com.viaversion.viabackwards.protocol.protocol1_16_4to1_17.packets; import com.viaversion.viabackwards.ViaBackwards; import com.viaversion.viabackwards.api.rewriters.EntityRewriter; import com.viaversion.viabackwards.protocol.protocol1_16_4to1_17.Protocol1_16_4To1_17; +import com.viaversion.viaversion.api.minecraft.Particle; +import com.viaversion.viaversion.api.minecraft.entities.EntityType; import com.viaversion.viaversion.api.minecraft.entities.EntityTypes1_16_2; import com.viaversion.viaversion.api.minecraft.entities.EntityTypes1_17; -import com.viaversion.viaversion.api.minecraft.entities.EntityType; import com.viaversion.viaversion.api.minecraft.metadata.MetaType; import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers; import com.viaversion.viaversion.api.type.Type; -import com.viaversion.viaversion.api.type.types.Particle; import com.viaversion.viaversion.api.type.types.version.Types1_16; import com.viaversion.viaversion.api.type.types.version.Types1_17; import com.viaversion.viaversion.libs.opennbt.tag.builtin.CompoundTag; diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_17_1to1_18/packets/EntityPackets1_18.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_17_1to1_18/packets/EntityPackets1_18.java index 7cfed28b..85ca1a2c 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_17_1to1_18/packets/EntityPackets1_18.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_17_1to1_18/packets/EntityPackets1_18.java @@ -19,12 +19,12 @@ package com.viaversion.viabackwards.protocol.protocol1_17_1to1_18.packets; import com.viaversion.viabackwards.api.rewriters.EntityRewriter; import com.viaversion.viabackwards.protocol.protocol1_17_1to1_18.Protocol1_17_1To1_18; -import com.viaversion.viaversion.api.minecraft.entities.EntityTypes1_17; +import com.viaversion.viaversion.api.minecraft.Particle; import com.viaversion.viaversion.api.minecraft.entities.EntityType; +import com.viaversion.viaversion.api.minecraft.entities.EntityTypes1_17; import com.viaversion.viaversion.api.minecraft.metadata.MetaType; import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers; import com.viaversion.viaversion.api.type.Type; -import com.viaversion.viaversion.api.type.types.Particle; import com.viaversion.viaversion.api.type.types.version.Types1_17; import com.viaversion.viaversion.api.type.types.version.Types1_18; import com.viaversion.viaversion.libs.opennbt.tag.builtin.CompoundTag; @@ -99,9 +99,9 @@ public final class EntityPackets1_18 extends EntityRewriter data = particle.getArguments().remove(0); int blockState = (int) data.getValue(); if (blockState == 7786) { // Light block particle.setId(3); diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_18_2to1_19/packets/EntityPackets1_19.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_18_2to1_19/packets/EntityPackets1_19.java index 839801f3..913c66a0 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_18_2to1_19/packets/EntityPackets1_19.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_18_2to1_19/packets/EntityPackets1_19.java @@ -23,14 +23,14 @@ import com.viaversion.viabackwards.protocol.protocol1_18_2to1_19.storage.Dimensi import com.viaversion.viabackwards.protocol.protocol1_18_2to1_19.storage.StoredPainting; import com.viaversion.viaversion.api.data.ParticleMappings; import com.viaversion.viaversion.api.data.entity.StoredEntityData; +import com.viaversion.viaversion.api.minecraft.Particle; import com.viaversion.viaversion.api.minecraft.Position; -import com.viaversion.viaversion.api.minecraft.entities.EntityTypes1_19; import com.viaversion.viaversion.api.minecraft.entities.EntityType; +import com.viaversion.viaversion.api.minecraft.entities.EntityTypes1_19; import com.viaversion.viaversion.api.minecraft.metadata.MetaType; import com.viaversion.viaversion.api.protocol.packet.PacketWrapper; import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers; import com.viaversion.viaversion.api.type.Type; -import com.viaversion.viaversion.api.type.types.Particle; import com.viaversion.viaversion.api.type.types.version.Types1_18; import com.viaversion.viaversion.api.type.types.version.Types1_19; import com.viaversion.viaversion.libs.opennbt.tag.builtin.CompoundTag; diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_9_4to1_10/packets/BlockItemPackets1_10.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_9_4to1_10/packets/BlockItemPackets1_10.java index 453e6cce..5caeb613 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_9_4to1_10/packets/BlockItemPackets1_10.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_9_4to1_10/packets/BlockItemPackets1_10.java @@ -39,7 +39,7 @@ public class BlockItemPackets1_10 extends LegacyBlockItemRewriter