diff --git a/api/pom.xml b/api/pom.xml
index 1c2ea57..9356c3f 100644
--- a/api/pom.xml
+++ b/api/pom.xml
@@ -8,7 +8,7 @@
npclib
net.jitse
- 2.3-SNAPSHOT
+ 2.3.1-SNAPSHOT
npclib-api
diff --git a/nms/pom.xml b/nms/pom.xml
index e6f4064..f6cbfb0 100644
--- a/nms/pom.xml
+++ b/nms/pom.xml
@@ -8,13 +8,12 @@
net.jitse
npclib
- 2.3-SNAPSHOT
+ 2.3.1-SNAPSHOT
npclib-nms
- v1_8_R1
v1_8_R2
v1_8_R3
v1_9_R1
diff --git a/nms/v1_10_R1/pom.xml b/nms/v1_10_R1/pom.xml
index 397295a..cf49b60 100755
--- a/nms/v1_10_R1/pom.xml
+++ b/nms/v1_10_R1/pom.xml
@@ -8,7 +8,7 @@
net.jitse
npclib-nms
- 2.3-SNAPSHOT
+ 2.3.1-SNAPSHOT
npclib-nms-v1_10_R1
diff --git a/nms/v1_11_R1/pom.xml b/nms/v1_11_R1/pom.xml
index 1d94998..a52b5b2 100755
--- a/nms/v1_11_R1/pom.xml
+++ b/nms/v1_11_R1/pom.xml
@@ -8,7 +8,7 @@
net.jitse
npclib-nms
- 2.3-SNAPSHOT
+ 2.3.1-SNAPSHOT
npclib-nms-v1_11_R1
diff --git a/nms/v1_12_R1/pom.xml b/nms/v1_12_R1/pom.xml
index 9718c96..b394da5 100755
--- a/nms/v1_12_R1/pom.xml
+++ b/nms/v1_12_R1/pom.xml
@@ -8,7 +8,7 @@
net.jitse
npclib-nms
- 2.3-SNAPSHOT
+ 2.3.1-SNAPSHOT
npclib-nms-v1_12_R1
diff --git a/nms/v1_13_R1/pom.xml b/nms/v1_13_R1/pom.xml
index 0da3149..79a0cd2 100755
--- a/nms/v1_13_R1/pom.xml
+++ b/nms/v1_13_R1/pom.xml
@@ -8,7 +8,7 @@
net.jitse
npclib-nms
- 2.3-SNAPSHOT
+ 2.3.1-SNAPSHOT
npclib-nms-v1_13_R1
diff --git a/nms/v1_13_R2/pom.xml b/nms/v1_13_R2/pom.xml
index bafe109..54f9c72 100755
--- a/nms/v1_13_R2/pom.xml
+++ b/nms/v1_13_R2/pom.xml
@@ -8,7 +8,7 @@
net.jitse
npclib-nms
- 2.3-SNAPSHOT
+ 2.3.1-SNAPSHOT
npclib-nms-v1_13_R2
diff --git a/nms/v1_14_R1/pom.xml b/nms/v1_14_R1/pom.xml
index 7ba21bc..9806a83 100755
--- a/nms/v1_14_R1/pom.xml
+++ b/nms/v1_14_R1/pom.xml
@@ -8,7 +8,7 @@
net.jitse
npclib-nms
- 2.3-SNAPSHOT
+ 2.3.1-SNAPSHOT
npclib-nms-v1_14_R1
diff --git a/nms/v1_8_R1/pom.xml b/nms/v1_8_R1/pom.xml
deleted file mode 100755
index 15eb5ef..0000000
--- a/nms/v1_8_R1/pom.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
- 4.0.0
- jar
-
-
- net.jitse
- npclib-nms
- 2.3-SNAPSHOT
-
-
- npclib-nms-v1_8_R1
-
-
-
- org.spigotmc
- spigot
- 1.8-R0.1-SNAPSHOT
- provided
-
-
- com.google.code.gson
- gson
- 2.8.5
- compile
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-shade-plugin
- 3.2.1
-
-
- package
-
- shade
-
-
-
-
-
-
-
diff --git a/nms/v1_8_R1/src/main/java/net/jitse/npclib/nms/v1_8_R1/NPC_v1_8_R1.java b/nms/v1_8_R1/src/main/java/net/jitse/npclib/nms/v1_8_R1/NPC_v1_8_R1.java
deleted file mode 100755
index eb9698c..0000000
--- a/nms/v1_8_R1/src/main/java/net/jitse/npclib/nms/v1_8_R1/NPC_v1_8_R1.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright (c) 2018 Jitse Boonstra
- */
-
-package net.jitse.npclib.nms.v1_8_R1;
-
-import net.jitse.npclib.NPCLib;
-import net.jitse.npclib.api.state.NPCSlot;
-import net.jitse.npclib.hologram.Hologram;
-import net.jitse.npclib.internal.MinecraftVersion;
-import net.jitse.npclib.internal.NPCBase;
-import net.jitse.npclib.nms.v1_8_R1.packets.*;
-import net.minecraft.server.v1_8_R1.*;
-import org.bukkit.Bukkit;
-import org.bukkit.craftbukkit.v1_8_R1.entity.CraftPlayer;
-import org.bukkit.craftbukkit.v1_8_R1.inventory.CraftItemStack;
-import org.bukkit.entity.Player;
-import org.bukkit.inventory.ItemStack;
-
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.UUID;
-
-/**
- * @author Jitse Boonstra
- */
-public class NPC_v1_8_R1 extends NPCBase {
-
- private PacketPlayOutNamedEntitySpawn packetPlayOutNamedEntitySpawn;
- private PacketPlayOutScoreboardTeam packetPlayOutScoreboardTeamRegister;
- private PacketPlayOutPlayerInfo packetPlayOutPlayerInfoAdd, packetPlayOutPlayerInfoRemove;
- private PacketPlayOutEntityHeadRotation packetPlayOutEntityHeadRotation;
- private PacketPlayOutEntityDestroy packetPlayOutEntityDestroy;
- private Set hasTeamRegistered = new HashSet<>();
-
- public NPC_v1_8_R1(NPCLib instance, List lines) {
- super(instance, lines);
- }
-
- @Override
- public void createPackets() {
- this.hologram = new Hologram(MinecraftVersion.V1_8_R1, location.clone().add(0, 0.5, 0), text);
-
- PacketPlayOutPlayerInfoWrapper packetPlayOutPlayerInfoWrapper = new PacketPlayOutPlayerInfoWrapper();
-
- // Packets for spawning the NPC:
- this.packetPlayOutScoreboardTeamRegister = new PacketPlayOutScoreboardTeamWrapper()
- .createRegisterTeam(name); // First packet to send.
-
- this.packetPlayOutPlayerInfoAdd = packetPlayOutPlayerInfoWrapper
- .create(EnumPlayerInfoAction.ADD_PLAYER, gameProfile, name); // Second packet to send.
-
- this.packetPlayOutNamedEntitySpawn = new PacketPlayOutNamedEntitySpawnWrapper()
- .create(uuid, location, entityId); // Third packet to send.
-
- this.packetPlayOutEntityHeadRotation = new PacketPlayOutEntityHeadRotationWrapper()
- .create(location, entityId); // Fourth packet to send.
-
- this.packetPlayOutPlayerInfoRemove = packetPlayOutPlayerInfoWrapper
- .create(EnumPlayerInfoAction.REMOVE_PLAYER, gameProfile, name); // Fifth packet to send (delayed).
-
- // Packet for destroying the NPC:
- this.packetPlayOutEntityDestroy = new PacketPlayOutEntityDestroy(entityId); // First packet to send.
- }
-
- @Override
- public void onLogout(Player player) {
- super.onLogout(player);
- hasTeamRegistered.remove(player.getUniqueId());
- }
-
- @Override
- public void sendShowPackets(Player player) {
- PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().playerConnection;
-
- if (hasTeamRegistered.add(player.getUniqueId()))
- playerConnection.sendPacket(packetPlayOutScoreboardTeamRegister);
- playerConnection.sendPacket(packetPlayOutPlayerInfoAdd);
- playerConnection.sendPacket(packetPlayOutNamedEntitySpawn);
- playerConnection.sendPacket(packetPlayOutEntityHeadRotation);
-
- hologram.show(player);
-
- Bukkit.getScheduler().runTaskLater(instance.getPlugin(), () ->
- playerConnection.sendPacket(packetPlayOutPlayerInfoRemove), 50);
- }
-
- @Override
- public void sendHidePackets(Player player) {
- PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().playerConnection;
-
- playerConnection.sendPacket(packetPlayOutEntityDestroy);
- playerConnection.sendPacket(packetPlayOutPlayerInfoRemove);
-
- hologram.hide(player);
- }
-
- @Override
- public void sendMetadataPacket(Player player) {
- PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().playerConnection;
- PacketPlayOutEntityMetadata packet = new PacketPlayOutEntityMetadataWrapper().create(activeStates, entityId);
-
- playerConnection.sendPacket(packet);
- }
-
- @Override
- public void sendEquipmentPacket(Player player, NPCSlot slot, boolean auto) {
- PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().playerConnection;
-
- ItemStack item;
- switch (slot) {
- case HELMET:
- item = helmet;
- break;
- case CHESTPLATE:
- item = chestplate;
- break;
- case LEGGINGS:
- item = leggings;
- break;
- case BOOTS:
- item = boots;
- break;
- case MAINHAND:
- item = inHand;
- break;
- default:
- if (!auto) {
- throw new IllegalArgumentException(slot.toString() + " is not a supported slot for the version of your server");
- }
- return;
- }
-
- PacketPlayOutEntityEquipment packet = new PacketPlayOutEntityEquipment(entityId, slot.getSlot(), CraftItemStack.asNMSCopy(item));
- playerConnection.sendPacket(packet);
- }
-}
diff --git a/nms/v1_8_R1/src/main/java/net/jitse/npclib/nms/v1_8_R1/packets/PacketPlayOutEntityHeadRotationWrapper.java b/nms/v1_8_R1/src/main/java/net/jitse/npclib/nms/v1_8_R1/packets/PacketPlayOutEntityHeadRotationWrapper.java
deleted file mode 100755
index 4d6eb40..0000000
--- a/nms/v1_8_R1/src/main/java/net/jitse/npclib/nms/v1_8_R1/packets/PacketPlayOutEntityHeadRotationWrapper.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright (c) 2018 Jitse Boonstra
- */
-
-package net.jitse.npclib.nms.v1_8_R1.packets;
-
-import com.comphenix.tinyprotocol.Reflection;
-import net.minecraft.server.v1_8_R1.PacketPlayOutEntityHeadRotation;
-import org.bukkit.Location;
-
-/**
- * @author Jitse Boonstra
- */
-public class PacketPlayOutEntityHeadRotationWrapper {
-
- public PacketPlayOutEntityHeadRotation create(Location location, int entityId) {
- PacketPlayOutEntityHeadRotation packetPlayOutEntityHeadRotation = new PacketPlayOutEntityHeadRotation();
-
- Reflection.getField(packetPlayOutEntityHeadRotation.getClass(), "a", int.class).
- set(packetPlayOutEntityHeadRotation, entityId);
- Reflection.getField(packetPlayOutEntityHeadRotation.getClass(), "b", byte.class)
- .set(packetPlayOutEntityHeadRotation, (byte) ((int) location.getYaw() * 256.0F / 360.0F));
-
- return packetPlayOutEntityHeadRotation;
- }
-}
diff --git a/nms/v1_8_R1/src/main/java/net/jitse/npclib/nms/v1_8_R1/packets/PacketPlayOutEntityMetadataWrapper.java b/nms/v1_8_R1/src/main/java/net/jitse/npclib/nms/v1_8_R1/packets/PacketPlayOutEntityMetadataWrapper.java
deleted file mode 100644
index 82dc899..0000000
--- a/nms/v1_8_R1/src/main/java/net/jitse/npclib/nms/v1_8_R1/packets/PacketPlayOutEntityMetadataWrapper.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package net.jitse.npclib.nms.v1_8_R1.packets;
-
-import net.jitse.npclib.api.state.NPCState;
-import net.minecraft.server.v1_8_R1.DataWatcher;
-import net.minecraft.server.v1_8_R1.PacketPlayOutEntityMetadata;
-
-public class PacketPlayOutEntityMetadataWrapper {
-
- public PacketPlayOutEntityMetadata create(NPCState[] activateStates, int entityId) {
- DataWatcher dataWatcher = new DataWatcher(null);
- byte masked = NPCState.getMasked(activateStates);
- dataWatcher.a(0, masked);
-
- return new PacketPlayOutEntityMetadata(entityId, dataWatcher, true);
- }
-}
diff --git a/nms/v1_8_R1/src/main/java/net/jitse/npclib/nms/v1_8_R1/packets/PacketPlayOutNamedEntitySpawnWrapper.java b/nms/v1_8_R1/src/main/java/net/jitse/npclib/nms/v1_8_R1/packets/PacketPlayOutNamedEntitySpawnWrapper.java
deleted file mode 100755
index eac29db..0000000
--- a/nms/v1_8_R1/src/main/java/net/jitse/npclib/nms/v1_8_R1/packets/PacketPlayOutNamedEntitySpawnWrapper.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2018 Jitse Boonstra
- */
-
-package net.jitse.npclib.nms.v1_8_R1.packets;
-
-import com.comphenix.tinyprotocol.Reflection;
-import net.minecraft.server.v1_8_R1.DataWatcher;
-import net.minecraft.server.v1_8_R1.PacketPlayOutNamedEntitySpawn;
-import org.bukkit.Location;
-
-import java.util.UUID;
-
-/**
- * @author Jitse Boonstra
- */
-public class PacketPlayOutNamedEntitySpawnWrapper {
-
- public PacketPlayOutNamedEntitySpawn create(UUID uuid, Location location, int entityId) {
- PacketPlayOutNamedEntitySpawn packetPlayOutNamedEntitySpawn = new PacketPlayOutNamedEntitySpawn();
-
- Reflection.getField(packetPlayOutNamedEntitySpawn.getClass(), "a", int.class)
- .set(packetPlayOutNamedEntitySpawn, entityId);
- Reflection.getField(packetPlayOutNamedEntitySpawn.getClass(), "b", UUID.class)
- .set(packetPlayOutNamedEntitySpawn, uuid);
- Reflection.getField(packetPlayOutNamedEntitySpawn.getClass(), "c", int.class)
- .set(packetPlayOutNamedEntitySpawn, (int) Math.floor(location.getX() * 32.0D));
- Reflection.getField(packetPlayOutNamedEntitySpawn.getClass(), "d", int.class)
- .set(packetPlayOutNamedEntitySpawn, (int) Math.floor(location.getY() * 32.0D));
- Reflection.getField(packetPlayOutNamedEntitySpawn.getClass(), "e", int.class)
- .set(packetPlayOutNamedEntitySpawn, (int) Math.floor(location.getZ() * 32.0D));
- Reflection.getField(packetPlayOutNamedEntitySpawn.getClass(), "f", byte.class)
- .set(packetPlayOutNamedEntitySpawn, (byte) ((int) (location.getYaw() * 256.0F / 360.0F)));
- Reflection.getField(packetPlayOutNamedEntitySpawn.getClass(), "g", byte.class)
- .set(packetPlayOutNamedEntitySpawn, (byte) ((int) (location.getPitch() * 256.0F / 360.0F)));
-
- DataWatcher dataWatcher = new DataWatcher(null);
- dataWatcher.a(10, (byte) 127);
-
- Reflection.getField(packetPlayOutNamedEntitySpawn.getClass(), "i", DataWatcher.class)
- .set(packetPlayOutNamedEntitySpawn, dataWatcher);
-
- return packetPlayOutNamedEntitySpawn;
- }
-}
diff --git a/nms/v1_8_R1/src/main/java/net/jitse/npclib/nms/v1_8_R1/packets/PacketPlayOutPlayerInfoWrapper.java b/nms/v1_8_R1/src/main/java/net/jitse/npclib/nms/v1_8_R1/packets/PacketPlayOutPlayerInfoWrapper.java
deleted file mode 100755
index 283b46e..0000000
--- a/nms/v1_8_R1/src/main/java/net/jitse/npclib/nms/v1_8_R1/packets/PacketPlayOutPlayerInfoWrapper.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (c) 2018 Jitse Boonstra
- */
-
-package net.jitse.npclib.nms.v1_8_R1.packets;
-
-import com.comphenix.tinyprotocol.Reflection;
-import com.mojang.authlib.GameProfile;
-import net.minecraft.server.v1_8_R1.*;
-
-import java.util.List;
-
-/**
- * @author Jitse Boonstra
- */
-public class PacketPlayOutPlayerInfoWrapper {
-
- public PacketPlayOutPlayerInfo create(EnumPlayerInfoAction action, GameProfile gameProfile, String name) {
- PacketPlayOutPlayerInfo packetPlayOutPlayerInfo = new PacketPlayOutPlayerInfo();
- Reflection.getField(packetPlayOutPlayerInfo.getClass(), "a", EnumPlayerInfoAction.class)
- .set(packetPlayOutPlayerInfo, action);
-
- PlayerInfoData playerInfoData = new PlayerInfoData(packetPlayOutPlayerInfo, gameProfile,
- 1, EnumGamemode.NOT_SET, ChatSerializer.a(name));
-
- Reflection.FieldAccessor fieldAccessor = Reflection.getField(packetPlayOutPlayerInfo.getClass(),
- "b", List.class);
-
- List list = fieldAccessor.get(packetPlayOutPlayerInfo);
- list.add(playerInfoData);
- fieldAccessor.set(packetPlayOutPlayerInfo, list);
-
- return packetPlayOutPlayerInfo;
- }
-}
diff --git a/nms/v1_8_R1/src/main/java/net/jitse/npclib/nms/v1_8_R1/packets/PacketPlayOutScoreboardTeamWrapper.java b/nms/v1_8_R1/src/main/java/net/jitse/npclib/nms/v1_8_R1/packets/PacketPlayOutScoreboardTeamWrapper.java
deleted file mode 100755
index e682a39..0000000
--- a/nms/v1_8_R1/src/main/java/net/jitse/npclib/nms/v1_8_R1/packets/PacketPlayOutScoreboardTeamWrapper.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2018 Jitse Boonstra
- */
-
-package net.jitse.npclib.nms.v1_8_R1.packets;
-
-import com.comphenix.tinyprotocol.Reflection;
-import net.minecraft.server.v1_8_R1.PacketPlayOutScoreboardTeam;
-import org.bukkit.ChatColor;
-
-import java.util.Collection;
-
-/**
- * @author Jitse Boonstra
- */
-public class PacketPlayOutScoreboardTeamWrapper {
-
- public PacketPlayOutScoreboardTeam createRegisterTeam(String name) {
- PacketPlayOutScoreboardTeam packetPlayOutScoreboardTeam = new PacketPlayOutScoreboardTeam();
-
- Reflection.getField(packetPlayOutScoreboardTeam.getClass(), "h", int.class)
- .set(packetPlayOutScoreboardTeam, 0);
- Reflection.getField(packetPlayOutScoreboardTeam.getClass(), "b", String.class)
- .set(packetPlayOutScoreboardTeam, name);
- Reflection.getField(packetPlayOutScoreboardTeam.getClass(), "a", String.class)
- .set(packetPlayOutScoreboardTeam, name);
- Reflection.getField(packetPlayOutScoreboardTeam.getClass(), "e", String.class)
- .set(packetPlayOutScoreboardTeam, "never");
- Reflection.getField(packetPlayOutScoreboardTeam.getClass(), "i", int.class)
- .set(packetPlayOutScoreboardTeam, 1);
- // Could not get this working in the PacketPlayOutPlayerInfoWrapper class.
- Reflection.getField(packetPlayOutScoreboardTeam.getClass(), "c", String.class)
- .set(packetPlayOutScoreboardTeam, ChatColor.BLUE + "[NPC] ");
- Reflection.FieldAccessor collectionFieldAccessor = Reflection.getField(
- packetPlayOutScoreboardTeam.getClass(), "g", Collection.class);
- Collection collection = collectionFieldAccessor.get(packetPlayOutScoreboardTeam);
- collection.add(name);
- collectionFieldAccessor.set(packetPlayOutScoreboardTeam, collection);
-
- return packetPlayOutScoreboardTeam;
- }
-
- public PacketPlayOutScoreboardTeam createUnregisterTeam(String name) {
- PacketPlayOutScoreboardTeam packetPlayOutScoreboardTeam = new PacketPlayOutScoreboardTeam();
-
- Reflection.getField(packetPlayOutScoreboardTeam.getClass(), "h", int.class)
- .set(packetPlayOutScoreboardTeam, 1);
- Reflection.getField(packetPlayOutScoreboardTeam.getClass(), "a", String.class)
- .set(packetPlayOutScoreboardTeam, name);
-
- return packetPlayOutScoreboardTeam;
- }
-}
diff --git a/nms/v1_8_R2/pom.xml b/nms/v1_8_R2/pom.xml
index 925018e..b721abe 100755
--- a/nms/v1_8_R2/pom.xml
+++ b/nms/v1_8_R2/pom.xml
@@ -8,7 +8,7 @@
net.jitse
npclib-nms
- 2.3-SNAPSHOT
+ 2.3.1-SNAPSHOT
npclib-nms-v1_8_R2
diff --git a/nms/v1_8_R3/pom.xml b/nms/v1_8_R3/pom.xml
index 223d9fe..e6e84df 100755
--- a/nms/v1_8_R3/pom.xml
+++ b/nms/v1_8_R3/pom.xml
@@ -8,7 +8,7 @@
net.jitse
npclib-nms
- 2.3-SNAPSHOT
+ 2.3.1-SNAPSHOT
npclib-nms-v1_8_R3
diff --git a/nms/v1_9_R1/pom.xml b/nms/v1_9_R1/pom.xml
index 6dd7ddf..8847919 100755
--- a/nms/v1_9_R1/pom.xml
+++ b/nms/v1_9_R1/pom.xml
@@ -8,7 +8,7 @@
net.jitse
npclib-nms
- 2.3-SNAPSHOT
+ 2.3.1-SNAPSHOT
npclib-nms-v1_9_R1
diff --git a/nms/v1_9_R2/pom.xml b/nms/v1_9_R2/pom.xml
index 9c830e3..540cd98 100755
--- a/nms/v1_9_R2/pom.xml
+++ b/nms/v1_9_R2/pom.xml
@@ -8,7 +8,7 @@
net.jitse
npclib-nms
- 2.3-SNAPSHOT
+ 2.3.1-SNAPSHOT
npclib-nms-v1_9_R2
diff --git a/plugin/pom.xml b/plugin/pom.xml
index 3e2cbee..3464668 100644
--- a/plugin/pom.xml
+++ b/plugin/pom.xml
@@ -8,7 +8,7 @@
net.jitse
npclib
- 2.3-SNAPSHOT
+ 2.3.1-SNAPSHOT
npclib-plugin
@@ -26,12 +26,6 @@
${project.version}
compile
-
- net.jitse
- npclib-nms-v1_8_R1
- ${project.version}
- compile
-
net.jitse
npclib-nms-v1_8_R2
diff --git a/pom.xml b/pom.xml
index e864af6..5659538 100755
--- a/pom.xml
+++ b/pom.xml
@@ -7,7 +7,7 @@
net.jitse
npclib
- 2.3-SNAPSHOT
+ 2.3.1-SNAPSHOT
UTF-8