diff --git a/pom.xml b/pom.xml
index f621e716..2bea537e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
4.0.0
LibsDisguises
LibsDisguises
- 9.2.4-SNAPSHOT
+ 9.3
src
diff --git a/src/me/libraryaddict/disguise/utilities/packetlisteners/PacketListenerInventory.java b/src/me/libraryaddict/disguise/utilities/packetlisteners/PacketListenerInventory.java
index d7a0a495..884b1d06 100644
--- a/src/me/libraryaddict/disguise/utilities/packetlisteners/PacketListenerInventory.java
+++ b/src/me/libraryaddict/disguise/utilities/packetlisteners/PacketListenerInventory.java
@@ -6,6 +6,7 @@ import java.util.List;
import org.bukkit.Bukkit;
import org.bukkit.Material;
+import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import com.comphenix.protocol.PacketType;
@@ -37,14 +38,16 @@ public class PacketListenerInventory extends PacketAdapter {
if (event.isCancelled())
return;
- if (event.getPlayer().getName().contains("UNKNOWN[")) // If the player is temporary
+ final Player player = event.getPlayer();
+
+ if (player.getName().contains("UNKNOWN[")) // If the player is temporary
return;
- if (event.getPlayer() instanceof com.comphenix.net.sf.cglib.proxy.Factory || event.getPlayer().getVehicle() != null) {
+ if (player instanceof com.comphenix.net.sf.cglib.proxy.Factory || player.getVehicle() != null) {
return;
}
- Disguise disguise = DisguiseAPI.getDisguise(event.getPlayer(), event.getPlayer());
+ Disguise disguise = DisguiseAPI.getDisguise(player, player);
// If player is disguised, views self disguises and has a inventory modifier
if (disguise != null && disguise.isSelfDisguiseVisible()
@@ -57,7 +60,7 @@ public class PacketListenerInventory extends PacketAdapter {
if (disguise.isHidingArmorFromSelf()) {
int armorSlot = Math.abs((slot - 5) - 3);
- org.bukkit.inventory.ItemStack item = event.getPlayer().getInventory().getArmorContents()[armorSlot];
+ org.bukkit.inventory.ItemStack item = player.getInventory().getArmorContents()[armorSlot];
if (item != null && item.getType() != Material.AIR) {
PacketContainer packet = new PacketContainer(Server.SET_SLOT);
@@ -69,7 +72,7 @@ public class PacketListenerInventory extends PacketAdapter {
mods.write(2, ReflectionManager.getNmsItem(new org.bukkit.inventory.ItemStack(Material.AIR)));
try {
- ProtocolLibrary.getProtocolManager().sendServerPacket(event.getPlayer(), packet, false);
+ ProtocolLibrary.getProtocolManager().sendServerPacket(player, packet, false);
}
catch (InvocationTargetException e) {
e.printStackTrace();
@@ -79,10 +82,10 @@ public class PacketListenerInventory extends PacketAdapter {
}
else if (slot >= 36 && slot <= 45) {
if (disguise.isHidingHeldItemFromSelf()) {
- int currentSlot = event.getPlayer().getInventory().getHeldItemSlot();
+ int currentSlot = player.getInventory().getHeldItemSlot();
if (slot + 36 == currentSlot || slot == 45) {
- org.bukkit.inventory.ItemStack item = event.getPlayer().getInventory().getItemInMainHand();
+ org.bukkit.inventory.ItemStack item = player.getInventory().getItemInMainHand();
if (item != null && item.getType() != Material.AIR) {
PacketContainer packet = new PacketContainer(Server.SET_SLOT);
@@ -93,7 +96,7 @@ public class PacketListenerInventory extends PacketAdapter {
mods.write(2, ReflectionManager.getNmsItem(new org.bukkit.inventory.ItemStack(Material.AIR)));
try {
- ProtocolLibrary.getProtocolManager().sendServerPacket(event.getPlayer(), packet, false);
+ ProtocolLibrary.getProtocolManager().sendServerPacket(player, packet, false);
}
catch (InvocationTargetException e) {
e.printStackTrace();
@@ -110,7 +113,7 @@ public class PacketListenerInventory extends PacketAdapter {
// 0 1 2 3 - 8
// If the packet is coming, then I need to replace the item they are switching to
// As for the old item, I need to restore it.
- org.bukkit.inventory.ItemStack currentlyHeld = event.getPlayer().getItemInHand();
+ org.bukkit.inventory.ItemStack currentlyHeld = player.getItemInHand();
// If his old weapon isn't air
if (currentlyHeld != null && currentlyHeld.getType() != Material.AIR) {
PacketContainer packet = new PacketContainer(Server.SET_SLOT);
@@ -118,18 +121,18 @@ public class PacketListenerInventory extends PacketAdapter {
StructureModifier