Changes to /sell /give and /item

Material.getMaxStackSize() will now be used in /give and /item
The config option default-stack-size has been removed
New config option oversized-stacksize and permission essentials.oversizedstacks
Fixes bug giving out too many items on /give and /item when a stacksize > 64 is given.
Fixes bug in /sell that ignores enchantments
/sell now uses Material.getMaxStackSize() for /sell egg 2s (will sell 32 instead of 128 now)
This commit is contained in:
snowleo 2011-11-28 19:55:51 +01:00
parent 0354b8d019
commit 9acc7db06f
8 changed files with 33 additions and 18 deletions

View file

@ -72,7 +72,11 @@ public class Commanditem extends EssentialsCommand
final String displayName = stack.getType().toString().toLowerCase(Locale.ENGLISH).replace('_', ' ');
user.sendMessage(_("itemSpawn", stack.getAmount(), displayName));
InventoryWorkaround.addItem(user.getInventory(), true, true, stack);
if (user.isAuthorized("essentials.oversizedstacks")) {
InventoryWorkaround.addItem(user.getInventory(), true, ess.getSettings().getOversizedStackSize(), stack);
} else {
InventoryWorkaround.addItem(user.getInventory(), true, stack);
}
user.updateInventory();
}
}