Added enchantment to /give and /item

Updated plugin.yml
This commit is contained in:
snowleo 2011-11-27 08:57:21 +01:00
parent b8f9a4b96f
commit 098072517a
5 changed files with 85 additions and 18 deletions

View file

@ -129,7 +129,7 @@ public class BukkitConstructor extends Constructor
for (int i = 2; i < split1.length; i++)
{
final String[] split3 = split1[0].split("[:+',;.]", 2);
if (split3.length != 2)
if (split3.length < 1)
{
continue;
}
@ -148,7 +148,7 @@ public class BukkitConstructor extends Constructor
continue;
}
int level = enchantment.getStartLevel();
if (NUMPATTERN.matcher(split3[1]).matches())
if (split3.length == 2 && NUMPATTERN.matcher(split3[1]).matches())
{
level = Integer.parseInt(split3[1]);
}