mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-08-08 05:23:12 +00:00
[trunk] Prevent scam (air, zero items) signs and prevent stacks size lower than 1 with /give and /item
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1087 e251c2fe-e539-e718-e476-b85c1f46cddb
This commit is contained in:
parent
f1e44b1fda
commit
09006ced4f
3 changed files with 18 additions and 7 deletions
|
@ -31,11 +31,13 @@ public class Commanditem extends EssentialsCommand
|
|||
user.sendMessage(ChatColor.RED + "You are not allowed to spawn that item");
|
||||
return;
|
||||
}
|
||||
if (itemArgs.length > 1)
|
||||
if (itemArgs.length > 1) {
|
||||
stack.setDurability(Short.parseShort(itemArgs[1]));
|
||||
}
|
||||
|
||||
if (args.length > 1)
|
||||
if (args.length > 1 && Integer.parseInt(args[1]) > 0) {
|
||||
stack.setAmount(Integer.parseInt(args[1]));
|
||||
}
|
||||
|
||||
String itemName = stack.getType().name().toLowerCase().replace('_', ' ');
|
||||
user.charge(this);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue