diff --git a/src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_2_1_3to1_1/types/Chunk1_1Type.java b/src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_2_1_3to1_1/types/ChunkType1_1.java similarity index 99% rename from src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_2_1_3to1_1/types/Chunk1_1Type.java rename to src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_2_1_3to1_1/types/ChunkType1_1.java index ec643e6..9c35631 100644 --- a/src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_2_1_3to1_1/types/Chunk1_1Type.java +++ b/src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_2_1_3to1_1/types/ChunkType1_1.java @@ -32,9 +32,9 @@ import java.util.zip.DataFormatException; import java.util.zip.Inflater; -public class Chunk1_1Type extends Type { +public class ChunkType1_1 extends Type { - public Chunk1_1Type() { + public ChunkType1_1() { super(Chunk.class); } diff --git a/src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_2_1_3to1_1/types/Types1_1.java b/src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_2_1_3to1_1/types/Types1_1.java index 737fa7e..401ba80 100644 --- a/src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_2_1_3to1_1/types/Types1_1.java +++ b/src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_2_1_3to1_1/types/Types1_1.java @@ -24,6 +24,6 @@ public class Types1_1 { public static Type BLOCK_CHANGE_RECORD_ARRAY = new BlockChangeRecordArrayType(); - public static Type CHUNK = new Chunk1_1Type(); + public static Type CHUNK = new ChunkType1_1(); } diff --git a/src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_3_1_2to1_2_4_5/Protocol1_3_1_2to1_2_4_5.java b/src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_3_1_2to1_2_4_5/Protocol1_3_1_2to1_2_4_5.java index 6796b47..eeaf231 100644 --- a/src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_3_1_2to1_2_4_5/Protocol1_3_1_2to1_2_4_5.java +++ b/src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_3_1_2to1_2_4_5/Protocol1_3_1_2to1_2_4_5.java @@ -67,7 +67,7 @@ import net.raphimc.vialegacy.protocols.release.protocol1_7_2_5to1_6_4.storage.ProtocolMetadataStorage; import net.raphimc.vialegacy.protocols.release.protocol1_7_2_5to1_6_4.types.Types1_6_4; import net.raphimc.vialegacy.protocols.release.protocol1_8to1_7_6_10.metadata.MetaIndex1_8to1_7_6; -import net.raphimc.vialegacy.protocols.release.protocol1_8to1_7_6_10.types.Chunk1_7_6Type; +import net.raphimc.vialegacy.protocols.release.protocol1_8to1_7_6_10.types.ChunkType1_7_6; import net.raphimc.vialegacy.protocols.release.protocol1_8to1_7_6_10.types.Types1_7_6; import java.util.ArrayList; @@ -459,7 +459,7 @@ public void register() { if (!load) { final Chunk chunk = new BaseChunk(chunkX, chunkZ, true, false, 0, new ChunkSection[16], null, new ArrayList<>()); - wrapper.write(new Chunk1_7_6Type(wrapper.user().get(ClientWorld.class)), chunk); + wrapper.write(new ChunkType1_7_6(wrapper.user().get(ClientWorld.class)), chunk); } else { wrapper.cancel(); } @@ -496,7 +496,7 @@ public void register() { } } } - wrapper.write(new Chunk1_7_6Type(clientWorld), chunk); + wrapper.write(new ChunkType1_7_6(clientWorld), chunk); }); } }); diff --git a/src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_3_1_2to1_2_4_5/types/Chunk1_2_4Type.java b/src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_3_1_2to1_2_4_5/types/ChunkType1_2_4.java similarity index 95% rename from src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_3_1_2to1_2_4_5/types/Chunk1_2_4Type.java rename to src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_3_1_2to1_2_4_5/types/ChunkType1_2_4.java index 6f8dddb..d1231b6 100644 --- a/src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_3_1_2to1_2_4_5/types/Chunk1_2_4Type.java +++ b/src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_3_1_2to1_2_4_5/types/ChunkType1_2_4.java @@ -22,9 +22,9 @@ import com.viaversion.viaversion.api.minecraft.chunks.ChunkSection; import com.viaversion.viaversion.protocols.protocol1_9_3to1_9_1_2.storage.ClientWorld; import io.netty.buffer.ByteBuf; -import net.raphimc.vialegacy.protocols.release.protocol1_8to1_7_6_10.types.Chunk1_7_6Type; +import net.raphimc.vialegacy.protocols.release.protocol1_8to1_7_6_10.types.ChunkType1_7_6; -public class Chunk1_2_4Type extends Chunk1_7_6Type { +public class ChunkType1_2_4 extends ChunkType1_7_6 { private static final ClientWorld OVERWORLD = new ClientWorld(null); @@ -32,7 +32,7 @@ public class Chunk1_2_4Type extends Chunk1_7_6Type { OVERWORLD.setEnvironment(Environment.NORMAL.id()); } - public Chunk1_2_4Type() { + public ChunkType1_2_4() { super(OVERWORLD); } diff --git a/src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_3_1_2to1_2_4_5/types/Types1_2_4.java b/src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_3_1_2to1_2_4_5/types/Types1_2_4.java index 7623d22..957fca2 100644 --- a/src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_3_1_2to1_2_4_5/types/Types1_2_4.java +++ b/src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_3_1_2to1_2_4_5/types/Types1_2_4.java @@ -30,6 +30,6 @@ public class Types1_2_4 { public static final Type ITEM_ARRAY = new ItemArrayType<>(ITEM); public static final Type COMPRESSED_NBT_ITEM_ARRAY = new ItemArrayType<>(COMPRESSED_NBT_ITEM); - public static final Type CHUNK = new Chunk1_2_4Type(); + public static final Type CHUNK = new ChunkType1_2_4(); } diff --git a/src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_4_6_7to1_4_4_5/Protocol1_4_6_7to1_4_4_5.java b/src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_4_6_7to1_4_4_5/Protocol1_4_6_7to1_4_4_5.java index 8bdd478..9d74a6d 100644 --- a/src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_4_6_7to1_4_4_5/Protocol1_4_6_7to1_4_4_5.java +++ b/src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_4_6_7to1_4_4_5/Protocol1_4_6_7to1_4_4_5.java @@ -30,13 +30,13 @@ import net.raphimc.vialegacy.api.remapper.LegacyItemRewriter; import net.raphimc.vialegacy.api.splitter.PreNettySplitter; import net.raphimc.vialegacy.protocols.release.protocol1_4_6_7to1_4_4_5.rewriter.ItemRewriter; -import net.raphimc.vialegacy.protocols.release.protocol1_4_6_7to1_4_4_5.types.ChunkBulk1_4_4Type; +import net.raphimc.vialegacy.protocols.release.protocol1_4_6_7to1_4_4_5.types.ChunkBulkType1_4_4; import net.raphimc.vialegacy.protocols.release.protocol1_5_0_1to1_4_6_7.ClientboundPackets1_4_6; import net.raphimc.vialegacy.protocols.release.protocol1_6_1to1_5_2.ServerboundPackets1_5_2; import net.raphimc.vialegacy.protocols.release.protocol1_7_2_5to1_6_4.types.MetaType1_6_4; import net.raphimc.vialegacy.protocols.release.protocol1_7_2_5to1_6_4.types.Types1_6_4; import net.raphimc.vialegacy.protocols.release.protocol1_8to1_7_6_10.metadata.MetaIndex1_8to1_7_6; -import net.raphimc.vialegacy.protocols.release.protocol1_8to1_7_6_10.types.ChunkBulk1_7_6Type; +import net.raphimc.vialegacy.protocols.release.protocol1_8to1_7_6_10.types.ChunkBulkType1_7_6; import net.raphimc.vialegacy.protocols.release.protocol1_8to1_7_6_10.types.Types1_7_6; public class Protocol1_4_6_7to1_4_4_5 extends StatelessProtocol { @@ -129,7 +129,7 @@ public void register() { public void register() { handler(wrapper -> { final ClientWorld clientWorld = wrapper.user().get(ClientWorld.class); - wrapper.write(new ChunkBulk1_7_6Type(clientWorld), wrapper.read(new ChunkBulk1_4_4Type(clientWorld))); + wrapper.write(new ChunkBulkType1_7_6(clientWorld), wrapper.read(new ChunkBulkType1_4_4(clientWorld))); }); } }); diff --git a/src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_4_6_7to1_4_4_5/types/ChunkBulk1_4_4Type.java b/src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_4_6_7to1_4_4_5/types/ChunkBulkType1_4_4.java similarity index 89% rename from src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_4_6_7to1_4_4_5/types/ChunkBulk1_4_4Type.java rename to src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_4_6_7to1_4_4_5/types/ChunkBulkType1_4_4.java index 8d8d7f1..b4f5869 100644 --- a/src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_4_6_7to1_4_4_5/types/ChunkBulk1_4_4Type.java +++ b/src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_4_6_7to1_4_4_5/types/ChunkBulkType1_4_4.java @@ -19,11 +19,11 @@ import com.viaversion.viaversion.protocols.protocol1_9_3to1_9_1_2.storage.ClientWorld; import io.netty.buffer.ByteBuf; -import net.raphimc.vialegacy.protocols.release.protocol1_8to1_7_6_10.types.ChunkBulk1_7_6Type; +import net.raphimc.vialegacy.protocols.release.protocol1_8to1_7_6_10.types.ChunkBulkType1_7_6; -public class ChunkBulk1_4_4Type extends ChunkBulk1_7_6Type { +public class ChunkBulkType1_4_4 extends ChunkBulkType1_7_6 { - public ChunkBulk1_4_4Type(ClientWorld clientWorld) { + public ChunkBulkType1_4_4(ClientWorld clientWorld) { super(clientWorld); } diff --git a/src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_7_2_5to1_6_4/Protocol1_7_2_5to1_6_4.java b/src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_7_2_5to1_6_4/Protocol1_7_2_5to1_6_4.java index cc80e7e..bd28ac3 100644 --- a/src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_7_2_5to1_6_4/Protocol1_7_2_5to1_6_4.java +++ b/src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_7_2_5to1_6_4/Protocol1_7_2_5to1_6_4.java @@ -66,8 +66,8 @@ import net.raphimc.vialegacy.protocols.release.protocol1_8to1_7_6_10.Protocol1_8to1_7_6_10; import net.raphimc.vialegacy.protocols.release.protocol1_8to1_7_6_10.model.GameProfile; import net.raphimc.vialegacy.protocols.release.protocol1_8to1_7_6_10.providers.GameProfileFetcher; -import net.raphimc.vialegacy.protocols.release.protocol1_8to1_7_6_10.types.Chunk1_7_6Type; -import net.raphimc.vialegacy.protocols.release.protocol1_8to1_7_6_10.types.ChunkBulk1_7_6Type; +import net.raphimc.vialegacy.protocols.release.protocol1_8to1_7_6_10.types.ChunkType1_7_6; +import net.raphimc.vialegacy.protocols.release.protocol1_8to1_7_6_10.types.ChunkBulkType1_7_6; import net.raphimc.vialegacy.protocols.release.protocol1_8to1_7_6_10.types.MetaType1_7_6; import net.raphimc.vialegacy.protocols.release.protocol1_8to1_7_6_10.types.Types1_7_6; @@ -421,7 +421,7 @@ public void register() { @Override public void register() { handler(wrapper -> { - final Chunk chunk = wrapper.passthrough(new Chunk1_7_6Type(wrapper.user().get(ClientWorld.class))); + final Chunk chunk = wrapper.passthrough(new ChunkType1_7_6(wrapper.user().get(ClientWorld.class))); wrapper.user().get(ChunkTracker.class).trackAndRemap(chunk); }); } @@ -486,7 +486,7 @@ public void register() { @Override public void register() { handler(wrapper -> { - final Chunk[] chunks = wrapper.passthrough(new ChunkBulk1_7_6Type(wrapper.user().get(ClientWorld.class))); + final Chunk[] chunks = wrapper.passthrough(new ChunkBulkType1_7_6(wrapper.user().get(ClientWorld.class))); for (Chunk chunk : chunks) { wrapper.user().get(ChunkTracker.class).trackAndRemap(chunk); } diff --git a/src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_8to1_7_6_10/Protocol1_8to1_7_6_10.java b/src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_8to1_7_6_10/Protocol1_8to1_7_6_10.java index 4996fe7..5bb5b65 100644 --- a/src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_8to1_7_6_10/Protocol1_8to1_7_6_10.java +++ b/src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_8to1_7_6_10/Protocol1_8to1_7_6_10.java @@ -63,8 +63,8 @@ import net.raphimc.vialegacy.protocols.release.protocol1_8to1_7_6_10.rewriter.ItemRewriter; import net.raphimc.vialegacy.protocols.release.protocol1_8to1_7_6_10.rewriter.TranslationRewriter; import net.raphimc.vialegacy.protocols.release.protocol1_8to1_7_6_10.storage.*; -import net.raphimc.vialegacy.protocols.release.protocol1_8to1_7_6_10.types.Chunk1_7_6Type; -import net.raphimc.vialegacy.protocols.release.protocol1_8to1_7_6_10.types.ChunkBulk1_7_6Type; +import net.raphimc.vialegacy.protocols.release.protocol1_8to1_7_6_10.types.ChunkType1_7_6; +import net.raphimc.vialegacy.protocols.release.protocol1_8to1_7_6_10.types.ChunkBulkType1_7_6; import net.raphimc.vialegacy.protocols.release.protocol1_8to1_7_6_10.types.Types1_7_6; import java.nio.charset.StandardCharsets; @@ -633,7 +633,7 @@ public void register() { @Override public void register() { handler(wrapper -> { - final Chunk chunk = wrapper.read(new Chunk1_7_6Type(wrapper.user().get(ClientWorld.class))); + final Chunk chunk = wrapper.read(new ChunkType1_7_6(wrapper.user().get(ClientWorld.class))); wrapper.user().get(ChunkTracker.class).trackAndRemap(chunk); wrapper.write(new Chunk1_8Type(wrapper.user().get(ClientWorld.class)), chunk); }); @@ -696,7 +696,7 @@ public void register() { @Override public void register() { handler(wrapper -> { - final Chunk[] chunks = wrapper.read(new ChunkBulk1_7_6Type(wrapper.user().get(ClientWorld.class))); + final Chunk[] chunks = wrapper.read(new ChunkBulkType1_7_6(wrapper.user().get(ClientWorld.class))); for (Chunk chunk : chunks) { wrapper.user().get(ChunkTracker.class).trackAndRemap(chunk); } diff --git a/src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_8to1_7_6_10/rewriter/ChatItemRewriter.java b/src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_8to1_7_6_10/rewriter/ChatItemRewriter.java index 13bc3a6..88ee0bc 100644 --- a/src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_8to1_7_6_10/rewriter/ChatItemRewriter.java +++ b/src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_8to1_7_6_10/rewriter/ChatItemRewriter.java @@ -31,6 +31,7 @@ import net.lenni0451.mcstructs.snbt.SNbtSerializer; import net.lenni0451.mcstructs.snbt.exceptions.SNbtSerializeException; import net.raphimc.vialegacy.ViaLegacy; +import net.raphimc.vialegacy.protocols.release.protocol1_7_6_10to1_7_2_5.ClientboundPackets1_7_2; import net.raphimc.vialegacy.protocols.release.protocol1_8to1_7_6_10.Protocol1_8to1_7_6_10; import net.raphimc.vialegacy.util.NbtConverter; @@ -358,10 +359,10 @@ public class ChatItemRewriter { ID_TO_NAME.put(2267, "record_wait"); } - private final ComponentRewriter SHOW_ITEM; + private final ComponentRewriter SHOW_ITEM; public ChatItemRewriter(final Protocol1_8to1_7_6_10 protocol) { - this.SHOW_ITEM = new ComponentRewriter(protocol) { + this.SHOW_ITEM = new ComponentRewriter(protocol) { @Override protected void handleHoverEvent(JsonObject hoverEvent) { super.handleHoverEvent(hoverEvent); diff --git a/src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_8to1_7_6_10/types/ChunkBulk1_7_6Type.java b/src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_8to1_7_6_10/types/ChunkBulkType1_7_6.java similarity index 93% rename from src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_8to1_7_6_10/types/ChunkBulk1_7_6Type.java rename to src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_8to1_7_6_10/types/ChunkBulkType1_7_6.java index ad73bf0..94c7e4b 100644 --- a/src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_8to1_7_6_10/types/ChunkBulk1_7_6Type.java +++ b/src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_8to1_7_6_10/types/ChunkBulkType1_7_6.java @@ -32,9 +32,9 @@ import java.util.zip.Deflater; import java.util.zip.Inflater; -public class ChunkBulk1_7_6Type extends PartialType { +public class ChunkBulkType1_7_6 extends PartialType { - public ChunkBulk1_7_6Type(final ClientWorld clientWorld) { + public ChunkBulkType1_7_6(final ClientWorld clientWorld) { super(clientWorld, Chunk[].class); } @@ -82,7 +82,7 @@ public Chunk[] read(ByteBuf byteBuf, ClientWorld clientWorld) throws Exception { additionalBitMask[i] = byteBuf.readShort(); } - final byte[] uncompressedData = new byte[Chunk1_7_6Type.getSize((short) 0xFFFF, (short) 0xFFFF, true, hasSkyLight) * chunkCount]; + final byte[] uncompressedData = new byte[ChunkType1_7_6.getSize((short) 0xFFFF, (short) 0xFFFF, true, hasSkyLight) * chunkCount]; final Inflater inflater = new Inflater(); try { inflater.setInput(data, 0, compressedSize); @@ -96,9 +96,9 @@ public Chunk[] read(ByteBuf byteBuf, ClientWorld clientWorld) throws Exception { final Chunk[] chunks = new Chunk[chunkCount]; int dataPosition = 0; for (int i = 0; i < chunkCount; i++) { - final byte[] chunkData = new byte[Chunk1_7_6Type.getSize(primaryBitMask[i], additionalBitMask[i], true, hasSkyLight)]; + final byte[] chunkData = new byte[ChunkType1_7_6.getSize(primaryBitMask[i], additionalBitMask[i], true, hasSkyLight)]; System.arraycopy(uncompressedData, dataPosition, chunkData, 0, chunkData.length); - chunks[i] = Chunk1_7_6Type.deserialize(chunkX[i], chunkZ[i], true, hasSkyLight, primaryBitMask[i], additionalBitMask[i], chunkData); + chunks[i] = ChunkType1_7_6.deserialize(chunkX[i], chunkZ[i], true, hasSkyLight, primaryBitMask[i], additionalBitMask[i], chunkData); dataPosition += chunkData.length; } @@ -116,7 +116,7 @@ public void write(ByteBuf byteBuf, ClientWorld clientWorld, Chunk[] chunks) thro for (int i = 0; i < chunkCount; i++) { final Chunk chunk = chunks[i]; - final Pair chunkData = Chunk1_7_6Type.serialize(chunk); + final Pair chunkData = ChunkType1_7_6.serialize(chunk); output.write(chunkData.key()); chunkX[i] = chunk.getX(); chunkZ[i] = chunk.getZ(); diff --git a/src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_8to1_7_6_10/types/Chunk1_7_6Type.java b/src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_8to1_7_6_10/types/ChunkType1_7_6.java similarity index 99% rename from src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_8to1_7_6_10/types/Chunk1_7_6Type.java rename to src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_8to1_7_6_10/types/ChunkType1_7_6.java index 5c92625..be512ce 100644 --- a/src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_8to1_7_6_10/types/Chunk1_7_6Type.java +++ b/src/main/java/net/raphimc/vialegacy/protocols/release/protocol1_8to1_7_6_10/types/ChunkType1_7_6.java @@ -36,9 +36,9 @@ import java.util.zip.Deflater; import java.util.zip.Inflater; -public class Chunk1_7_6Type extends PartialType { +public class ChunkType1_7_6 extends PartialType { - public Chunk1_7_6Type(final ClientWorld clientWorld) { + public ChunkType1_7_6(final ClientWorld clientWorld) { super(clientWorld, Chunk.class); }