Make the constructor command for itemstack set the item, not the data

This commit is contained in:
Andrew 2013-11-08 04:40:12 +13:00
parent 9d06e1e55e
commit 7c1a946bd7

View File

@ -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,9 +126,14 @@ public abstract class BaseDisguiseCommand implements CommandExecutor {
}
}
// Construct the disguise
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
String[] newArgs = new String[args.length - toSkip];
for (int i = toSkip; i < args.length; i++) {