From 55ec5056e8f6592b8eb6c2682e2133f1308f14d9 Mon Sep 17 00:00:00 2001 From: Mark Vainomaa Date: Thu, 9 May 2019 03:05:15 +0300 Subject: [PATCH] Fix Enderman's get/setItemInMainHand calls They were using old pre-1.13 methods which were causing issues with getting correct block data to show up. As of 1.13, Material enum has all the block types and constructing WrappedBlockData via Material is the only correct way of doing this. --- .../disguise/disguisetypes/watchers/EndermanWatcher.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/EndermanWatcher.java b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/EndermanWatcher.java index 92a03adb..971e15aa 100644 --- a/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/EndermanWatcher.java +++ b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/EndermanWatcher.java @@ -20,10 +20,7 @@ public class EndermanWatcher extends InsentientWatcher { if (value.isPresent()) { WrappedBlockData pair = value.get(); - Material id = pair.getType(); - int data = pair.getData(); - - return new ItemStack(id, 1, (short) data); + return new ItemStack(pair.getType(), 1); } else { return null; } @@ -31,7 +28,7 @@ public class EndermanWatcher extends InsentientWatcher { @Override public void setItemInMainHand(ItemStack itemstack) { - setItemInMainHand(itemstack.getType(), itemstack.getDurability()); + setItemInMainHand(itemstack.getType()); } public void setItemInMainHand(Material type) { @@ -44,7 +41,7 @@ public class EndermanWatcher extends InsentientWatcher { if (type == null) optional = Optional.empty(); else - optional = Optional.of(WrappedBlockData.createData(type, data)); + optional = Optional.of(WrappedBlockData.createData(type)); setData(MetaIndex.ENDERMAN_ITEM, optional); }