mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-17 20:11:21 +02:00
Throw syntax error on /item, if syntax is wrong.
This commit is contained in:
@@ -36,7 +36,8 @@ public class Commanditem extends EssentialsCommand
|
||||
{
|
||||
throw new Exception(_("cantSpawnItem", itemname));
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if (args.length > 1 && Integer.parseInt(args[1]) > 0)
|
||||
{
|
||||
stack.setAmount(Integer.parseInt(args[1]));
|
||||
@@ -49,7 +50,6 @@ public class Commanditem extends EssentialsCommand
|
||||
{
|
||||
stack.setAmount(ess.getSettings().getOversizedStackSize());
|
||||
}
|
||||
|
||||
if (args.length > 2)
|
||||
{
|
||||
for (int i = 2; i < args.length; i++)
|
||||
@@ -72,6 +72,11 @@ public class Commanditem extends EssentialsCommand
|
||||
stack.addEnchantment(enchantment, level);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (NumberFormatException e)
|
||||
{
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
|
||||
if (stack.getType() == Material.AIR)
|
||||
{
|
||||
|
Reference in New Issue
Block a user