Fix banner parsing issue

This commit is contained in:
tastybento 2018-07-03 09:41:09 -07:00
parent 9f3e4e22dc
commit 4245ebaa33

View File

@ -132,11 +132,11 @@ public class ItemParser {
if (part.length == 2) {
return new ItemStack(Material.BANNER, Integer.parseInt(part[1]));
}
if (part.length > 3) {
if (part.length >= 3) {
int reqAmount = Integer.parseInt(part[1]);
@SuppressWarnings("deprecation")
ItemStack result = new ItemStack(Material.BANNER, reqAmount, (short) DyeColor.valueOf(part[2]).getDyeData());
ItemStack result = new ItemStack(Material.BANNER, reqAmount, DyeColor.valueOf(part[2]).getDyeData());
BannerMeta meta = (BannerMeta) result.getItemMeta();
for (int i = 3; i < part.length; i += 2) {