From cd9ff95226436fd19fcee4d1b5e68530f20ae0f5 Mon Sep 17 00:00:00 2001 From: creeper123123321 Date: Wed, 18 Jul 2018 14:10:43 -0300 Subject: [PATCH] 1.13!!!!! --- bukkit/pom.xml | 2 +- bungee/pom.xml | 2 +- common/pom.xml | 2 +- .../metadata/types/MetaType1_13.java | 4 +- .../api/protocol/ProtocolRegistry.java | 4 +- .../api/protocol/ProtocolVersion.java | 2 +- .../MetadataRewriter.java | 10 +- .../Protocol1_13To1_12_2.java} | 1544 ++++++++--------- .../chunks/Chunk1_13.java | 2 +- .../chunks/ChunkSection1_13.java | 2 +- .../data/EntityTypeRewriter.java | 2 +- .../data/MappingData.java | 2 +- .../data/Particle.java | 2 +- .../data/ParticleRewriter.java | 6 +- .../data/SoundSource.java | 2 +- .../data/SpawnEggRewriter.java | 2 +- .../packets/EntityPackets.java | 8 +- .../packets/InventoryPackets.java | 14 +- .../packets/WorldPackets.java | 16 +- .../providers/BlockEntityProvider.java | 14 +- .../providers/PaintingProvider.java | 2 +- .../blockentities/BannerHandler.java | 6 +- .../providers/blockentities/BedHandler.java | 6 +- .../blockentities/FlowerPotHandler.java | 4 +- .../providers/blockentities/SkullHandler.java | 6 +- .../storage/BlockStorage.java | 2 +- .../storage/EntityTracker.java | 2 +- .../storage/TabCompleteTracker.java | 2 +- .../types/Chunk1_13Type.java | 6 +- .../types/Particle1_13Type.java | 4 +- jar/pom.xml | 2 +- pom.xml | 2 +- sponge-legacy/pom.xml | 2 +- sponge/pom.xml | 2 +- 34 files changed, 845 insertions(+), 845 deletions(-) rename common/src/main/java/us/myles/ViaVersion/protocols/{protocolsnapshotto1_12_2 => protocol1_13to1_12_2}/MetadataRewriter.java (91%) rename common/src/main/java/us/myles/ViaVersion/protocols/{protocolsnapshotto1_12_2/ProtocolSnapshotTo1_12_2.java => protocol1_13to1_12_2/Protocol1_13To1_12_2.java} (94%) rename common/src/main/java/us/myles/ViaVersion/protocols/{protocolsnapshotto1_12_2 => protocol1_13to1_12_2}/chunks/Chunk1_13.java (88%) rename common/src/main/java/us/myles/ViaVersion/protocols/{protocolsnapshotto1_12_2 => protocol1_13to1_12_2}/chunks/ChunkSection1_13.java (99%) rename common/src/main/java/us/myles/ViaVersion/protocols/{protocolsnapshotto1_12_2 => protocol1_13to1_12_2}/data/EntityTypeRewriter.java (98%) rename common/src/main/java/us/myles/ViaVersion/protocols/{protocolsnapshotto1_12_2 => protocol1_13to1_12_2}/data/MappingData.java (98%) rename common/src/main/java/us/myles/ViaVersion/protocols/{protocolsnapshotto1_12_2 => protocol1_13to1_12_2}/data/Particle.java (87%) rename common/src/main/java/us/myles/ViaVersion/protocols/{protocolsnapshotto1_12_2 => protocol1_13to1_12_2}/data/ParticleRewriter.java (97%) rename common/src/main/java/us/myles/ViaVersion/protocols/{protocolsnapshotto1_12_2 => protocol1_13to1_12_2}/data/SoundSource.java (91%) rename common/src/main/java/us/myles/ViaVersion/protocols/{protocolsnapshotto1_12_2 => protocol1_13to1_12_2}/data/SpawnEggRewriter.java (97%) rename common/src/main/java/us/myles/ViaVersion/protocols/{protocolsnapshotto1_12_2 => protocol1_13to1_12_2}/packets/EntityPackets.java (95%) rename common/src/main/java/us/myles/ViaVersion/protocols/{protocolsnapshotto1_12_2 => protocol1_13to1_12_2}/packets/InventoryPackets.java (97%) rename common/src/main/java/us/myles/ViaVersion/protocols/{protocolsnapshotto1_12_2 => protocol1_13to1_12_2}/packets/WorldPackets.java (94%) rename common/src/main/java/us/myles/ViaVersion/protocols/{protocolsnapshotto1_12_2 => protocol1_13to1_12_2}/providers/BlockEntityProvider.java (77%) rename common/src/main/java/us/myles/ViaVersion/protocols/{protocolsnapshotto1_12_2 => protocol1_13to1_12_2}/providers/PaintingProvider.java (94%) rename common/src/main/java/us/myles/ViaVersion/protocols/{protocolsnapshotto1_12_2 => protocol1_13to1_12_2}/providers/blockentities/BannerHandler.java (85%) rename common/src/main/java/us/myles/ViaVersion/protocols/{protocolsnapshotto1_12_2 => protocol1_13to1_12_2}/providers/blockentities/BedHandler.java (80%) rename common/src/main/java/us/myles/ViaVersion/protocols/{protocolsnapshotto1_12_2 => protocol1_13to1_12_2}/providers/blockentities/FlowerPotHandler.java (94%) rename common/src/main/java/us/myles/ViaVersion/protocols/{protocolsnapshotto1_12_2 => protocol1_13to1_12_2}/providers/blockentities/SkullHandler.java (83%) rename common/src/main/java/us/myles/ViaVersion/protocols/{protocolsnapshotto1_12_2 => protocol1_13to1_12_2}/storage/BlockStorage.java (96%) rename common/src/main/java/us/myles/ViaVersion/protocols/{protocolsnapshotto1_12_2 => protocol1_13to1_12_2}/storage/EntityTracker.java (93%) rename common/src/main/java/us/myles/ViaVersion/protocols/{protocolsnapshotto1_12_2 => protocol1_13to1_12_2}/storage/TabCompleteTracker.java (89%) rename common/src/main/java/us/myles/ViaVersion/protocols/{protocolsnapshotto1_12_2 => protocol1_13to1_12_2}/types/Chunk1_13Type.java (94%) rename common/src/main/java/us/myles/ViaVersion/protocols/{protocolsnapshotto1_12_2 => protocol1_13to1_12_2}/types/Particle1_13Type.java (92%) diff --git a/bukkit/pom.xml b/bukkit/pom.xml index b77f6ea56..b8e8adc57 100644 --- a/bukkit/pom.xml +++ b/bukkit/pom.xml @@ -5,7 +5,7 @@ viaversion-parent us.myles - 1.4.0-1.13-pre10 + 1.4.0-DEV 4.0.0 diff --git a/bungee/pom.xml b/bungee/pom.xml index 15aa94fef..e6a872955 100644 --- a/bungee/pom.xml +++ b/bungee/pom.xml @@ -5,7 +5,7 @@ viaversion-parent us.myles - 1.4.0-1.13-pre10 + 1.4.0-DEV 4.0.0 diff --git a/common/pom.xml b/common/pom.xml index 8eb581109..d4798d2a5 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -5,7 +5,7 @@ viaversion-parent us.myles - 1.4.0-1.13-pre10 + 1.4.0-DEV 4.0.0 diff --git a/common/src/main/java/us/myles/ViaVersion/api/minecraft/metadata/types/MetaType1_13.java b/common/src/main/java/us/myles/ViaVersion/api/minecraft/metadata/types/MetaType1_13.java index 6638deeea..7295201fe 100644 --- a/common/src/main/java/us/myles/ViaVersion/api/minecraft/metadata/types/MetaType1_13.java +++ b/common/src/main/java/us/myles/ViaVersion/api/minecraft/metadata/types/MetaType1_13.java @@ -4,7 +4,7 @@ import lombok.Getter; import lombok.RequiredArgsConstructor; import us.myles.ViaVersion.api.minecraft.metadata.MetaType; import us.myles.ViaVersion.api.type.Type; -import us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.ProtocolSnapshotTo1_12_2; +import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.Protocol1_13To1_12_2; @RequiredArgsConstructor @Getter @@ -24,7 +24,7 @@ public enum MetaType1_13 implements MetaType { OptUUID(12, Type.OPTIONAL_UUID), BlockID(13, Type.VAR_INT), NBTTag(14, Type.NBT), - PARTICLE(15, ProtocolSnapshotTo1_12_2.PARTICLE_TYPE), + PARTICLE(15, Protocol1_13To1_12_2.PARTICLE_TYPE), Discontinued(99, null); private final int typeID; diff --git a/common/src/main/java/us/myles/ViaVersion/api/protocol/ProtocolRegistry.java b/common/src/main/java/us/myles/ViaVersion/api/protocol/ProtocolRegistry.java index c566a4fca..8013ded62 100644 --- a/common/src/main/java/us/myles/ViaVersion/api/protocol/ProtocolRegistry.java +++ b/common/src/main/java/us/myles/ViaVersion/api/protocol/ProtocolRegistry.java @@ -18,7 +18,7 @@ import us.myles.ViaVersion.protocols.protocol1_9_1to1_9.Protocol1_9_1TO1_9; import us.myles.ViaVersion.protocols.protocol1_9_3to1_9_1_2.Protocol1_9_3TO1_9_1_2; import us.myles.ViaVersion.protocols.protocol1_9to1_8.Protocol1_9TO1_8; import us.myles.ViaVersion.protocols.protocol1_9to1_9_1.Protocol1_9TO1_9_1; -import us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.ProtocolSnapshotTo1_12_2; +import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.Protocol1_13To1_12_2; import java.util.*; import java.util.concurrent.ConcurrentHashMap; @@ -55,7 +55,7 @@ public class ProtocolRegistry { registerProtocol(new Protocol1_12_2TO1_12_1(), Collections.singletonList(ProtocolVersion.v1_12_2.getId()), ProtocolVersion.v1_12_1.getId()); // 1.13 support in development! (: - registerProtocol(new ProtocolSnapshotTo1_12_2(), Collections.singletonList(ProtocolVersion.v1_13.getId()), ProtocolVersion.v1_12_2.getId()); + registerProtocol(new Protocol1_13To1_12_2(), Collections.singletonList(ProtocolVersion.v1_13.getId()), ProtocolVersion.v1_12_2.getId()); } /** diff --git a/common/src/main/java/us/myles/ViaVersion/api/protocol/ProtocolVersion.java b/common/src/main/java/us/myles/ViaVersion/api/protocol/ProtocolVersion.java index 855eff31c..9c10b95ab 100644 --- a/common/src/main/java/us/myles/ViaVersion/api/protocol/ProtocolVersion.java +++ b/common/src/main/java/us/myles/ViaVersion/api/protocol/ProtocolVersion.java @@ -62,7 +62,7 @@ public class ProtocolVersion { register(v1_12 = new ProtocolVersion(335, "1.12")); register(v1_12_1 = new ProtocolVersion(338, "1.12.1")); register(v1_12_2 = new ProtocolVersion(340, "1.12.2")); - register(v1_13 = new ProtocolVersion(392, "1.13-pre10")); + register(v1_13 = new ProtocolVersion(393, "1.13")); register(unknown = new ProtocolVersion(-1, "UNKNOWN")); } diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/MetadataRewriter.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/MetadataRewriter.java similarity index 91% rename from common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/MetadataRewriter.java rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/MetadataRewriter.java index 88064b33d..595f865fb 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/MetadataRewriter.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/MetadataRewriter.java @@ -1,4 +1,4 @@ -package us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2; +package us.myles.ViaVersion.protocols.protocol1_13to1_12_2; import us.myles.ViaVersion.api.Via; import us.myles.ViaVersion.api.data.UserConnection; @@ -7,10 +7,10 @@ import us.myles.ViaVersion.api.minecraft.item.Item; import us.myles.ViaVersion.api.minecraft.metadata.Metadata; import us.myles.ViaVersion.api.minecraft.metadata.types.MetaType1_13; import us.myles.ViaVersion.protocols.protocol1_9to1_8.Protocol1_9TO1_8; -import us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.data.Particle; -import us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.data.ParticleRewriter; -import us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.packets.InventoryPackets; -import us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.packets.WorldPackets; +import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.data.Particle; +import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.data.ParticleRewriter; +import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.packets.InventoryPackets; +import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.packets.WorldPackets; import java.util.ArrayList; import java.util.List; diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/ProtocolSnapshotTo1_12_2.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/Protocol1_13To1_12_2.java similarity index 94% rename from common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/ProtocolSnapshotTo1_12_2.java rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/Protocol1_13To1_12_2.java index a5934fc5a..25baaaba7 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/ProtocolSnapshotTo1_12_2.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/Protocol1_13To1_12_2.java @@ -1,772 +1,772 @@ -package us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2; - -import net.md_5.bungee.api.chat.TextComponent; -import net.md_5.bungee.chat.ComponentSerializer; -import us.myles.ViaVersion.api.PacketWrapper; -import us.myles.ViaVersion.api.data.UserConnection; -import us.myles.ViaVersion.api.entities.Entity1_13Types; -import us.myles.ViaVersion.api.minecraft.Position; -import us.myles.ViaVersion.api.minecraft.item.Item; -import us.myles.ViaVersion.api.platform.providers.ViaProviders; -import us.myles.ViaVersion.api.protocol.Protocol; -import us.myles.ViaVersion.api.remapper.PacketHandler; -import us.myles.ViaVersion.api.remapper.PacketRemapper; -import us.myles.ViaVersion.api.remapper.ValueCreator; -import us.myles.ViaVersion.api.remapper.ValueTransformer; -import us.myles.ViaVersion.api.type.Type; -import us.myles.ViaVersion.packets.State; -import us.myles.ViaVersion.protocols.protocol1_9_3to1_9_1_2.storage.ClientWorld; -import us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.data.MappingData; -import us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.packets.EntityPackets; -import us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.packets.InventoryPackets; -import us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.packets.WorldPackets; -import us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.providers.BlockEntityProvider; -import us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.providers.PaintingProvider; -import us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.storage.BlockStorage; -import us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.storage.EntityTracker; -import us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.storage.TabCompleteTracker; -import us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.types.Particle1_13Type; - -import java.util.Map; - -// Development of 1.13 support! -public class ProtocolSnapshotTo1_12_2 extends Protocol { - public static final Particle1_13Type PARTICLE_TYPE = new Particle1_13Type(); - - public static String legacyTextToJson(String legacyText) { - return ComponentSerializer.toString( - TextComponent.fromLegacyText(legacyText) - ); - } - - public static final PacketHandler POS_TO_3_INT = new PacketHandler() { - @Override - public void handle(PacketWrapper wrapper) throws Exception { - Position position = wrapper.read(Type.POSITION); - wrapper.write(Type.INT, position.getX().intValue()); - wrapper.write(Type.INT, position.getY().intValue()); - wrapper.write(Type.INT, position.getZ().intValue()); - } - }; - - public static final PacketHandler SEND_DECLARE_COMMANDS_AND_TAGS = new PacketHandler() { // *insert here a good name* - @Override - public void handle(PacketWrapper w) throws Exception { - // Send fake declare commands - w.create(0x11, new ValueCreator() { - @Override - public void write(PacketWrapper wrapper) { - wrapper.write(Type.VAR_INT, 2); // Size - // Write root node - wrapper.write(Type.VAR_INT, 0); // Mark as command - wrapper.write(Type.VAR_INT, 1); // 1 child - wrapper.write(Type.VAR_INT, 1); // Child is at 1 - - // Write arg node - wrapper.write(Type.VAR_INT, 0x02 | 0x04 | 0x10); // Mark as command - wrapper.write(Type.VAR_INT, 0); // No children - // Extra data - wrapper.write(Type.STRING, "args"); // Arg name - wrapper.write(Type.STRING, "brigadier:string"); - wrapper.write(Type.VAR_INT, 2); // Greedy - wrapper.write(Type.STRING, "minecraft:ask_server"); // Ask server - - wrapper.write(Type.VAR_INT, 0); // Root node index - } - }).send(ProtocolSnapshotTo1_12_2.class); - - // Send tags packet - w.create(0x55, new ValueCreator() { - @Override - public void write(PacketWrapper wrapper) throws Exception { - wrapper.write(Type.VAR_INT, MappingData.blockTags.size()); // block tags - for (Map.Entry tag : MappingData.blockTags.entrySet()) { - wrapper.write(Type.STRING, tag.getKey()); - wrapper.write(Type.VAR_INT_ARRAY, tag.getValue().clone()); - } - wrapper.write(Type.VAR_INT, MappingData.itemTags.size()); // item tags - for (Map.Entry tag : MappingData.itemTags.entrySet()) { - wrapper.write(Type.STRING, tag.getKey()); - wrapper.write(Type.VAR_INT_ARRAY, tag.getValue().clone()); - } - wrapper.write(Type.VAR_INT, MappingData.fluidTags.size()); // fluid tags - for (Map.Entry tag : MappingData.fluidTags.entrySet()) { - wrapper.write(Type.STRING, tag.getKey()); - wrapper.write(Type.VAR_INT_ARRAY, tag.getValue().clone()); - } - } - }).send(ProtocolSnapshotTo1_12_2.class); - } - }; - - static { - MappingData.init(); - } - - public static String jsonTextToLegacy(String value) { - return TextComponent.toLegacyText(ComponentSerializer.parse(value)); - } - - @Override - protected void registerPackets() { - // Register grouped packet changes - EntityPackets.register(this); - WorldPackets.register(this); - InventoryPackets.register(this); - - // Outgoing packets - - // New packet 0x04 - Login Plugin Message - - // Statistics - registerOutgoing(State.PLAY, 0x07, 0x07, new PacketRemapper() { - @Override - public void registerMap() { - // TODO: This packet has changed - - handler(new PacketHandler() { - @Override - public void handle(PacketWrapper wrapper) throws Exception { - wrapper.cancel(); - } - }); - } - }); - - registerOutgoing(State.PLAY, 0xF, 0xE); - // WorldPackets 0x10 -> 0x0F - - // Tab-Complete - registerOutgoing(State.PLAY, 0xE, 0x10, new PacketRemapper() { - @Override - public void registerMap() { - create(new ValueCreator() { - @Override - public void write(PacketWrapper wrapper) throws Exception { - wrapper.write(Type.VAR_INT, wrapper.user().get(TabCompleteTracker.class).getTransactionId()); - - String input = wrapper.user().get(TabCompleteTracker.class).getInput(); - // Start & End - int index; - int length; - // If no input or new word (then it's the start) - if (input.endsWith(" ") || input.length() == 0) { - index = input.length(); - length = 0; - } else { - // Otherwise find the last space (+1 as we include it) - int lastSpace = input.lastIndexOf(" ") + 1; - index = lastSpace; - length = input.length() - lastSpace; - } - // Write index + length - wrapper.write(Type.VAR_INT, index); - wrapper.write(Type.VAR_INT, length); - - int count = wrapper.passthrough(Type.VAR_INT); - for (int i = 0; i < count; i++) { - String suggestion = wrapper.read(Type.STRING); - // If we're at the start then handle removing slash - if (suggestion.startsWith("/") && index == 0) { - suggestion = suggestion.substring(1); - } - wrapper.write(Type.STRING, suggestion); - wrapper.write(Type.BOOLEAN, false); - } - } - }); - } - }); - - // New packet 0x11, declare commands - registerOutgoing(State.PLAY, 0x11, 0x12); - registerOutgoing(State.PLAY, 0x12, 0x13); - registerOutgoing(State.PLAY, 0x13, 0x14); - // InventoryPackets 0x14 -> 0x15 - registerOutgoing(State.PLAY, 0x15, 0x16); - // InventoryPackets 0x16 -> 0x17 - registerOutgoing(State.PLAY, 0x17, 0x18); - // InventoryPackets 0x18 -> 0x19 - registerOutgoing(State.PLAY, 0x1A, 0x1B); - registerOutgoing(State.PLAY, 0x1B, 0x1C); - // New packet 0x1D - NBT Query - registerOutgoing(State.PLAY, 0x1C, 0x1E); - registerOutgoing(State.PLAY, 0x1D, 0x1F); - registerOutgoing(State.PLAY, 0x1E, 0x20); - registerOutgoing(State.PLAY, 0x1F, 0x21); - // WorldPackets 0x20 -> 0x22 - registerOutgoing(State.PLAY, 0x21, 0x23); - // WorldPackets 0x22 -> 0x24 - // Join (save dimension id) - registerOutgoing(State.PLAY, 0x23, 0x25, new PacketRemapper() { - @Override - public void registerMap() { - map(Type.INT); // 0 - Entity ID - map(Type.UNSIGNED_BYTE); // 1 - Gamemode - map(Type.INT); // 2 - Dimension - - handler(new PacketHandler() { - @Override - public void handle(PacketWrapper wrapper) throws Exception { - // Store the player - int entityId = wrapper.get(Type.INT, 0); - wrapper.user().get(EntityTracker.class).addEntity(entityId, Entity1_13Types.EntityType.PLAYER); - - ClientWorld clientChunks = wrapper.user().get(ClientWorld.class); - int dimensionId = wrapper.get(Type.INT, 1); - clientChunks.setEnvironment(dimensionId); - } - }); - handler(SEND_DECLARE_COMMANDS_AND_TAGS); - } - }); - - // Map packet - registerOutgoing(State.PLAY, 0x24, 0x26, new PacketRemapper() { - @Override - public void registerMap() { - map(Type.VAR_INT); // 0 - Map id - map(Type.BYTE); // 1 - Scale - map(Type.BOOLEAN); // 2 - Tracking Position - handler(new PacketHandler() { - @Override - public void handle(PacketWrapper wrapper) throws Exception { - int iconCount = wrapper.passthrough(Type.VAR_INT); - for (int i = 0; i < iconCount; i++) { - byte directionAndType = wrapper.read(Type.BYTE); - int type = (directionAndType & 0xF0) >> 4; - wrapper.write(Type.VAR_INT, type); - wrapper.passthrough(Type.BYTE); // Icon X - wrapper.passthrough(Type.BYTE); // Icon Z - byte direction = (byte) (directionAndType & 0x0F); - wrapper.write(Type.BYTE, direction); - wrapper.write(Type.OPTIONAL_CHAT, null); // Display Name - } - } - }); - } - }); - registerOutgoing(State.PLAY, 0x25, 0x27); - registerOutgoing(State.PLAY, 0x26, 0x28); - registerOutgoing(State.PLAY, 0x27, 0x29); - registerOutgoing(State.PLAY, 0x28, 0x2A); - registerOutgoing(State.PLAY, 0x29, 0x2B); - registerOutgoing(State.PLAY, 0x2A, 0x2C); - // Craft recipe response - registerOutgoing(State.PLAY, 0x2B, 0x2D, new PacketRemapper() { - @Override - public void registerMap() { - handler(new PacketHandler() { - @Override - public void handle(PacketWrapper wrapper) throws Exception { - // TODO This packet changed - wrapper.cancel(); - } - }); - } - }); - registerOutgoing(State.PLAY, 0x2C, 0x2E); - registerOutgoing(State.PLAY, 0x2D, 0x2F); - registerOutgoing(State.PLAY, 0x2E, 0x30); - // New 0x31 - Face Player - registerOutgoing(State.PLAY, 0x2F, 0x32); - registerOutgoing(State.PLAY, 0x30, 0x33); - // Recipe - registerOutgoing(State.PLAY, 0x31, 0x34, new PacketRemapper() { - @Override - public void registerMap() { - handler(new PacketHandler() { - @Override - public void handle(PacketWrapper wrapper) throws Exception { - // TODO: This has changed >.> - wrapper.cancel(); - } - }); - } - }); - - // EntityPackets 0x32 -> 0x35 - registerOutgoing(State.PLAY, 0x33, 0x36); - registerOutgoing(State.PLAY, 0x34, 0x37); - - // Respawn (save dimension id) - registerOutgoing(State.PLAY, 0x35, 0x38, new PacketRemapper() { - @Override - public void registerMap() { - map(Type.INT); // 0 - Dimension ID - handler(new PacketHandler() { - @Override - public void handle(PacketWrapper wrapper) throws Exception { - ClientWorld clientWorld = wrapper.user().get(ClientWorld.class); - int dimensionId = wrapper.get(Type.INT, 0); - clientWorld.setEnvironment(dimensionId); - } - }); - handler(SEND_DECLARE_COMMANDS_AND_TAGS); - } - }); - - registerOutgoing(State.PLAY, 0x36, 0x39); - registerOutgoing(State.PLAY, 0x37, 0x3A); - registerOutgoing(State.PLAY, 0x38, 0x3B); - registerOutgoing(State.PLAY, 0x39, 0x3C); - registerOutgoing(State.PLAY, 0x3A, 0x3D); - registerOutgoing(State.PLAY, 0x3B, 0x3E); - // EntityPackets 0x3C -> 0x3F - registerOutgoing(State.PLAY, 0x3D, 0x40); - registerOutgoing(State.PLAY, 0x3E, 0x41); - // InventoryPackets 0x3F -> 0x42 - registerOutgoing(State.PLAY, 0x40, 0x43); - registerOutgoing(State.PLAY, 0x41, 0x44); - // Scoreboard Objective - registerOutgoing(State.PLAY, 0x42, 0x45, new PacketRemapper() { - @Override - public void registerMap() { - map(Type.STRING); // 0 - Objective name - map(Type.BYTE); // 1 - Mode - handler(new PacketHandler() { - @Override - public void handle(PacketWrapper wrapper) throws Exception { - byte mode = wrapper.get(Type.BYTE, 0); - // On create or update - if (mode == 0 || mode == 2) { - String value = wrapper.read(Type.STRING); // Value - value = legacyTextToJson(value); - wrapper.write(Type.STRING, value); - - String type = wrapper.read(Type.STRING); - // integer or hearts - wrapper.write(Type.VAR_INT, type.equals("integer") ? 0 : 1); - } - } - }); - } - }); - - registerOutgoing(State.PLAY, 0x43, 0x46); - // Team packet - registerOutgoing(State.PLAY, 0x44, 0x47, new PacketRemapper() { - @Override - public void registerMap() { - map(Type.STRING); // 0 - Team Name - map(Type.BYTE); // 1 - Mode - - handler(new PacketHandler() { - @Override - public void handle(PacketWrapper wrapper) throws Exception { - byte action = wrapper.get(Type.BYTE, 0); - - if (action == 0 || action == 2) { - String displayName = wrapper.read(Type.STRING); // Display Name - displayName = legacyTextToJson(displayName); - wrapper.write(Type.STRING, displayName); - - String prefix = wrapper.read(Type.STRING); // Prefix moved - String suffix = wrapper.read(Type.STRING); // Suffix moved - - wrapper.passthrough(Type.BYTE); // Flags - - wrapper.passthrough(Type.STRING); // Name Tag Visibility - wrapper.passthrough(Type.STRING); // Collision rule - - // Handle new colors - byte color = wrapper.read(Type.BYTE); - - if (color == -1) // -1 changed to 21 - wrapper.write(Type.VAR_INT, 21); // RESET - else - wrapper.write(Type.VAR_INT, (int) color); - - wrapper.write(Type.STRING, legacyTextToJson(prefix)); // Prefix - wrapper.write(Type.STRING, legacyTextToJson(suffix)); // Suffix - } - } - }); - - } - }); - registerOutgoing(State.PLAY, 0x45, 0x48); - registerOutgoing(State.PLAY, 0x46, 0x49); - registerOutgoing(State.PLAY, 0x47, 0x4A); - registerOutgoing(State.PLAY, 0x48, 0x4B); - // New 0x4C - Stop Sound - - // Sound Effect packet - registerOutgoing(State.PLAY, 0x49, 0x4D, new PacketRemapper() { - @Override - public void registerMap() { - map(Type.VAR_INT); // 0 - Sound ID - - handler(new PacketHandler() { - @Override - public void handle(PacketWrapper wrapper) throws Exception { - int soundId = wrapper.get(Type.VAR_INT, 0); - wrapper.set(Type.VAR_INT, 0, getNewSoundID(soundId)); - } - }); - } - }); - registerOutgoing(State.PLAY, 0x4A, 0x4E); - registerOutgoing(State.PLAY, 0x4B, 0x4F); - registerOutgoing(State.PLAY, 0x4C, 0x50); - // Advancements - registerOutgoing(State.PLAY, 0x4D, 0x51, new PacketRemapper() { - @Override - public void registerMap() { - handler(new PacketHandler() { - @Override - public void handle(PacketWrapper wrapper) throws Exception { - // TODO Temporary cancel advancements because of 'Non [a-z0-9/._-] character in path of location: minecraft:? https://fs.matsv.nl/media?id=auwje4z4lxw.png - wrapper.cancel(); - } - }); - } - }); - registerOutgoing(State.PLAY, 0x4E, 0x52); - registerOutgoing(State.PLAY, 0x4F, 0x53); - // New packet 0x54 - Declare Recipes - // New packet 0x55 - Tags - - // Incoming packets - - // New packet 0x02 - Login Plugin Message - registerIncoming(State.LOGIN, -1, 0x02, new PacketRemapper() { - @Override - public void registerMap() { - handler(new PacketHandler() { - @Override - public void handle(PacketWrapper wrapper) throws Exception { - wrapper.cancel(); - } - }); - } - }); - - // New 0x01 - Query Block NBT - registerIncoming(State.PLAY, -1, 0x01, new PacketRemapper() { - @Override - public void registerMap() { - handler(new PacketHandler() { - @Override - public void handle(PacketWrapper wrapper) throws Exception { - wrapper.cancel(); - } - }); - } - }); - - // Tab-Complete - registerIncoming(State.PLAY, 0x1, 0x5, new PacketRemapper() { - @Override - public void registerMap() { - handler(new PacketHandler() { - @Override - public void handle(PacketWrapper wrapper) throws Exception { - int tid = wrapper.read(Type.VAR_INT); - // Save transaction id - wrapper.user().get(TabCompleteTracker.class).setTransactionId(tid); - } - }); - // Prepend / - map(Type.STRING, new ValueTransformer(Type.STRING) { - @Override - public String transform(PacketWrapper wrapper, String inputValue) { - wrapper.user().get(TabCompleteTracker.class).setInput(inputValue); - return "/" + inputValue; - } - }); - // Fake the end of the packet - create(new ValueCreator() { - @Override - public void write(PacketWrapper wrapper) { - wrapper.write(Type.BOOLEAN, false); - wrapper.write(Type.OPTIONAL_POSITION, null); - } - }); - } - }); - - registerIncoming(State.PLAY, 0x05, 0x06); - registerIncoming(State.PLAY, 0x06, 0x07); - // InventoryPackets 0x07, 0x08 - registerIncoming(State.PLAY, 0x08, 0x09); - // InventoryPackets 0x09 -> 0x0A - - // New 0x0A - Edit book -> Plugin Message - registerIncoming(State.PLAY, 0x09, 0x0B, new PacketRemapper() { - @Override - public void registerMap() { - handler(new PacketHandler() { - @Override - public void handle(PacketWrapper wrapper) throws Exception { - Item item = wrapper.read(Type.FLAT_ITEM); - boolean isSigning = wrapper.read(Type.BOOLEAN); - - InventoryPackets.toServer(item); - - wrapper.write(Type.STRING, isSigning ? "MC|BSign" : "MC|BEdit"); // Channel - wrapper.write(Type.ITEM, item); - } - }); - } - }); - // New 0x0C - Query Entity NBT - registerIncoming(State.PLAY, -1, 0x0C, new PacketRemapper() { - @Override - public void registerMap() { - handler(new PacketHandler() { - @Override - public void handle(PacketWrapper wrapper) throws Exception { - wrapper.cancel(); - } - }); - } - }); - registerIncoming(State.PLAY, 0x0A, 0x0D); - registerIncoming(State.PLAY, 0x0B, 0x0E); - registerIncoming(State.PLAY, 0x0C, 0x0F); - registerIncoming(State.PLAY, 0x0D, 0x10); - registerIncoming(State.PLAY, 0x0E, 0x11); - registerIncoming(State.PLAY, 0x0F, 0x12); - registerIncoming(State.PLAY, 0x10, 0x13); - registerIncoming(State.PLAY, 0x11, 0x14); - // New 0x15 - Pick Item -> Plugin Message - registerIncoming(State.PLAY, 0x09, 0x15, new PacketRemapper() { - @Override - public void registerMap() { - create(new ValueCreator() { - @Override - public void write(PacketWrapper wrapper) throws Exception { - wrapper.write(Type.STRING, "MC|PickItem"); // Channel - } - }); - } - }); - - // Craft recipe request - registerIncoming(State.PLAY, 0x12, 0x16, new PacketRemapper() { - @Override - public void registerMap() { - handler(new PacketHandler() { - @Override - public void handle(PacketWrapper wrapper) throws Exception { - // TODO: This has changed >.> - wrapper.cancel(); - } - }); - } - }); - - registerIncoming(State.PLAY, 0x13, 0x17); - registerIncoming(State.PLAY, 0x14, 0x18); - registerIncoming(State.PLAY, 0x15, 0x19); - registerIncoming(State.PLAY, 0x16, 0x1A); - // Recipe Book Data - registerIncoming(State.PLAY, 0x17, 0x1B, new PacketRemapper() { - @Override - public void registerMap() { - map(Type.VAR_INT); // 0 - Type - - handler(new PacketHandler() { - @Override - public void handle(PacketWrapper wrapper) throws Exception { - int type = wrapper.get(Type.VAR_INT, 0); - - if (type == 1) { - wrapper.passthrough(Type.BOOLEAN); // Crafting Recipe Book Open - wrapper.passthrough(Type.BOOLEAN); // Crafting Recipe Filter Active - wrapper.read(Type.BOOLEAN); // Smelting Recipe Book Open | IGNORE NEW 1.13 FIELD - wrapper.read(Type.BOOLEAN); // Smelting Recipe Filter Active | IGNORE NEW 1.13 FIELD - } - } - }); - } - }); - - // New 0x1C - Name Item -> Plugin Message - registerIncoming(State.PLAY, 0x09, 0x1C, new PacketRemapper() { - @Override - public void registerMap() { - create(new ValueCreator() { - @Override - public void write(PacketWrapper wrapper) throws Exception { - wrapper.write(Type.STRING, "MC|ItemName"); // Channel - } - }); - } - }); - - registerIncoming(State.PLAY, 0x18, 0x1D); - registerIncoming(State.PLAY, 0x19, 0x1E); - - // New 0x1F - Select Trade -> Plugin Message - registerIncoming(State.PLAY, 0x09, 0x1F, new PacketRemapper() { - @Override - public void registerMap() { - create(new ValueCreator() { - @Override - public void write(PacketWrapper wrapper) throws Exception { - wrapper.write(Type.STRING, "MC|TrSel"); // Channel - } - }); - map(Type.VAR_INT, Type.INT); // Slot - } - }); - // New 0x20 - Set Beacon Effect -> Plugin Message - registerIncoming(State.PLAY, 0x09, 0x20, new PacketRemapper() { - @Override - public void registerMap() { - create(new ValueCreator() { - @Override - public void write(PacketWrapper wrapper) throws Exception { - wrapper.write(Type.STRING, "MC|Beacon"); // Channel - } - }); - map(Type.VAR_INT, Type.INT); // Primary Effect - map(Type.VAR_INT, Type.INT); // Secondary Effect - } - }); - - registerIncoming(State.PLAY, 0x1A, 0x21); - - // New 0x22 - Update Command Block -> Plugin Message - registerIncoming(State.PLAY, 0x09, 0x22, new PacketRemapper() { - @Override - public void registerMap() { - create(new ValueCreator() { - @Override - public void write(PacketWrapper wrapper) throws Exception { - wrapper.write(Type.STRING, "MC|AutoCmd"); - } - }); - handler(POS_TO_3_INT); - map(Type.STRING); // Command - handler(new PacketHandler() { - @Override - public void handle(PacketWrapper wrapper) throws Exception { - int mode = wrapper.read(Type.VAR_INT); - byte flags = wrapper.read(Type.BYTE); - - String stringMode = mode == 0 ? "SEQUENCE" - : mode == 1 ? "AUTO" - : "REDSTONE"; - - wrapper.write(Type.BOOLEAN, (flags & 0x1) != 0); // Track output - wrapper.write(Type.STRING, stringMode); - wrapper.write(Type.BOOLEAN, (flags & 0x2) != 0); // Is conditional - wrapper.write(Type.BOOLEAN, (flags & 0x4) != 0); // Automatic - } - }); - } - }); - // New 0x23 - Update Command Block Minecart -> Plugin Message - registerIncoming(State.PLAY, 0x09, 0x23, new PacketRemapper() { - @Override - public void registerMap() { - create(new ValueCreator() { - @Override - public void write(PacketWrapper wrapper) throws Exception { - wrapper.write(Type.STRING, "MC|AdvCmd"); - wrapper.write(Type.BYTE, (byte) 1); // Type 1 for Entity - } - }); - map(Type.VAR_INT, Type.INT); // Entity Id - } - }); - - // 0x1B -> 0x24 in InventoryPackets - - // New 0x25 - Update Structure Block -> Message Channel - registerIncoming(State.PLAY, 0x09, 0x25, new PacketRemapper() { - @Override - public void registerMap() { - create(new ValueCreator() { - @Override - public void write(PacketWrapper wrapper) throws Exception { - wrapper.write(Type.STRING, "MC|Struct"); // Channel - } - }); - handler(POS_TO_3_INT); - map(Type.VAR_INT, new ValueTransformer(Type.BYTE) { // Action - @Override - public Byte transform(PacketWrapper wrapper, Integer action) throws Exception { - return (byte) (action + 1); - } - }); // Action - map(Type.VAR_INT, new ValueTransformer(Type.STRING) { - @Override - public String transform(PacketWrapper wrapper, Integer mode) throws Exception { - return mode == 0 ? "SAVE" - : mode == 1 ? "LOAD" - : mode == 2 ? "CORNER" - : "DATA"; - } - }); - map(Type.STRING); // Name - map(Type.BYTE, Type.INT); // Offset X - map(Type.BYTE, Type.INT); // Offset Y - map(Type.BYTE, Type.INT); // Offset Z - map(Type.BYTE, Type.INT); // Size X - map(Type.BYTE, Type.INT); // Size Y - map(Type.BYTE, Type.INT); // Size Z - map(Type.VAR_INT, new ValueTransformer(Type.STRING) { // Mirror - @Override - public String transform(PacketWrapper wrapper, Integer mirror) throws Exception { - return mirror == 0 ? "NONE" - : mirror == 1 ? "LEFT_RIGHT" - : "FRONT_BACK"; - } - }); - map(Type.VAR_INT, new ValueTransformer(Type.STRING) { // Rotation - @Override - public String transform(PacketWrapper wrapper, Integer rotation) throws Exception { - return rotation == 0 ? "NONE" - : rotation == 1 ? "CLOCKWISE_90" - : rotation == 2 ? "CLOCKWISE_180" - : "COUNTERCLOCKWISE_90"; - } - }); - map(Type.STRING); - handler(new PacketHandler() { - @Override - public void handle(PacketWrapper wrapper) throws Exception { - float integrity = wrapper.read(Type.FLOAT); - long seed = wrapper.read(Type.VAR_LONG); - byte flags = wrapper.read(Type.BYTE); - - wrapper.write(Type.BOOLEAN, (flags & 0x1) != 0); // Ignore Entities - wrapper.write(Type.BOOLEAN, (flags & 0x2) != 0); // Show air - wrapper.write(Type.BOOLEAN, (flags & 0x4) != 0); // Show bounding box - wrapper.write(Type.FLOAT, integrity); - wrapper.write(Type.VAR_LONG, seed); - } - }); - } - }); - - registerIncoming(State.PLAY, 0x1C, 0x26); - registerIncoming(State.PLAY, 0x1D, 0x27); - registerIncoming(State.PLAY, 0x1E, 0x28); - registerIncoming(State.PLAY, 0x1F, 0x29); - registerIncoming(State.PLAY, 0x20, 0x2A); - } - - @Override - public void init(UserConnection userConnection) { - userConnection.put(new EntityTracker(userConnection)); - userConnection.put(new TabCompleteTracker(userConnection)); - if (!userConnection.has(ClientWorld.class)) - userConnection.put(new ClientWorld(userConnection)); - userConnection.put(new BlockStorage(userConnection)); - } - - @Override - protected void register(ViaProviders providers) { - providers.register(BlockEntityProvider.class, new BlockEntityProvider()); - providers.register(PaintingProvider.class, new PaintingProvider()); - } - - private int getNewSoundID(final int oldID) { - return MappingData.oldToNewSounds.get(oldID); - } -} +package us.myles.ViaVersion.protocols.protocol1_13to1_12_2; + +import net.md_5.bungee.api.chat.TextComponent; +import net.md_5.bungee.chat.ComponentSerializer; +import us.myles.ViaVersion.api.PacketWrapper; +import us.myles.ViaVersion.api.data.UserConnection; +import us.myles.ViaVersion.api.entities.Entity1_13Types; +import us.myles.ViaVersion.api.minecraft.Position; +import us.myles.ViaVersion.api.minecraft.item.Item; +import us.myles.ViaVersion.api.platform.providers.ViaProviders; +import us.myles.ViaVersion.api.protocol.Protocol; +import us.myles.ViaVersion.api.remapper.PacketHandler; +import us.myles.ViaVersion.api.remapper.PacketRemapper; +import us.myles.ViaVersion.api.remapper.ValueCreator; +import us.myles.ViaVersion.api.remapper.ValueTransformer; +import us.myles.ViaVersion.api.type.Type; +import us.myles.ViaVersion.packets.State; +import us.myles.ViaVersion.protocols.protocol1_9_3to1_9_1_2.storage.ClientWorld; +import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.data.MappingData; +import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.packets.EntityPackets; +import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.packets.InventoryPackets; +import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.packets.WorldPackets; +import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.providers.BlockEntityProvider; +import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.providers.PaintingProvider; +import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.storage.BlockStorage; +import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.storage.EntityTracker; +import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.storage.TabCompleteTracker; +import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.types.Particle1_13Type; + +import java.util.Map; + +// Development of 1.13 support! +public class Protocol1_13To1_12_2 extends Protocol { + public static final Particle1_13Type PARTICLE_TYPE = new Particle1_13Type(); + + public static String legacyTextToJson(String legacyText) { + return ComponentSerializer.toString( + TextComponent.fromLegacyText(legacyText) + ); + } + + public static final PacketHandler POS_TO_3_INT = new PacketHandler() { + @Override + public void handle(PacketWrapper wrapper) throws Exception { + Position position = wrapper.read(Type.POSITION); + wrapper.write(Type.INT, position.getX().intValue()); + wrapper.write(Type.INT, position.getY().intValue()); + wrapper.write(Type.INT, position.getZ().intValue()); + } + }; + + public static final PacketHandler SEND_DECLARE_COMMANDS_AND_TAGS = new PacketHandler() { // *insert here a good name* + @Override + public void handle(PacketWrapper w) throws Exception { + // Send fake declare commands + w.create(0x11, new ValueCreator() { + @Override + public void write(PacketWrapper wrapper) { + wrapper.write(Type.VAR_INT, 2); // Size + // Write root node + wrapper.write(Type.VAR_INT, 0); // Mark as command + wrapper.write(Type.VAR_INT, 1); // 1 child + wrapper.write(Type.VAR_INT, 1); // Child is at 1 + + // Write arg node + wrapper.write(Type.VAR_INT, 0x02 | 0x04 | 0x10); // Mark as command + wrapper.write(Type.VAR_INT, 0); // No children + // Extra data + wrapper.write(Type.STRING, "args"); // Arg name + wrapper.write(Type.STRING, "brigadier:string"); + wrapper.write(Type.VAR_INT, 2); // Greedy + wrapper.write(Type.STRING, "minecraft:ask_server"); // Ask server + + wrapper.write(Type.VAR_INT, 0); // Root node index + } + }).send(Protocol1_13To1_12_2.class); + + // Send tags packet + w.create(0x55, new ValueCreator() { + @Override + public void write(PacketWrapper wrapper) throws Exception { + wrapper.write(Type.VAR_INT, MappingData.blockTags.size()); // block tags + for (Map.Entry tag : MappingData.blockTags.entrySet()) { + wrapper.write(Type.STRING, tag.getKey()); + wrapper.write(Type.VAR_INT_ARRAY, tag.getValue().clone()); + } + wrapper.write(Type.VAR_INT, MappingData.itemTags.size()); // item tags + for (Map.Entry tag : MappingData.itemTags.entrySet()) { + wrapper.write(Type.STRING, tag.getKey()); + wrapper.write(Type.VAR_INT_ARRAY, tag.getValue().clone()); + } + wrapper.write(Type.VAR_INT, MappingData.fluidTags.size()); // fluid tags + for (Map.Entry tag : MappingData.fluidTags.entrySet()) { + wrapper.write(Type.STRING, tag.getKey()); + wrapper.write(Type.VAR_INT_ARRAY, tag.getValue().clone()); + } + } + }).send(Protocol1_13To1_12_2.class); + } + }; + + static { + MappingData.init(); + } + + public static String jsonTextToLegacy(String value) { + return TextComponent.toLegacyText(ComponentSerializer.parse(value)); + } + + @Override + protected void registerPackets() { + // Register grouped packet changes + EntityPackets.register(this); + WorldPackets.register(this); + InventoryPackets.register(this); + + // Outgoing packets + + // New packet 0x04 - Login Plugin Message + + // Statistics + registerOutgoing(State.PLAY, 0x07, 0x07, new PacketRemapper() { + @Override + public void registerMap() { + // TODO: This packet has changed + + handler(new PacketHandler() { + @Override + public void handle(PacketWrapper wrapper) throws Exception { + wrapper.cancel(); + } + }); + } + }); + + registerOutgoing(State.PLAY, 0xF, 0xE); + // WorldPackets 0x10 -> 0x0F + + // Tab-Complete + registerOutgoing(State.PLAY, 0xE, 0x10, new PacketRemapper() { + @Override + public void registerMap() { + create(new ValueCreator() { + @Override + public void write(PacketWrapper wrapper) throws Exception { + wrapper.write(Type.VAR_INT, wrapper.user().get(TabCompleteTracker.class).getTransactionId()); + + String input = wrapper.user().get(TabCompleteTracker.class).getInput(); + // Start & End + int index; + int length; + // If no input or new word (then it's the start) + if (input.endsWith(" ") || input.length() == 0) { + index = input.length(); + length = 0; + } else { + // Otherwise find the last space (+1 as we include it) + int lastSpace = input.lastIndexOf(" ") + 1; + index = lastSpace; + length = input.length() - lastSpace; + } + // Write index + length + wrapper.write(Type.VAR_INT, index); + wrapper.write(Type.VAR_INT, length); + + int count = wrapper.passthrough(Type.VAR_INT); + for (int i = 0; i < count; i++) { + String suggestion = wrapper.read(Type.STRING); + // If we're at the start then handle removing slash + if (suggestion.startsWith("/") && index == 0) { + suggestion = suggestion.substring(1); + } + wrapper.write(Type.STRING, suggestion); + wrapper.write(Type.BOOLEAN, false); + } + } + }); + } + }); + + // New packet 0x11, declare commands + registerOutgoing(State.PLAY, 0x11, 0x12); + registerOutgoing(State.PLAY, 0x12, 0x13); + registerOutgoing(State.PLAY, 0x13, 0x14); + // InventoryPackets 0x14 -> 0x15 + registerOutgoing(State.PLAY, 0x15, 0x16); + // InventoryPackets 0x16 -> 0x17 + registerOutgoing(State.PLAY, 0x17, 0x18); + // InventoryPackets 0x18 -> 0x19 + registerOutgoing(State.PLAY, 0x1A, 0x1B); + registerOutgoing(State.PLAY, 0x1B, 0x1C); + // New packet 0x1D - NBT Query + registerOutgoing(State.PLAY, 0x1C, 0x1E); + registerOutgoing(State.PLAY, 0x1D, 0x1F); + registerOutgoing(State.PLAY, 0x1E, 0x20); + registerOutgoing(State.PLAY, 0x1F, 0x21); + // WorldPackets 0x20 -> 0x22 + registerOutgoing(State.PLAY, 0x21, 0x23); + // WorldPackets 0x22 -> 0x24 + // Join (save dimension id) + registerOutgoing(State.PLAY, 0x23, 0x25, new PacketRemapper() { + @Override + public void registerMap() { + map(Type.INT); // 0 - Entity ID + map(Type.UNSIGNED_BYTE); // 1 - Gamemode + map(Type.INT); // 2 - Dimension + + handler(new PacketHandler() { + @Override + public void handle(PacketWrapper wrapper) throws Exception { + // Store the player + int entityId = wrapper.get(Type.INT, 0); + wrapper.user().get(EntityTracker.class).addEntity(entityId, Entity1_13Types.EntityType.PLAYER); + + ClientWorld clientChunks = wrapper.user().get(ClientWorld.class); + int dimensionId = wrapper.get(Type.INT, 1); + clientChunks.setEnvironment(dimensionId); + } + }); + handler(SEND_DECLARE_COMMANDS_AND_TAGS); + } + }); + + // Map packet + registerOutgoing(State.PLAY, 0x24, 0x26, new PacketRemapper() { + @Override + public void registerMap() { + map(Type.VAR_INT); // 0 - Map id + map(Type.BYTE); // 1 - Scale + map(Type.BOOLEAN); // 2 - Tracking Position + handler(new PacketHandler() { + @Override + public void handle(PacketWrapper wrapper) throws Exception { + int iconCount = wrapper.passthrough(Type.VAR_INT); + for (int i = 0; i < iconCount; i++) { + byte directionAndType = wrapper.read(Type.BYTE); + int type = (directionAndType & 0xF0) >> 4; + wrapper.write(Type.VAR_INT, type); + wrapper.passthrough(Type.BYTE); // Icon X + wrapper.passthrough(Type.BYTE); // Icon Z + byte direction = (byte) (directionAndType & 0x0F); + wrapper.write(Type.BYTE, direction); + wrapper.write(Type.OPTIONAL_CHAT, null); // Display Name + } + } + }); + } + }); + registerOutgoing(State.PLAY, 0x25, 0x27); + registerOutgoing(State.PLAY, 0x26, 0x28); + registerOutgoing(State.PLAY, 0x27, 0x29); + registerOutgoing(State.PLAY, 0x28, 0x2A); + registerOutgoing(State.PLAY, 0x29, 0x2B); + registerOutgoing(State.PLAY, 0x2A, 0x2C); + // Craft recipe response + registerOutgoing(State.PLAY, 0x2B, 0x2D, new PacketRemapper() { + @Override + public void registerMap() { + handler(new PacketHandler() { + @Override + public void handle(PacketWrapper wrapper) throws Exception { + // TODO This packet changed + wrapper.cancel(); + } + }); + } + }); + registerOutgoing(State.PLAY, 0x2C, 0x2E); + registerOutgoing(State.PLAY, 0x2D, 0x2F); + registerOutgoing(State.PLAY, 0x2E, 0x30); + // New 0x31 - Face Player + registerOutgoing(State.PLAY, 0x2F, 0x32); + registerOutgoing(State.PLAY, 0x30, 0x33); + // Recipe + registerOutgoing(State.PLAY, 0x31, 0x34, new PacketRemapper() { + @Override + public void registerMap() { + handler(new PacketHandler() { + @Override + public void handle(PacketWrapper wrapper) throws Exception { + // TODO: This has changed >.> + wrapper.cancel(); + } + }); + } + }); + + // EntityPackets 0x32 -> 0x35 + registerOutgoing(State.PLAY, 0x33, 0x36); + registerOutgoing(State.PLAY, 0x34, 0x37); + + // Respawn (save dimension id) + registerOutgoing(State.PLAY, 0x35, 0x38, new PacketRemapper() { + @Override + public void registerMap() { + map(Type.INT); // 0 - Dimension ID + handler(new PacketHandler() { + @Override + public void handle(PacketWrapper wrapper) throws Exception { + ClientWorld clientWorld = wrapper.user().get(ClientWorld.class); + int dimensionId = wrapper.get(Type.INT, 0); + clientWorld.setEnvironment(dimensionId); + } + }); + handler(SEND_DECLARE_COMMANDS_AND_TAGS); + } + }); + + registerOutgoing(State.PLAY, 0x36, 0x39); + registerOutgoing(State.PLAY, 0x37, 0x3A); + registerOutgoing(State.PLAY, 0x38, 0x3B); + registerOutgoing(State.PLAY, 0x39, 0x3C); + registerOutgoing(State.PLAY, 0x3A, 0x3D); + registerOutgoing(State.PLAY, 0x3B, 0x3E); + // EntityPackets 0x3C -> 0x3F + registerOutgoing(State.PLAY, 0x3D, 0x40); + registerOutgoing(State.PLAY, 0x3E, 0x41); + // InventoryPackets 0x3F -> 0x42 + registerOutgoing(State.PLAY, 0x40, 0x43); + registerOutgoing(State.PLAY, 0x41, 0x44); + // Scoreboard Objective + registerOutgoing(State.PLAY, 0x42, 0x45, new PacketRemapper() { + @Override + public void registerMap() { + map(Type.STRING); // 0 - Objective name + map(Type.BYTE); // 1 - Mode + handler(new PacketHandler() { + @Override + public void handle(PacketWrapper wrapper) throws Exception { + byte mode = wrapper.get(Type.BYTE, 0); + // On create or update + if (mode == 0 || mode == 2) { + String value = wrapper.read(Type.STRING); // Value + value = legacyTextToJson(value); + wrapper.write(Type.STRING, value); + + String type = wrapper.read(Type.STRING); + // integer or hearts + wrapper.write(Type.VAR_INT, type.equals("integer") ? 0 : 1); + } + } + }); + } + }); + + registerOutgoing(State.PLAY, 0x43, 0x46); + // Team packet + registerOutgoing(State.PLAY, 0x44, 0x47, new PacketRemapper() { + @Override + public void registerMap() { + map(Type.STRING); // 0 - Team Name + map(Type.BYTE); // 1 - Mode + + handler(new PacketHandler() { + @Override + public void handle(PacketWrapper wrapper) throws Exception { + byte action = wrapper.get(Type.BYTE, 0); + + if (action == 0 || action == 2) { + String displayName = wrapper.read(Type.STRING); // Display Name + displayName = legacyTextToJson(displayName); + wrapper.write(Type.STRING, displayName); + + String prefix = wrapper.read(Type.STRING); // Prefix moved + String suffix = wrapper.read(Type.STRING); // Suffix moved + + wrapper.passthrough(Type.BYTE); // Flags + + wrapper.passthrough(Type.STRING); // Name Tag Visibility + wrapper.passthrough(Type.STRING); // Collision rule + + // Handle new colors + byte color = wrapper.read(Type.BYTE); + + if (color == -1) // -1 changed to 21 + wrapper.write(Type.VAR_INT, 21); // RESET + else + wrapper.write(Type.VAR_INT, (int) color); + + wrapper.write(Type.STRING, legacyTextToJson(prefix)); // Prefix + wrapper.write(Type.STRING, legacyTextToJson(suffix)); // Suffix + } + } + }); + + } + }); + registerOutgoing(State.PLAY, 0x45, 0x48); + registerOutgoing(State.PLAY, 0x46, 0x49); + registerOutgoing(State.PLAY, 0x47, 0x4A); + registerOutgoing(State.PLAY, 0x48, 0x4B); + // New 0x4C - Stop Sound + + // Sound Effect packet + registerOutgoing(State.PLAY, 0x49, 0x4D, new PacketRemapper() { + @Override + public void registerMap() { + map(Type.VAR_INT); // 0 - Sound ID + + handler(new PacketHandler() { + @Override + public void handle(PacketWrapper wrapper) throws Exception { + int soundId = wrapper.get(Type.VAR_INT, 0); + wrapper.set(Type.VAR_INT, 0, getNewSoundID(soundId)); + } + }); + } + }); + registerOutgoing(State.PLAY, 0x4A, 0x4E); + registerOutgoing(State.PLAY, 0x4B, 0x4F); + registerOutgoing(State.PLAY, 0x4C, 0x50); + // Advancements + registerOutgoing(State.PLAY, 0x4D, 0x51, new PacketRemapper() { + @Override + public void registerMap() { + handler(new PacketHandler() { + @Override + public void handle(PacketWrapper wrapper) throws Exception { + // TODO Temporary cancel advancements because of 'Non [a-z0-9/._-] character in path of location: minecraft:? https://fs.matsv.nl/media?id=auwje4z4lxw.png + wrapper.cancel(); + } + }); + } + }); + registerOutgoing(State.PLAY, 0x4E, 0x52); + registerOutgoing(State.PLAY, 0x4F, 0x53); + // New packet 0x54 - Declare Recipes + // New packet 0x55 - Tags + + // Incoming packets + + // New packet 0x02 - Login Plugin Message + registerIncoming(State.LOGIN, -1, 0x02, new PacketRemapper() { + @Override + public void registerMap() { + handler(new PacketHandler() { + @Override + public void handle(PacketWrapper wrapper) throws Exception { + wrapper.cancel(); + } + }); + } + }); + + // New 0x01 - Query Block NBT + registerIncoming(State.PLAY, -1, 0x01, new PacketRemapper() { + @Override + public void registerMap() { + handler(new PacketHandler() { + @Override + public void handle(PacketWrapper wrapper) throws Exception { + wrapper.cancel(); + } + }); + } + }); + + // Tab-Complete + registerIncoming(State.PLAY, 0x1, 0x5, new PacketRemapper() { + @Override + public void registerMap() { + handler(new PacketHandler() { + @Override + public void handle(PacketWrapper wrapper) throws Exception { + int tid = wrapper.read(Type.VAR_INT); + // Save transaction id + wrapper.user().get(TabCompleteTracker.class).setTransactionId(tid); + } + }); + // Prepend / + map(Type.STRING, new ValueTransformer(Type.STRING) { + @Override + public String transform(PacketWrapper wrapper, String inputValue) { + wrapper.user().get(TabCompleteTracker.class).setInput(inputValue); + return "/" + inputValue; + } + }); + // Fake the end of the packet + create(new ValueCreator() { + @Override + public void write(PacketWrapper wrapper) { + wrapper.write(Type.BOOLEAN, false); + wrapper.write(Type.OPTIONAL_POSITION, null); + } + }); + } + }); + + registerIncoming(State.PLAY, 0x05, 0x06); + registerIncoming(State.PLAY, 0x06, 0x07); + // InventoryPackets 0x07, 0x08 + registerIncoming(State.PLAY, 0x08, 0x09); + // InventoryPackets 0x09 -> 0x0A + + // New 0x0A - Edit book -> Plugin Message + registerIncoming(State.PLAY, 0x09, 0x0B, new PacketRemapper() { + @Override + public void registerMap() { + handler(new PacketHandler() { + @Override + public void handle(PacketWrapper wrapper) throws Exception { + Item item = wrapper.read(Type.FLAT_ITEM); + boolean isSigning = wrapper.read(Type.BOOLEAN); + + InventoryPackets.toServer(item); + + wrapper.write(Type.STRING, isSigning ? "MC|BSign" : "MC|BEdit"); // Channel + wrapper.write(Type.ITEM, item); + } + }); + } + }); + // New 0x0C - Query Entity NBT + registerIncoming(State.PLAY, -1, 0x0C, new PacketRemapper() { + @Override + public void registerMap() { + handler(new PacketHandler() { + @Override + public void handle(PacketWrapper wrapper) throws Exception { + wrapper.cancel(); + } + }); + } + }); + registerIncoming(State.PLAY, 0x0A, 0x0D); + registerIncoming(State.PLAY, 0x0B, 0x0E); + registerIncoming(State.PLAY, 0x0C, 0x0F); + registerIncoming(State.PLAY, 0x0D, 0x10); + registerIncoming(State.PLAY, 0x0E, 0x11); + registerIncoming(State.PLAY, 0x0F, 0x12); + registerIncoming(State.PLAY, 0x10, 0x13); + registerIncoming(State.PLAY, 0x11, 0x14); + // New 0x15 - Pick Item -> Plugin Message + registerIncoming(State.PLAY, 0x09, 0x15, new PacketRemapper() { + @Override + public void registerMap() { + create(new ValueCreator() { + @Override + public void write(PacketWrapper wrapper) throws Exception { + wrapper.write(Type.STRING, "MC|PickItem"); // Channel + } + }); + } + }); + + // Craft recipe request + registerIncoming(State.PLAY, 0x12, 0x16, new PacketRemapper() { + @Override + public void registerMap() { + handler(new PacketHandler() { + @Override + public void handle(PacketWrapper wrapper) throws Exception { + // TODO: This has changed >.> + wrapper.cancel(); + } + }); + } + }); + + registerIncoming(State.PLAY, 0x13, 0x17); + registerIncoming(State.PLAY, 0x14, 0x18); + registerIncoming(State.PLAY, 0x15, 0x19); + registerIncoming(State.PLAY, 0x16, 0x1A); + // Recipe Book Data + registerIncoming(State.PLAY, 0x17, 0x1B, new PacketRemapper() { + @Override + public void registerMap() { + map(Type.VAR_INT); // 0 - Type + + handler(new PacketHandler() { + @Override + public void handle(PacketWrapper wrapper) throws Exception { + int type = wrapper.get(Type.VAR_INT, 0); + + if (type == 1) { + wrapper.passthrough(Type.BOOLEAN); // Crafting Recipe Book Open + wrapper.passthrough(Type.BOOLEAN); // Crafting Recipe Filter Active + wrapper.read(Type.BOOLEAN); // Smelting Recipe Book Open | IGNORE NEW 1.13 FIELD + wrapper.read(Type.BOOLEAN); // Smelting Recipe Filter Active | IGNORE NEW 1.13 FIELD + } + } + }); + } + }); + + // New 0x1C - Name Item -> Plugin Message + registerIncoming(State.PLAY, 0x09, 0x1C, new PacketRemapper() { + @Override + public void registerMap() { + create(new ValueCreator() { + @Override + public void write(PacketWrapper wrapper) throws Exception { + wrapper.write(Type.STRING, "MC|ItemName"); // Channel + } + }); + } + }); + + registerIncoming(State.PLAY, 0x18, 0x1D); + registerIncoming(State.PLAY, 0x19, 0x1E); + + // New 0x1F - Select Trade -> Plugin Message + registerIncoming(State.PLAY, 0x09, 0x1F, new PacketRemapper() { + @Override + public void registerMap() { + create(new ValueCreator() { + @Override + public void write(PacketWrapper wrapper) throws Exception { + wrapper.write(Type.STRING, "MC|TrSel"); // Channel + } + }); + map(Type.VAR_INT, Type.INT); // Slot + } + }); + // New 0x20 - Set Beacon Effect -> Plugin Message + registerIncoming(State.PLAY, 0x09, 0x20, new PacketRemapper() { + @Override + public void registerMap() { + create(new ValueCreator() { + @Override + public void write(PacketWrapper wrapper) throws Exception { + wrapper.write(Type.STRING, "MC|Beacon"); // Channel + } + }); + map(Type.VAR_INT, Type.INT); // Primary Effect + map(Type.VAR_INT, Type.INT); // Secondary Effect + } + }); + + registerIncoming(State.PLAY, 0x1A, 0x21); + + // New 0x22 - Update Command Block -> Plugin Message + registerIncoming(State.PLAY, 0x09, 0x22, new PacketRemapper() { + @Override + public void registerMap() { + create(new ValueCreator() { + @Override + public void write(PacketWrapper wrapper) throws Exception { + wrapper.write(Type.STRING, "MC|AutoCmd"); + } + }); + handler(POS_TO_3_INT); + map(Type.STRING); // Command + handler(new PacketHandler() { + @Override + public void handle(PacketWrapper wrapper) throws Exception { + int mode = wrapper.read(Type.VAR_INT); + byte flags = wrapper.read(Type.BYTE); + + String stringMode = mode == 0 ? "SEQUENCE" + : mode == 1 ? "AUTO" + : "REDSTONE"; + + wrapper.write(Type.BOOLEAN, (flags & 0x1) != 0); // Track output + wrapper.write(Type.STRING, stringMode); + wrapper.write(Type.BOOLEAN, (flags & 0x2) != 0); // Is conditional + wrapper.write(Type.BOOLEAN, (flags & 0x4) != 0); // Automatic + } + }); + } + }); + // New 0x23 - Update Command Block Minecart -> Plugin Message + registerIncoming(State.PLAY, 0x09, 0x23, new PacketRemapper() { + @Override + public void registerMap() { + create(new ValueCreator() { + @Override + public void write(PacketWrapper wrapper) throws Exception { + wrapper.write(Type.STRING, "MC|AdvCmd"); + wrapper.write(Type.BYTE, (byte) 1); // Type 1 for Entity + } + }); + map(Type.VAR_INT, Type.INT); // Entity Id + } + }); + + // 0x1B -> 0x24 in InventoryPackets + + // New 0x25 - Update Structure Block -> Message Channel + registerIncoming(State.PLAY, 0x09, 0x25, new PacketRemapper() { + @Override + public void registerMap() { + create(new ValueCreator() { + @Override + public void write(PacketWrapper wrapper) throws Exception { + wrapper.write(Type.STRING, "MC|Struct"); // Channel + } + }); + handler(POS_TO_3_INT); + map(Type.VAR_INT, new ValueTransformer(Type.BYTE) { // Action + @Override + public Byte transform(PacketWrapper wrapper, Integer action) throws Exception { + return (byte) (action + 1); + } + }); // Action + map(Type.VAR_INT, new ValueTransformer(Type.STRING) { + @Override + public String transform(PacketWrapper wrapper, Integer mode) throws Exception { + return mode == 0 ? "SAVE" + : mode == 1 ? "LOAD" + : mode == 2 ? "CORNER" + : "DATA"; + } + }); + map(Type.STRING); // Name + map(Type.BYTE, Type.INT); // Offset X + map(Type.BYTE, Type.INT); // Offset Y + map(Type.BYTE, Type.INT); // Offset Z + map(Type.BYTE, Type.INT); // Size X + map(Type.BYTE, Type.INT); // Size Y + map(Type.BYTE, Type.INT); // Size Z + map(Type.VAR_INT, new ValueTransformer(Type.STRING) { // Mirror + @Override + public String transform(PacketWrapper wrapper, Integer mirror) throws Exception { + return mirror == 0 ? "NONE" + : mirror == 1 ? "LEFT_RIGHT" + : "FRONT_BACK"; + } + }); + map(Type.VAR_INT, new ValueTransformer(Type.STRING) { // Rotation + @Override + public String transform(PacketWrapper wrapper, Integer rotation) throws Exception { + return rotation == 0 ? "NONE" + : rotation == 1 ? "CLOCKWISE_90" + : rotation == 2 ? "CLOCKWISE_180" + : "COUNTERCLOCKWISE_90"; + } + }); + map(Type.STRING); + handler(new PacketHandler() { + @Override + public void handle(PacketWrapper wrapper) throws Exception { + float integrity = wrapper.read(Type.FLOAT); + long seed = wrapper.read(Type.VAR_LONG); + byte flags = wrapper.read(Type.BYTE); + + wrapper.write(Type.BOOLEAN, (flags & 0x1) != 0); // Ignore Entities + wrapper.write(Type.BOOLEAN, (flags & 0x2) != 0); // Show air + wrapper.write(Type.BOOLEAN, (flags & 0x4) != 0); // Show bounding box + wrapper.write(Type.FLOAT, integrity); + wrapper.write(Type.VAR_LONG, seed); + } + }); + } + }); + + registerIncoming(State.PLAY, 0x1C, 0x26); + registerIncoming(State.PLAY, 0x1D, 0x27); + registerIncoming(State.PLAY, 0x1E, 0x28); + registerIncoming(State.PLAY, 0x1F, 0x29); + registerIncoming(State.PLAY, 0x20, 0x2A); + } + + @Override + public void init(UserConnection userConnection) { + userConnection.put(new EntityTracker(userConnection)); + userConnection.put(new TabCompleteTracker(userConnection)); + if (!userConnection.has(ClientWorld.class)) + userConnection.put(new ClientWorld(userConnection)); + userConnection.put(new BlockStorage(userConnection)); + } + + @Override + protected void register(ViaProviders providers) { + providers.register(BlockEntityProvider.class, new BlockEntityProvider()); + providers.register(PaintingProvider.class, new PaintingProvider()); + } + + private int getNewSoundID(final int oldID) { + return MappingData.oldToNewSounds.get(oldID); + } +} diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/chunks/Chunk1_13.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/chunks/Chunk1_13.java similarity index 88% rename from common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/chunks/Chunk1_13.java rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/chunks/Chunk1_13.java index 3f2b16792..92cd1b675 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/chunks/Chunk1_13.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/chunks/Chunk1_13.java @@ -1,4 +1,4 @@ -package us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.chunks; +package us.myles.ViaVersion.protocols.protocol1_13to1_12_2.chunks; import com.github.steveice10.opennbt.tag.builtin.CompoundTag; import lombok.AllArgsConstructor; diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/chunks/ChunkSection1_13.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/chunks/ChunkSection1_13.java similarity index 99% rename from common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/chunks/ChunkSection1_13.java rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/chunks/ChunkSection1_13.java index d74e750c8..41d8b5d9d 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/chunks/ChunkSection1_13.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/chunks/ChunkSection1_13.java @@ -1,4 +1,4 @@ -package us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.chunks; +package us.myles.ViaVersion.protocols.protocol1_13to1_12_2.chunks; import com.google.common.collect.Lists; import io.netty.buffer.ByteBuf; diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/data/EntityTypeRewriter.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/data/EntityTypeRewriter.java similarity index 98% rename from common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/data/EntityTypeRewriter.java rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/data/EntityTypeRewriter.java index 779755e89..8fe62e6db 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/data/EntityTypeRewriter.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/data/EntityTypeRewriter.java @@ -1,4 +1,4 @@ -package us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.data; +package us.myles.ViaVersion.protocols.protocol1_13to1_12_2.data; import com.google.common.base.Optional; diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/data/MappingData.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/data/MappingData.java similarity index 98% rename from common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/data/MappingData.java rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/data/MappingData.java index 53a134aca..c51cd40dc 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/data/MappingData.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/data/MappingData.java @@ -1,4 +1,4 @@ -package us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.data; +package us.myles.ViaVersion.protocols.protocol1_13to1_12_2.data; import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/data/Particle.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/data/Particle.java similarity index 87% rename from common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/data/Particle.java rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/data/Particle.java index 702eef20b..b6e786120 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/data/Particle.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/data/Particle.java @@ -1,4 +1,4 @@ -package us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.data; +package us.myles.ViaVersion.protocols.protocol1_13to1_12_2.data; import lombok.AllArgsConstructor; import lombok.Data; diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/data/ParticleRewriter.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/data/ParticleRewriter.java similarity index 97% rename from common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/data/ParticleRewriter.java rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/data/ParticleRewriter.java index d0fa577ee..4bfcc6bf2 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/data/ParticleRewriter.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/data/ParticleRewriter.java @@ -1,12 +1,12 @@ -package us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.data; +package us.myles.ViaVersion.protocols.protocol1_13to1_12_2.data; import lombok.Data; import lombok.RequiredArgsConstructor; import us.myles.ViaVersion.api.Via; import us.myles.ViaVersion.api.minecraft.item.Item; import us.myles.ViaVersion.api.type.Type; -import us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.packets.InventoryPackets; -import us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.packets.WorldPackets; +import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.packets.InventoryPackets; +import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.packets.WorldPackets; import java.util.Arrays; import java.util.LinkedList; diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/data/SoundSource.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/data/SoundSource.java similarity index 91% rename from common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/data/SoundSource.java rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/data/SoundSource.java index f2833d303..c6aeeabed 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/data/SoundSource.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/data/SoundSource.java @@ -1,4 +1,4 @@ -package us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.data; +package us.myles.ViaVersion.protocols.protocol1_13to1_12_2.data; import com.google.common.base.Optional; import lombok.AllArgsConstructor; diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/data/SpawnEggRewriter.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/data/SpawnEggRewriter.java similarity index 97% rename from common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/data/SpawnEggRewriter.java rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/data/SpawnEggRewriter.java index 9d79f5cb0..80ce89112 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/data/SpawnEggRewriter.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/data/SpawnEggRewriter.java @@ -1,4 +1,4 @@ -package us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.data; +package us.myles.ViaVersion.protocols.protocol1_13to1_12_2.data; import com.google.common.base.Optional; import com.google.common.collect.BiMap; diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/packets/EntityPackets.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/packets/EntityPackets.java similarity index 95% rename from common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/packets/EntityPackets.java rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/packets/EntityPackets.java index 07d712f87..6ab4ca27a 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/packets/EntityPackets.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/packets/EntityPackets.java @@ -1,4 +1,4 @@ -package us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.packets; +package us.myles.ViaVersion.protocols.protocol1_13to1_12_2.packets; import com.google.common.base.Optional; import us.myles.ViaVersion.api.PacketWrapper; @@ -10,9 +10,9 @@ import us.myles.ViaVersion.api.type.Type; import us.myles.ViaVersion.api.type.types.version.Types1_12; import us.myles.ViaVersion.api.type.types.version.Types1_13; import us.myles.ViaVersion.packets.State; -import us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.MetadataRewriter; -import us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.data.EntityTypeRewriter; -import us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.storage.EntityTracker; +import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.MetadataRewriter; +import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.data.EntityTypeRewriter; +import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.storage.EntityTracker; public class EntityPackets { public static void register(Protocol protocol) { diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/packets/InventoryPackets.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/packets/InventoryPackets.java similarity index 97% rename from common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/packets/InventoryPackets.java rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/packets/InventoryPackets.java index 0c2eec81a..f451158d7 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/packets/InventoryPackets.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/packets/InventoryPackets.java @@ -1,4 +1,4 @@ -package us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.packets; +package us.myles.ViaVersion.protocols.protocol1_13to1_12_2.packets; import com.github.steveice10.opennbt.tag.builtin.*; import com.google.common.base.Joiner; @@ -11,10 +11,10 @@ import us.myles.ViaVersion.api.remapper.PacketHandler; import us.myles.ViaVersion.api.remapper.PacketRemapper; import us.myles.ViaVersion.api.type.Type; import us.myles.ViaVersion.packets.State; -import us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.ProtocolSnapshotTo1_12_2; -import us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.data.MappingData; -import us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.data.SoundSource; -import us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.data.SpawnEggRewriter; +import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.Protocol1_13To1_12_2; +import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.data.MappingData; +import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.data.SoundSource; +import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.data.SpawnEggRewriter; import java.nio.charset.StandardCharsets; import java.util.ArrayList; @@ -295,7 +295,7 @@ public class InventoryPackets { if (((CompoundTag) tag.get("display")).get("Name") instanceof StringTag) { StringTag name = ((CompoundTag) tag.get("display")).get("Name"); name.setValue( - ProtocolSnapshotTo1_12_2.legacyTextToJson( + Protocol1_13To1_12_2.legacyTextToJson( name.getValue() ) ); @@ -441,7 +441,7 @@ public class InventoryPackets { if (((CompoundTag) tag.get("display")).get("Name") instanceof StringTag) { StringTag name = ((CompoundTag) tag.get("display")).get("Name"); name.setValue( - ProtocolSnapshotTo1_12_2.jsonTextToLegacy( + Protocol1_13To1_12_2.jsonTextToLegacy( name.getValue() ) ); diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/packets/WorldPackets.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/packets/WorldPackets.java similarity index 94% rename from common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/packets/WorldPackets.java rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/packets/WorldPackets.java index ab9308e92..055957a56 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/packets/WorldPackets.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/packets/WorldPackets.java @@ -1,4 +1,4 @@ -package us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.packets; +package us.myles.ViaVersion.protocols.protocol1_13to1_12_2.packets; import com.github.steveice10.opennbt.tag.builtin.CompoundTag; import com.google.common.base.Optional; @@ -16,13 +16,13 @@ import us.myles.ViaVersion.api.type.Type; import us.myles.ViaVersion.packets.State; import us.myles.ViaVersion.protocols.protocol1_9_1_2to1_9_3_4.types.Chunk1_9_3_4Type; import us.myles.ViaVersion.protocols.protocol1_9_3to1_9_1_2.storage.ClientWorld; -import us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.data.MappingData; -import us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.data.Particle; -import us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.data.ParticleRewriter; -import us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.providers.BlockEntityProvider; -import us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.providers.PaintingProvider; -import us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.storage.BlockStorage; -import us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.types.Chunk1_13Type; +import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.data.MappingData; +import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.data.Particle; +import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.data.ParticleRewriter; +import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.providers.BlockEntityProvider; +import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.providers.PaintingProvider; +import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.storage.BlockStorage; +import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.types.Chunk1_13Type; public class WorldPackets { public static void register(Protocol protocol) { diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/providers/BlockEntityProvider.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/providers/BlockEntityProvider.java similarity index 77% rename from common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/providers/BlockEntityProvider.java rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/providers/BlockEntityProvider.java index 8256294f0..1d7352a9c 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/providers/BlockEntityProvider.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/providers/BlockEntityProvider.java @@ -1,4 +1,4 @@ -package us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.providers; +package us.myles.ViaVersion.protocols.protocol1_13to1_12_2.providers; import com.github.steveice10.opennbt.tag.builtin.CompoundTag; import us.myles.ViaVersion.api.PacketWrapper; @@ -6,11 +6,11 @@ import us.myles.ViaVersion.api.data.UserConnection; import us.myles.ViaVersion.api.minecraft.Position; import us.myles.ViaVersion.api.platform.providers.Provider; import us.myles.ViaVersion.api.type.Type; -import us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.ProtocolSnapshotTo1_12_2; -import us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.providers.blockentities.BannerHandler; -import us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.providers.blockentities.BedHandler; -import us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.providers.blockentities.FlowerPotHandler; -import us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.providers.blockentities.SkullHandler; +import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.Protocol1_13To1_12_2; +import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.providers.blockentities.BannerHandler; +import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.providers.blockentities.BedHandler; +import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.providers.blockentities.FlowerPotHandler; +import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.providers.blockentities.SkullHandler; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; @@ -63,7 +63,7 @@ public class BlockEntityProvider implements Provider { wrapper.write(Type.POSITION, position); wrapper.write(Type.VAR_INT, blockId); - wrapper.send(ProtocolSnapshotTo1_12_2.class, true, true); + wrapper.send(Protocol1_13To1_12_2.class, true, true); } diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/providers/PaintingProvider.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/providers/PaintingProvider.java similarity index 94% rename from common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/providers/PaintingProvider.java rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/providers/PaintingProvider.java index 10798027c..505e476cb 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/providers/PaintingProvider.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/providers/PaintingProvider.java @@ -1,4 +1,4 @@ -package us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.providers; +package us.myles.ViaVersion.protocols.protocol1_13to1_12_2.providers; import com.google.common.base.Optional; import us.myles.ViaVersion.api.platform.providers.Provider; diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/providers/blockentities/BannerHandler.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/providers/blockentities/BannerHandler.java similarity index 85% rename from common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/providers/blockentities/BannerHandler.java rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/providers/blockentities/BannerHandler.java index 632419d7d..cf4c25a64 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/providers/blockentities/BannerHandler.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/providers/blockentities/BannerHandler.java @@ -1,11 +1,11 @@ -package us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.providers.blockentities; +package us.myles.ViaVersion.protocols.protocol1_13to1_12_2.providers.blockentities; import com.github.steveice10.opennbt.tag.builtin.CompoundTag; import com.github.steveice10.opennbt.tag.builtin.Tag; import us.myles.ViaVersion.api.data.UserConnection; import us.myles.ViaVersion.api.minecraft.Position; -import us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.providers.BlockEntityProvider; -import us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.storage.BlockStorage; +import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.providers.BlockEntityProvider; +import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.storage.BlockStorage; public class BannerHandler implements BlockEntityProvider.BlockEntityHandler { private final int WALL_BANNER_START = 7110; // 4 each diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/providers/blockentities/BedHandler.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/providers/blockentities/BedHandler.java similarity index 80% rename from common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/providers/blockentities/BedHandler.java rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/providers/blockentities/BedHandler.java index 6e82073c2..312cf2520 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/providers/blockentities/BedHandler.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/providers/blockentities/BedHandler.java @@ -1,11 +1,11 @@ -package us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.providers.blockentities; +package us.myles.ViaVersion.protocols.protocol1_13to1_12_2.providers.blockentities; import com.github.steveice10.opennbt.tag.builtin.CompoundTag; import com.github.steveice10.opennbt.tag.builtin.Tag; import us.myles.ViaVersion.api.data.UserConnection; import us.myles.ViaVersion.api.minecraft.Position; -import us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.providers.BlockEntityProvider; -import us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.storage.BlockStorage; +import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.providers.BlockEntityProvider; +import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.storage.BlockStorage; public class BedHandler implements BlockEntityProvider.BlockEntityHandler { diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/providers/blockentities/FlowerPotHandler.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/providers/blockentities/FlowerPotHandler.java similarity index 94% rename from common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/providers/blockentities/FlowerPotHandler.java rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/providers/blockentities/FlowerPotHandler.java index 79ac4807d..536227486 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/providers/blockentities/FlowerPotHandler.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/providers/blockentities/FlowerPotHandler.java @@ -1,9 +1,9 @@ -package us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.providers.blockentities; +package us.myles.ViaVersion.protocols.protocol1_13to1_12_2.providers.blockentities; import com.github.steveice10.opennbt.tag.builtin.CompoundTag; import us.myles.ViaVersion.api.Pair; import us.myles.ViaVersion.api.data.UserConnection; -import us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.providers.BlockEntityProvider; +import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.providers.BlockEntityProvider; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/providers/blockentities/SkullHandler.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/providers/blockentities/SkullHandler.java similarity index 83% rename from common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/providers/blockentities/SkullHandler.java rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/providers/blockentities/SkullHandler.java index 34d63f247..85458e23c 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/providers/blockentities/SkullHandler.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/providers/blockentities/SkullHandler.java @@ -1,11 +1,11 @@ -package us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.providers.blockentities; +package us.myles.ViaVersion.protocols.protocol1_13to1_12_2.providers.blockentities; import com.github.steveice10.opennbt.tag.builtin.CompoundTag; import com.github.steveice10.opennbt.tag.builtin.Tag; import us.myles.ViaVersion.api.data.UserConnection; import us.myles.ViaVersion.api.minecraft.Position; -import us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.providers.BlockEntityProvider; -import us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.storage.BlockStorage; +import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.providers.BlockEntityProvider; +import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.storage.BlockStorage; public class SkullHandler implements BlockEntityProvider.BlockEntityHandler { private final int SKULL_WALL_START = 5447; diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/storage/BlockStorage.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/storage/BlockStorage.java similarity index 96% rename from common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/storage/BlockStorage.java rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/storage/BlockStorage.java index 3ccc8fd6c..421ca58e2 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/storage/BlockStorage.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/storage/BlockStorage.java @@ -1,4 +1,4 @@ -package us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.storage; +package us.myles.ViaVersion.protocols.protocol1_13to1_12_2.storage; import com.google.common.collect.Sets; import lombok.AllArgsConstructor; diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/storage/EntityTracker.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/storage/EntityTracker.java similarity index 93% rename from common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/storage/EntityTracker.java rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/storage/EntityTracker.java index e3aa2cd60..db7994407 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/storage/EntityTracker.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/storage/EntityTracker.java @@ -1,4 +1,4 @@ -package us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.storage; +package us.myles.ViaVersion.protocols.protocol1_13to1_12_2.storage; import com.google.common.base.Optional; import us.myles.ViaVersion.api.data.StoredObject; diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/storage/TabCompleteTracker.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/storage/TabCompleteTracker.java similarity index 89% rename from common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/storage/TabCompleteTracker.java rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/storage/TabCompleteTracker.java index 2699ef61f..4f5d4eaac 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/storage/TabCompleteTracker.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/storage/TabCompleteTracker.java @@ -1,4 +1,4 @@ -package us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.storage; +package us.myles.ViaVersion.protocols.protocol1_13to1_12_2.storage; import us.myles.ViaVersion.api.data.StoredObject; import us.myles.ViaVersion.api.data.UserConnection; diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/types/Chunk1_13Type.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/types/Chunk1_13Type.java similarity index 94% rename from common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/types/Chunk1_13Type.java rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/types/Chunk1_13Type.java index a07b475aa..47d3d3702 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/types/Chunk1_13Type.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/types/Chunk1_13Type.java @@ -1,4 +1,4 @@ -package us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.types; +package us.myles.ViaVersion.protocols.protocol1_13to1_12_2.types; import com.github.steveice10.opennbt.tag.builtin.CompoundTag; import io.netty.buffer.ByteBuf; @@ -11,8 +11,8 @@ import us.myles.ViaVersion.api.type.PartialType; import us.myles.ViaVersion.api.type.Type; import us.myles.ViaVersion.api.type.types.minecraft.BaseChunkType; import us.myles.ViaVersion.protocols.protocol1_9_3to1_9_1_2.storage.ClientWorld; -import us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.chunks.Chunk1_13; -import us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.chunks.ChunkSection1_13; +import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.chunks.Chunk1_13; +import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.chunks.ChunkSection1_13; import java.util.ArrayList; import java.util.Arrays; diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/types/Particle1_13Type.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/types/Particle1_13Type.java similarity index 92% rename from common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/types/Particle1_13Type.java rename to common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/types/Particle1_13Type.java index b472cd724..0002e4859 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/types/Particle1_13Type.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/types/Particle1_13Type.java @@ -1,8 +1,8 @@ -package us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.types; +package us.myles.ViaVersion.protocols.protocol1_13to1_12_2.types; import io.netty.buffer.ByteBuf; import us.myles.ViaVersion.api.type.Type; -import us.myles.ViaVersion.protocols.protocolsnapshotto1_12_2.data.Particle; +import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.data.Particle; // TODO make future proof public class Particle1_13Type extends Type { diff --git a/jar/pom.xml b/jar/pom.xml index 6d57b8b20..edda39cf8 100644 --- a/jar/pom.xml +++ b/jar/pom.xml @@ -5,7 +5,7 @@ viaversion-parent us.myles - 1.4.0-1.13-pre10 + 1.4.0-DEV 4.0.0 viaversion-jar diff --git a/pom.xml b/pom.xml index d6fc8f267..de7e9b13c 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ us.myles viaversion-parent - 1.4.0-1.13-pre10 + 1.4.0-DEV pom viaversion-parent diff --git a/sponge-legacy/pom.xml b/sponge-legacy/pom.xml index ab1ab0284..1107c7248 100644 --- a/sponge-legacy/pom.xml +++ b/sponge-legacy/pom.xml @@ -5,7 +5,7 @@ viaversion-parent us.myles - 1.4.0-1.13-pre10 + 1.4.0-DEV 4.0.0 diff --git a/sponge/pom.xml b/sponge/pom.xml index c9e2d0040..459095939 100644 --- a/sponge/pom.xml +++ b/sponge/pom.xml @@ -5,7 +5,7 @@ viaversion-parent us.myles - 1.4.0-1.13-pre10 + 1.4.0-DEV 4.0.0