From 7c1a946bd7c05143c5b56f49511646a44817e168 Mon Sep 17 00:00:00 2001 From: Andrew Date: Fri, 8 Nov 2013 04:40:12 +1300 Subject: [PATCH] Make the constructor command for itemstack set the item, not the data --- src/me/libraryaddict/disguise/BaseDisguiseCommand.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/me/libraryaddict/disguise/BaseDisguiseCommand.java b/src/me/libraryaddict/disguise/BaseDisguiseCommand.java index 9c48a679..6423c6a7 100644 --- a/src/me/libraryaddict/disguise/BaseDisguiseCommand.java +++ b/src/me/libraryaddict/disguise/BaseDisguiseCommand.java @@ -10,6 +10,8 @@ import me.libraryaddict.disguise.disguisetypes.DisguiseType; import me.libraryaddict.disguise.disguisetypes.MiscDisguise; import me.libraryaddict.disguise.disguisetypes.MobDisguise; import me.libraryaddict.disguise.disguisetypes.PlayerDisguise; +import me.libraryaddict.disguise.disguisetypes.watchers.DroppedItemWatcher; + import org.bukkit.ChatColor; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; @@ -124,7 +126,12 @@ public abstract class BaseDisguiseCommand implements CommandExecutor { } } // Construct the disguise - disguise = new MiscDisguise(disguiseType, true, miscId, miscData); + if (disguiseType == DisguiseType.DROPPED_ITEM) { + disguise = new MiscDisguise(disguiseType, true); + ((DroppedItemWatcher) disguise.getWatcher()).setItemStack(new ItemStack(miscId, 1, (short) miscData)); + } else { + disguise = new MiscDisguise(disguiseType, true, miscId, miscData); + } } } // Copy strings to their new range