diff --git a/bukkit/pom.xml b/bukkit/pom.xml
index cfae64176..87cf8bd2e 100644
--- a/bukkit/pom.xml
+++ b/bukkit/pom.xml
@@ -5,7 +5,7 @@
viaversion-parent
us.myles
- 2.0.2-SNAPSHOT
+ 2.1.0
4.0.0
diff --git a/bukkit/src/main/java/us/myles/ViaVersion/bukkit/platform/BukkitViaLoader.java b/bukkit/src/main/java/us/myles/ViaVersion/bukkit/platform/BukkitViaLoader.java
index 14324fd02..ca5fc776f 100644
--- a/bukkit/src/main/java/us/myles/ViaVersion/bukkit/platform/BukkitViaLoader.java
+++ b/bukkit/src/main/java/us/myles/ViaVersion/bukkit/platform/BukkitViaLoader.java
@@ -30,6 +30,7 @@ import us.myles.ViaVersion.protocols.protocol1_9to1_8.providers.HandItemProvider
import us.myles.ViaVersion.protocols.protocol1_9to1_8.providers.MovementTransmitterProvider;
import java.util.HashSet;
+import java.util.Locale;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.Callable;
@@ -85,9 +86,9 @@ public class BukkitViaLoader implements ViaPlatformLoader {
}
}
- if ((Bukkit.getVersion().toLowerCase().contains("paper")
- || Bukkit.getVersion().toLowerCase().contains("taco")
- || Bukkit.getVersion().toLowerCase().contains("torch"))
+ if ((Bukkit.getVersion().toLowerCase(Locale.ROOT).contains("paper")
+ || Bukkit.getVersion().toLowerCase(Locale.ROOT).contains("taco")
+ || Bukkit.getVersion().toLowerCase(Locale.ROOT).contains("torch"))
&& ProtocolRegistry.SERVER_PROTOCOL < ProtocolVersion.v1_12.getId()) {
plugin.getLogger().info("Enabling Paper/TacoSpigot/Torch patch: Fixes block placement.");
storeListener(new PaperPatch(plugin)).register();
diff --git a/bungee/pom.xml b/bungee/pom.xml
index 5a9fdd1fd..c653889a0 100644
--- a/bungee/pom.xml
+++ b/bungee/pom.xml
@@ -5,7 +5,7 @@
viaversion-parent
us.myles
- 2.0.2-SNAPSHOT
+ 2.1.0
4.0.0
diff --git a/common/pom.xml b/common/pom.xml
index d55c461bf..2ec21e778 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -5,7 +5,7 @@
viaversion-parent
us.myles
- 2.0.2-SNAPSHOT
+ 2.1.0
4.0.0
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 c77885625..a56806bc3 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
@@ -15,6 +15,7 @@ import us.myles.ViaVersion.protocols.protocol1_12_2to1_12_1.Protocol1_12_2To1_12
import us.myles.ViaVersion.protocols.protocol1_12to1_11_1.Protocol1_12To1_11_1;
import us.myles.ViaVersion.protocols.protocol1_13_2to1_13_1.Protocol1_13_2To1_13_1;
import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.Protocol1_13To1_12_2;
+import us.myles.ViaVersion.protocols.protocol1_14_1to1_14.Protocol1_14_1To1_14;
import us.myles.ViaVersion.protocols.protocol1_14to1_13_2.Protocol1_14To1_13_2;
import us.myles.ViaVersion.protocols.protocol1_9_1_2to1_9_3_4.Protocol1_9_1_2To1_9_3_4;
import us.myles.ViaVersion.protocols.protocol1_9_1to1_9.Protocol1_9_1To1_9;
@@ -62,6 +63,7 @@ public class ProtocolRegistry {
registerProtocol(new Protocol1_13_2To1_13_1(), Arrays.asList(ProtocolVersion.v1_13_2.getId()), ProtocolVersion.v1_13_1.getId());
registerProtocol(new Protocol1_14To1_13_2(), Arrays.asList(ProtocolVersion.v1_14.getId()), ProtocolVersion.v1_13_2.getId());
+ registerProtocol(new Protocol1_14_1To1_14(), Arrays.asList(ProtocolVersion.v1_14_1.getId()), ProtocolVersion.v1_14.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 e43721e4b..67be0178d 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
@@ -36,6 +36,7 @@ public class ProtocolVersion {
public static final ProtocolVersion v1_13_1;
public static final ProtocolVersion v1_13_2;
public static final ProtocolVersion v1_14;
+ public static final ProtocolVersion v1_14_1;
public static final ProtocolVersion unknown;
private final int id;
@@ -68,6 +69,7 @@ public class ProtocolVersion {
register(v1_13_1 = new ProtocolVersion(401, "1.13.1"));
register(v1_13_2 = new ProtocolVersion(404, "1.13.2"));
register(v1_14 = new ProtocolVersion(477, "1.14"));
+ register(v1_14_1 = new ProtocolVersion(480, "1.14.1"));
register(unknown = new ProtocolVersion(-1, "UNKNOWN"));
}
diff --git a/common/src/main/java/us/myles/ViaVersion/commands/ViaCommandHandler.java b/common/src/main/java/us/myles/ViaVersion/commands/ViaCommandHandler.java
index 5610e2a50..a406835bb 100644
--- a/common/src/main/java/us/myles/ViaVersion/commands/ViaCommandHandler.java
+++ b/common/src/main/java/us/myles/ViaVersion/commands/ViaCommandHandler.java
@@ -28,17 +28,17 @@ public abstract class ViaCommandHandler implements ViaVersionCommand {
Preconditions.checkArgument(command.name().matches("^[a-z0-9_-]{3,15}$"), command.name() + " is not a valid sub-command name.");
if (hasSubCommand(command.name()))
throw new Exception("ViaSubCommand " + command.name() + " does already exists!"); //Maybe another exception later.
- commandMap.put(command.name().toLowerCase(), command);
+ commandMap.put(command.name().toLowerCase(Locale.ROOT), command);
}
@Override
public boolean hasSubCommand(String name) {
- return commandMap.containsKey(name.toLowerCase());
+ return commandMap.containsKey(name.toLowerCase(Locale.ROOT));
}
@Override
public ViaSubCommand getSubCommand(String name) {
- return commandMap.get(name.toLowerCase());
+ return commandMap.get(name.toLowerCase(Locale.ROOT));
}
@Override
@@ -76,7 +76,7 @@ public abstract class ViaCommandHandler implements ViaVersionCommand {
if (args.length == 1) {
if (!args[0].isEmpty()) {
for (ViaSubCommand sub : allowed)
- if (sub.name().toLowerCase().startsWith(args[0].toLowerCase()))
+ if (sub.name().toLowerCase().startsWith(args[0].toLowerCase(Locale.ROOT)))
output.add(sub.name());
} else {
for (ViaSubCommand sub : allowed)
diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/blockconnections/AbstractStempConnectionHandler.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/blockconnections/AbstractStempConnectionHandler.java
index b949f129d..344ec1b60 100644
--- a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/blockconnections/AbstractStempConnectionHandler.java
+++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/blockconnections/AbstractStempConnectionHandler.java
@@ -6,6 +6,7 @@ import us.myles.ViaVersion.api.minecraft.Position;
import java.util.HashMap;
import java.util.HashSet;
+import java.util.Locale;
import java.util.Map;
import java.util.Set;
@@ -33,7 +34,7 @@ public class AbstractStempConnectionHandler extends ConnectionHandler {
ConnectionData.connectionHandlerMap.put(blockData.getSavedBlockStateId(), handler);
}
if (blockData.getMinecraftKey().equals(toKey)) {
- String facing = blockData.getValue("facing").toUpperCase();
+ String facing = blockData.getValue("facing").toUpperCase(Locale.ROOT);
stemps.put(BlockFace.valueOf(facing), blockData.getSavedBlockStateId());
}
}
diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/blockconnections/ChestConnectionHandler.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/blockconnections/ChestConnectionHandler.java
index 2cab89b9d..397ec5e97 100644
--- a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/blockconnections/ChestConnectionHandler.java
+++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/blockconnections/ChestConnectionHandler.java
@@ -6,6 +6,7 @@ import us.myles.ViaVersion.api.minecraft.Position;
import java.util.HashMap;
import java.util.HashSet;
+import java.util.Locale;
import java.util.Map;
import java.util.Set;
@@ -19,10 +20,12 @@ class ChestConnectionHandler extends ConnectionHandler {
return new ConnectionData.ConnectorInitAction() {
@Override
public void check(WrappedBlockData blockData) {
- if (!blockData.getMinecraftKey().equals("minecraft:chest") && !blockData.getMinecraftKey().equals("minecraft:trapped_chest")) return;
+ if (!blockData.getMinecraftKey().equals("minecraft:chest") && !blockData.getMinecraftKey().equals("minecraft:trapped_chest"))
+ return;
if (blockData.getValue("waterlogged").equals("true")) return;
- chestFacings.put(blockData.getSavedBlockStateId(), BlockFace.valueOf(blockData.getValue("facing").toUpperCase()));
- if (blockData.getMinecraftKey().equalsIgnoreCase("minecraft:trapped_chest")) trappedChests.add(blockData.getSavedBlockStateId());
+ chestFacings.put(blockData.getSavedBlockStateId(), BlockFace.valueOf(blockData.getValue("facing").toUpperCase(Locale.ROOT)));
+ if (blockData.getMinecraftKey().equalsIgnoreCase("minecraft:trapped_chest"))
+ trappedChests.add(blockData.getSavedBlockStateId());
connectedStates.put(getStates(blockData), blockData.getSavedBlockStateId());
ConnectionData.connectionHandlerMap.put(blockData.getSavedBlockStateId(), connectionHandler);
}
@@ -34,7 +37,7 @@ class ChestConnectionHandler extends ConnectionHandler {
String type = blockData.getValue("type");
if (type.equals("left")) states |= 1;
if (type.equals("right")) states |= 2;
- states |= (BlockFace.valueOf(blockData.getValue("facing").toUpperCase()).ordinal() << 2);
+ states |= (BlockFace.valueOf(blockData.getValue("facing").toUpperCase(Locale.ROOT)).ordinal() << 2);
if (blockData.getMinecraftKey().equals("minecraft:trapped_chest")) states |= 16;
return states;
}
diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/blockconnections/ConnectionData.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/blockconnections/ConnectionData.java
index 574b071b6..8fc49d24f 100644
--- a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/blockconnections/ConnectionData.java
+++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/blockconnections/ConnectionData.java
@@ -217,7 +217,7 @@ public class ConnectionData {
JsonObject object = type.getValue().getAsJsonObject();
boolean[] data = new boolean[6];
for (BlockFace value : BlockFace.values()) {
- String face = value.toString().toLowerCase();
+ String face = value.toString().toLowerCase(Locale.ROOT);
if (object.has(face)) {
data[value.ordinal()] = object.getAsJsonPrimitive(face).getAsBoolean();
}
diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/blockconnections/DoorConnectionHandler.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/blockconnections/DoorConnectionHandler.java
index 655a008b7..a9675f2aa 100644
--- a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/blockconnections/DoorConnectionHandler.java
+++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/blockconnections/DoorConnectionHandler.java
@@ -10,6 +10,7 @@ import us.myles.ViaVersion.api.minecraft.Position;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
+import java.util.Locale;
import java.util.Map;
public class DoorConnectionHandler extends ConnectionHandler {
@@ -40,7 +41,7 @@ public class DoorConnectionHandler extends ConnectionHandler {
blockData.getValue("hinge").equals("right"),
blockData.getValue("powered").equals("true"),
blockData.getValue("open").equals("true"),
- BlockFace.valueOf(blockData.getValue("facing").toUpperCase()),
+ BlockFace.valueOf(blockData.getValue("facing").toUpperCase(Locale.ROOT)),
type
);
diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/blockconnections/StairConnectionHandler.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/blockconnections/StairConnectionHandler.java
index dbe832671..ec032a24b 100644
--- a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/blockconnections/StairConnectionHandler.java
+++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/blockconnections/StairConnectionHandler.java
@@ -10,6 +10,7 @@ import us.myles.ViaVersion.api.minecraft.Position;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
+import java.util.Locale;
import java.util.Map;
public class StairConnectionHandler extends ConnectionHandler {
@@ -58,7 +59,7 @@ public class StairConnectionHandler extends ConnectionHandler {
StairData stairData = new StairData(
blockData.getValue("half").equals("bottom"),
shape, (byte) type,
- BlockFace.valueOf(blockData.getValue("facing").toUpperCase())
+ BlockFace.valueOf(blockData.getValue("facing").toUpperCase(Locale.ROOT))
);
stairDataMap.put(blockData.getSavedBlockStateId(), stairData);
diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/blockconnections/TripwireConnectionHandler.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/blockconnections/TripwireConnectionHandler.java
index ac5cb83e3..ed0dd135e 100644
--- a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/blockconnections/TripwireConnectionHandler.java
+++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/blockconnections/TripwireConnectionHandler.java
@@ -8,6 +8,7 @@ import us.myles.ViaVersion.api.minecraft.BlockFace;
import us.myles.ViaVersion.api.minecraft.Position;
import java.util.HashMap;
+import java.util.Locale;
import java.util.Map;
public class TripwireConnectionHandler extends ConnectionHandler {
@@ -21,7 +22,7 @@ public class TripwireConnectionHandler extends ConnectionHandler {
@Override
public void check(WrappedBlockData blockData) {
if (blockData.getMinecraftKey().equals("minecraft:tripwire_hook")) {
- tripwireHooks.put(blockData.getSavedBlockStateId(), BlockFace.valueOf(blockData.getValue("facing").toUpperCase()));
+ tripwireHooks.put(blockData.getSavedBlockStateId(), BlockFace.valueOf(blockData.getValue("facing").toUpperCase(Locale.ROOT)));
} else if (blockData.getMinecraftKey().equals("minecraft:tripwire")) {
TripwireData tripwireData = new TripwireData(
blockData.getValue("attached").equals("true"),
diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/data/NamedSoundRewriter.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/data/NamedSoundRewriter.java
index 3c94345b9..64a75681a 100644
--- a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/data/NamedSoundRewriter.java
+++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/data/NamedSoundRewriter.java
@@ -1,6 +1,7 @@
package us.myles.ViaVersion.protocols.protocol1_13to1_12_2.data;
import java.util.HashMap;
+import java.util.Locale;
import java.util.Map;
public class NamedSoundRewriter {
@@ -148,6 +149,6 @@ public class NamedSoundRewriter {
public static String getNewId(String old) {
String newId = oldToNew.get(old);
- return newId != null ? newId : old.toLowerCase();
+ return newId != null ? newId : old.toLowerCase(Locale.ROOT);
}
}
diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/providers/PaintingProvider.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/providers/PaintingProvider.java
index 819aa808c..f6c190cca 100644
--- a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/providers/PaintingProvider.java
+++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/providers/PaintingProvider.java
@@ -3,6 +3,7 @@ package us.myles.ViaVersion.protocols.protocol1_13to1_12_2.providers;
import com.google.common.base.Optional;
import us.myles.ViaVersion.api.platform.providers.Provider;
+import java.util.Locale;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
@@ -45,7 +46,7 @@ public class PaintingProvider implements Provider {
public Optional getIntByIdentifier(String motive) {
// Handle older versions
if (!motive.startsWith("minecraft:"))
- motive = "minecraft:" + motive.toLowerCase();
+ motive = "minecraft:" + motive.toLowerCase(Locale.ROOT);
return Optional.fromNullable(paintings.get(motive));
}
}
\ No newline at end of file
diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/types/Chunk1_13Type.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/types/Chunk1_13Type.java
index 804d69531..672fd1a34 100644
--- a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/types/Chunk1_13Type.java
+++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/types/Chunk1_13Type.java
@@ -17,6 +17,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.BitSet;
import java.util.List;
+import java.util.logging.Level;
public class Chunk1_13Type extends PartialType {
public Chunk1_13Type(ClientWorld param) {
@@ -30,7 +31,7 @@ public class Chunk1_13Type extends PartialType {
boolean groundUp = input.readBoolean();
int primaryBitmask = Type.VAR_INT.read(input);
- Type.VAR_INT.read(input);
+ ByteBuf data = input.readSlice(Type.VAR_INT.read(input));
BitSet usedSections = new BitSet(16);
ChunkSection[] sections = new ChunkSection[16];
@@ -44,18 +45,22 @@ public class Chunk1_13Type extends PartialType {
// Read sections
for (int i = 0; i < 16; i++) {
if (!usedSections.get(i)) continue; // Section not set
- ChunkSection section = Types1_13.CHUNK_SECTION.read(input);
+ ChunkSection section = Types1_13.CHUNK_SECTION.read(data);
sections[i] = section;
- section.readBlockLight(input);
+ section.readBlockLight(data);
if (world.getEnvironment() == Environment.NORMAL) {
- section.readSkyLight(input);
+ section.readSkyLight(data);
}
}
int[] biomeData = groundUp ? new int[256] : null;
if (groundUp) {
- for (int i = 0; i < 256; i++) {
- biomeData[i] = input.readInt();
+ if (data.readableBytes() >= 256 * 4) {
+ for (int i = 0; i < 256; i++) {
+ biomeData[i] = data.readInt();
+ }
+ } else {
+ Via.getPlatform().getLogger().log(Level.WARNING, "Chunk x="+ chunkX + " z=" + chunkZ + " doesn't have biome data!");
}
}
diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14_1to1_14/Protocol1_14_1To1_14.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14_1to1_14/Protocol1_14_1To1_14.java
new file mode 100644
index 000000000..0758c64e1
--- /dev/null
+++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14_1to1_14/Protocol1_14_1To1_14.java
@@ -0,0 +1,22 @@
+package us.myles.ViaVersion.protocols.protocol1_14_1to1_14;
+
+import us.myles.ViaVersion.api.data.UserConnection;
+import us.myles.ViaVersion.api.protocol.Protocol;
+import us.myles.ViaVersion.protocols.protocol1_14_1to1_14.metadata.MetadataRewriter1_14_1To1_14;
+import us.myles.ViaVersion.protocols.protocol1_14_1to1_14.packets.EntityPackets;
+import us.myles.ViaVersion.protocols.protocol1_14_1to1_14.storage.EntityTracker1_14_1;
+
+public class Protocol1_14_1To1_14 extends Protocol {
+
+ @Override
+ protected void registerPackets() {
+ put(new MetadataRewriter1_14_1To1_14());
+
+ EntityPackets.register(this);
+ }
+
+ @Override
+ public void init(UserConnection userConnection) {
+ userConnection.put(new EntityTracker1_14_1(userConnection));
+ }
+}
diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14_1to1_14/metadata/MetadataRewriter1_14_1To1_14.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14_1to1_14/metadata/MetadataRewriter1_14_1To1_14.java
new file mode 100644
index 000000000..3fb76c9f2
--- /dev/null
+++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14_1to1_14/metadata/MetadataRewriter1_14_1To1_14.java
@@ -0,0 +1,22 @@
+package us.myles.ViaVersion.protocols.protocol1_14_1to1_14.metadata;
+
+import us.myles.ViaVersion.api.data.UserConnection;
+import us.myles.ViaVersion.api.entities.Entity1_14Types;
+import us.myles.ViaVersion.api.entities.Entity1_14Types.EntityType;
+import us.myles.ViaVersion.api.minecraft.metadata.Metadata;
+import us.myles.ViaVersion.api.rewriters.MetadataRewriter;
+
+import java.util.List;
+
+public class MetadataRewriter1_14_1To1_14 extends MetadataRewriter {
+
+ public void handleMetadata(int entityId, EntityType type, Metadata metadata, List metadatas, UserConnection connection) {
+ if (type == null) return;
+
+ if (type.is(EntityType.VILLAGER) || type.is(EntityType.WANDERING_TRADER)) {
+ if (metadata.getId() >= 15) {
+ metadata.setId(metadata.getId() + 1);
+ }
+ }
+ }
+}
diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14_1to1_14/packets/EntityPackets.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14_1to1_14/packets/EntityPackets.java
new file mode 100644
index 000000000..b19b2dcdc
--- /dev/null
+++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14_1to1_14/packets/EntityPackets.java
@@ -0,0 +1,101 @@
+package us.myles.ViaVersion.protocols.protocol1_14_1to1_14.packets;
+
+import com.google.common.base.Optional;
+import us.myles.ViaVersion.api.PacketWrapper;
+import us.myles.ViaVersion.api.entities.Entity1_14Types;
+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.type.Type;
+import us.myles.ViaVersion.api.type.types.version.Types1_14;
+import us.myles.ViaVersion.packets.State;
+import us.myles.ViaVersion.protocols.protocol1_14_1to1_14.metadata.MetadataRewriter1_14_1To1_14;
+import us.myles.ViaVersion.protocols.protocol1_14_1to1_14.storage.EntityTracker1_14_1;
+
+public class EntityPackets {
+
+ public static void register(Protocol protocol) {
+
+ // Spawn Mob
+ protocol.registerOutgoing(State.PLAY, 0x03, 0x03, new PacketRemapper() {
+ @Override
+ public void registerMap() {
+ map(Type.VAR_INT); // 0 - Entity ID
+ map(Type.UUID); // 1 - Entity UUID
+ map(Type.VAR_INT); // 2 - Entity Type
+ map(Type.DOUBLE); // 3 - X
+ map(Type.DOUBLE); // 4 - Y
+ map(Type.DOUBLE); // 5 - Z
+ map(Type.BYTE); // 6 - Yaw
+ map(Type.BYTE); // 7 - Pitch
+ map(Type.BYTE); // 8 - Head Pitch
+ map(Type.SHORT); // 9 - Velocity X
+ map(Type.SHORT); // 10 - Velocity Y
+ map(Type.SHORT); // 11 - Velocity Z
+ map(Types1_14.METADATA_LIST); // 12 - Metadata
+
+ handler(new PacketHandler() {
+ @Override
+ public void handle(PacketWrapper wrapper) throws Exception {
+ int entityId = wrapper.get(Type.VAR_INT, 0);
+ int type = wrapper.get(Type.VAR_INT, 1);
+
+ Entity1_14Types.EntityType entType = Entity1_14Types.getTypeFromId(type);
+
+ // Register Type ID
+ wrapper.user().get(EntityTracker1_14_1.class).addEntity(entityId, entType);
+
+ protocol.get(MetadataRewriter1_14_1To1_14.class).handleMetadata(entityId, entType, wrapper.get(Types1_14.METADATA_LIST, 0), wrapper.user());
+ }
+ });
+ }
+ });
+
+ // Spawn Player
+ protocol.registerOutgoing(State.PLAY, 0x05, 0x05, new PacketRemapper() {
+ @Override
+ public void registerMap() {
+ map(Type.VAR_INT); // 0 - Entity ID
+ map(Type.UUID); // 1 - Player UUID
+ map(Type.DOUBLE); // 2 - X
+ map(Type.DOUBLE); // 3 - Y
+ map(Type.DOUBLE); // 4 - Z
+ map(Type.BYTE); // 5 - Yaw
+ map(Type.BYTE); // 6 - Pitch
+ map(Types1_14.METADATA_LIST); // 7 - Metadata
+
+ handler(new PacketHandler() {
+ @Override
+ public void handle(PacketWrapper wrapper) throws Exception {
+ int entityId = wrapper.get(Type.VAR_INT, 0);
+
+ Entity1_14Types.EntityType entType = Entity1_14Types.EntityType.PLAYER;
+
+ // Register Type ID
+ wrapper.user().get(EntityTracker1_14_1.class).addEntity(entityId, entType);
+ protocol.get(MetadataRewriter1_14_1To1_14.class).handleMetadata(entityId, entType, wrapper.get(Types1_14.METADATA_LIST, 0), wrapper.user());
+ }
+ });
+ }
+ });
+
+ // Entity Metadata
+ protocol.registerOutgoing(State.PLAY, 0x43, 0x43, new PacketRemapper() {
+ @Override
+ public void registerMap() {
+ map(Type.VAR_INT); // 0 - Entity ID
+ map(Types1_14.METADATA_LIST); // 1 - Metadata list
+
+ handler(new PacketHandler() {
+ @Override
+ public void handle(PacketWrapper wrapper) throws Exception {
+ int entityId = wrapper.get(Type.VAR_INT, 0);
+
+ Optional type = wrapper.user().get(EntityTracker1_14_1.class).getEntity(entityId);
+ protocol.get(MetadataRewriter1_14_1To1_14.class).handleMetadata(entityId, type.orNull(), wrapper.get(Types1_14.METADATA_LIST, 0), wrapper.user());
+ }
+ });
+ }
+ });
+ }
+}
diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14_1to1_14/storage/EntityTracker1_14_1.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14_1to1_14/storage/EntityTracker1_14_1.java
new file mode 100644
index 000000000..bff461a03
--- /dev/null
+++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14_1to1_14/storage/EntityTracker1_14_1.java
@@ -0,0 +1,13 @@
+package us.myles.ViaVersion.protocols.protocol1_14_1to1_14.storage;
+
+import us.myles.ViaVersion.api.data.UserConnection;
+import us.myles.ViaVersion.api.entities.Entity1_14Types;
+import us.myles.ViaVersion.api.entities.Entity1_14Types.EntityType;
+import us.myles.ViaVersion.api.storage.EntityTracker;
+
+public class EntityTracker1_14_1 extends EntityTracker {
+
+ public EntityTracker1_14_1(UserConnection user) {
+ super(user, EntityType.PLAYER);
+ }
+}
diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/sounds/SoundEffect.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/sounds/SoundEffect.java
index e5688fcde..85dffc247 100644
--- a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/sounds/SoundEffect.java
+++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/sounds/SoundEffect.java
@@ -3,6 +3,7 @@ package us.myles.ViaVersion.protocols.protocol1_9to1_8.sounds;
import lombok.Getter;
import java.util.HashMap;
+import java.util.Locale;
import java.util.Map;
@Getter
@@ -284,7 +285,7 @@ public enum SoundEffect {
}
public static SoundEffect getByName(String name) {
- name = name.toLowerCase();
+ name = name.toLowerCase(Locale.ROOT);
return effects.get(name);
}
diff --git a/common/src/main/java/us/myles/ViaVersion/update/UpdateUtil.java b/common/src/main/java/us/myles/ViaVersion/update/UpdateUtil.java
index 1e88b4ce7..f5eb29076 100644
--- a/common/src/main/java/us/myles/ViaVersion/update/UpdateUtil.java
+++ b/common/src/main/java/us/myles/ViaVersion/update/UpdateUtil.java
@@ -12,6 +12,7 @@ import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
+import java.util.Locale;
import java.util.UUID;
public class UpdateUtil {
@@ -81,7 +82,7 @@ public class UpdateUtil {
if (current.compareTo(newest) < 0)
return "There is a newer version available: " + newest.toString() + ", you're on: " + current.toString();
else if (console && current.compareTo(newest) != 0) {
- if (current.getTag().toLowerCase().startsWith("dev") || current.getTag().toLowerCase().startsWith("snapshot")) {
+ if (current.getTag().toLowerCase(Locale.ROOT).startsWith("dev") || current.getTag().toLowerCase(Locale.ROOT).startsWith("snapshot")) {
return "You are running a development version, please report any bugs to GitHub.";
} else {
return "You are running a newer version than is released!";
diff --git a/jar/pom.xml b/jar/pom.xml
index b81450cc3..c2bd43181 100644
--- a/jar/pom.xml
+++ b/jar/pom.xml
@@ -5,7 +5,7 @@
viaversion-parent
us.myles
- 2.0.2-SNAPSHOT
+ 2.1.0
4.0.0
viaversion-jar
diff --git a/pom.xml b/pom.xml
index ee74971f7..3a7506244 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
us.myles
viaversion-parent
- 2.0.2-SNAPSHOT
+ 2.1.0
pom
viaversion-parent
diff --git a/sponge-legacy/pom.xml b/sponge-legacy/pom.xml
index d983cc973..b63fd662b 100644
--- a/sponge-legacy/pom.xml
+++ b/sponge-legacy/pom.xml
@@ -5,7 +5,7 @@
viaversion-parent
us.myles
- 2.0.2-SNAPSHOT
+ 2.1.0
4.0.0
diff --git a/sponge/pom.xml b/sponge/pom.xml
index aad9f0855..4a12c8421 100644
--- a/sponge/pom.xml
+++ b/sponge/pom.xml
@@ -5,7 +5,7 @@
viaversion-parent
us.myles
- 2.0.2-SNAPSHOT
+ 2.1.0
4.0.0
diff --git a/velocity/pom.xml b/velocity/pom.xml
index cade95e88..a7060246f 100644
--- a/velocity/pom.xml
+++ b/velocity/pom.xml
@@ -5,7 +5,7 @@
viaversion-parent
us.myles
- 2.0.2-SNAPSHOT
+ 2.1.0
4.0.0