From 5801eaaddd648c92caa767f35c1507f738abb65a Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 17 Dec 2016 07:22:56 -0500 Subject: [PATCH] Probably fixed Insurance IllegalArgumentException --- .../alipresents/components/insurance/Insurance.java | 10 +++++----- .../alipresents/components/insurance/getInsurance.java | 2 +- .../components/insurance/getInsuranceBlock.java | 4 ++-- .../components/insurance/getInsuranceIngot.java | 4 ++-- .../components/insurance/getInsuranceNugget.java | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/buttondevteam/alipresents/components/insurance/Insurance.java b/src/buttondevteam/alipresents/components/insurance/Insurance.java index 15a012a..86a1535 100644 --- a/src/buttondevteam/alipresents/components/insurance/Insurance.java +++ b/src/buttondevteam/alipresents/components/insurance/Insurance.java @@ -12,13 +12,13 @@ import buttondevteam.lib.DebugPotato; public abstract class Insurance { public static enum InsuranceType{ - Nugget, Ingot, Block + nugget, ingot, block }; public static ItemStack getInsurance(InsuranceType insuranceType){ ItemStack insuranceItem; List lore; switch(insuranceType){ - case Nugget: + case nugget: insuranceItem = new ItemStack(Material.GOLD_NUGGET); lore = Arrays.asList( "This insurance nugget will protect ", @@ -28,7 +28,7 @@ public abstract class Insurance { "one nugget." ); break; - case Ingot: + case ingot: insuranceItem = new ItemStack(Material.GOLD_INGOT); lore = Arrays.asList( "This insurance ingot will protect ", @@ -38,7 +38,7 @@ public abstract class Insurance { "row costing one ingot." ); break; - case Block: + case block: insuranceItem = new ItemStack(Material.GOLD_BLOCK); lore = Arrays.asList( "This insurance block will give your ", @@ -74,7 +74,7 @@ public abstract class Insurance { } public static boolean isInsuranceType(String string){ for (InsuranceType insuranceType : Insurance.InsuranceType.values()){ - if (string.equalsIgnoreCase(insuranceType.toString())){ + if (string.equals(insuranceType.toString())){ return true; } } diff --git a/src/buttondevteam/alipresents/components/insurance/getInsurance.java b/src/buttondevteam/alipresents/components/insurance/getInsurance.java index aba87bb..4ad5af7 100644 --- a/src/buttondevteam/alipresents/components/insurance/getInsurance.java +++ b/src/buttondevteam/alipresents/components/insurance/getInsurance.java @@ -8,7 +8,7 @@ import buttondevteam.alipresents.components.insurance.Insurance.InsuranceType; public class getInsurance extends ModCommand { private final int defaultAmount = 1; - private final InsuranceType defaultInsuranceType = InsuranceType.Block; + private final InsuranceType defaultInsuranceType = InsuranceType.block; @Override public boolean OnCommand(Player player, String alias, String[] args) { int amount = defaultAmount; diff --git a/src/buttondevteam/alipresents/components/insurance/getInsuranceBlock.java b/src/buttondevteam/alipresents/components/insurance/getInsuranceBlock.java index cfbc15d..b59f73a 100644 --- a/src/buttondevteam/alipresents/components/insurance/getInsuranceBlock.java +++ b/src/buttondevteam/alipresents/components/insurance/getInsuranceBlock.java @@ -11,9 +11,9 @@ public class getInsuranceBlock extends ModCommand { @Override public boolean OnCommand(Player player, String alias, String[] args) { if (args.length > 0 && StringUtils.isNumeric(args[0])){ - player.getInventory().addItem(Insurance.getInsurance(InsuranceType.Block, Integer.parseInt(args[0]))); + player.getInventory().addItem(Insurance.getInsurance(InsuranceType.block, Integer.parseInt(args[0]))); }else{ - player.getInventory().addItem(Insurance.getInsurance(InsuranceType.Block)); + player.getInventory().addItem(Insurance.getInsurance(InsuranceType.block)); } return true; } diff --git a/src/buttondevteam/alipresents/components/insurance/getInsuranceIngot.java b/src/buttondevteam/alipresents/components/insurance/getInsuranceIngot.java index bfd71dc..e3fdae6 100644 --- a/src/buttondevteam/alipresents/components/insurance/getInsuranceIngot.java +++ b/src/buttondevteam/alipresents/components/insurance/getInsuranceIngot.java @@ -11,9 +11,9 @@ public class getInsuranceIngot extends ModCommand { @Override public boolean OnCommand(Player player, String alias, String[] args) { if (args.length > 0 && StringUtils.isNumeric(args[0])){ - player.getInventory().addItem(Insurance.getInsurance(InsuranceType.Ingot, Integer.parseInt(args[0]))); + player.getInventory().addItem(Insurance.getInsurance(InsuranceType.ingot, Integer.parseInt(args[0]))); }else{ - player.getInventory().addItem(Insurance.getInsurance(InsuranceType.Ingot)); + player.getInventory().addItem(Insurance.getInsurance(InsuranceType.ingot)); } return true; } diff --git a/src/buttondevteam/alipresents/components/insurance/getInsuranceNugget.java b/src/buttondevteam/alipresents/components/insurance/getInsuranceNugget.java index 42e2c62..616ee78 100644 --- a/src/buttondevteam/alipresents/components/insurance/getInsuranceNugget.java +++ b/src/buttondevteam/alipresents/components/insurance/getInsuranceNugget.java @@ -11,9 +11,9 @@ public class getInsuranceNugget extends ModCommand { @Override public boolean OnCommand(Player player, String alias, String[] args) { if (args.length > 0 && StringUtils.isNumeric(args[0])){ - player.getInventory().addItem(Insurance.getInsurance(InsuranceType.Nugget, Integer.parseInt(args[0]))); + player.getInventory().addItem(Insurance.getInsurance(InsuranceType.nugget, Integer.parseInt(args[0]))); }else{ - player.getInventory().addItem(Insurance.getInsurance(InsuranceType.Nugget)); + player.getInventory().addItem(Insurance.getInsurance(InsuranceType.nugget)); } return true; }