Additional cleanup for #655

This commit is contained in:
BuildTools 2019-01-27 00:10:21 -05:00
parent 8784c8935b
commit bcd9306951

View File

@ -299,7 +299,7 @@ public class RewardsPrompt extends FixedSetPrompt {
itemRews.add((ItemStack) context.getSessionData("tempStack")); itemRews.add((ItemStack) context.getSessionData("tempStack"));
context.setSessionData(CK.REW_ITEMS, itemRews); context.setSessionData(CK.REW_ITEMS, itemRews);
} else { } else {
LinkedList<ItemStack> itemRews = new LinkedList<ItemStack>(); List<ItemStack> itemRews = new LinkedList<ItemStack>();
itemRews.add((ItemStack) context.getSessionData("tempStack")); itemRews.add((ItemStack) context.getSessionData("tempStack"));
context.setSessionData(CK.REW_ITEMS, itemRews); context.setSessionData(CK.REW_ITEMS, itemRews);
} }
@ -357,7 +357,7 @@ public class RewardsPrompt extends FixedSetPrompt {
public Prompt acceptInput(ConversationContext context, String input) { public Prompt acceptInput(ConversationContext context, String input) {
if (input.equalsIgnoreCase(Lang.get("cmdCancel")) == false && input.equalsIgnoreCase(Lang.get("cmdClear")) == false) { if (input.equalsIgnoreCase(Lang.get("cmdCancel")) == false && input.equalsIgnoreCase(Lang.get("cmdClear")) == false) {
String[] args = input.split(Lang.get("charSemi")); String[] args = input.split(Lang.get("charSemi"));
LinkedList<String> commands = new LinkedList<String>(); List<String> commands = new LinkedList<String>();
for (String s : args) { for (String s : args) {
if (s.startsWith("/")) { if (s.startsWith("/")) {
s = s.substring(1); s = s.substring(1);
@ -383,7 +383,7 @@ public class RewardsPrompt extends FixedSetPrompt {
public Prompt acceptInput(ConversationContext context, String input) { public Prompt acceptInput(ConversationContext context, String input) {
if (input.equalsIgnoreCase(Lang.get("cmdCancel")) == false && input.equalsIgnoreCase(Lang.get("cmdClear")) == false) { if (input.equalsIgnoreCase(Lang.get("cmdCancel")) == false && input.equalsIgnoreCase(Lang.get("cmdClear")) == false) {
String[] args = input.split(" "); String[] args = input.split(" ");
LinkedList<String> permissions = new LinkedList<String>(); List<String> permissions = new LinkedList<String>();
permissions.addAll(Arrays.asList(args)); permissions.addAll(Arrays.asList(args));
context.setSessionData(CK.REW_PERMISSION, permissions); context.setSessionData(CK.REW_PERMISSION, permissions);
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) { } else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
@ -498,7 +498,7 @@ public class RewardsPrompt extends FixedSetPrompt {
public Prompt acceptInput(ConversationContext context, String input) { public Prompt acceptInput(ConversationContext context, String input) {
if (input.equalsIgnoreCase(Lang.get("cmdCancel")) == false) { if (input.equalsIgnoreCase(Lang.get("cmdCancel")) == false) {
String[] args = input.split(" "); String[] args = input.split(" ");
LinkedList<String> skills = new LinkedList<String>(); List<String> skills = new LinkedList<String>();
for (String s : args) { for (String s : args) {
if (Quests.getMcMMOSkill(s) != null) { if (Quests.getMcMMOSkill(s) != null) {
if (skills.contains(s) == false) { if (skills.contains(s) == false) {
@ -531,7 +531,7 @@ public class RewardsPrompt extends FixedSetPrompt {
public Prompt acceptInput(ConversationContext context, String input) { public Prompt acceptInput(ConversationContext context, String input) {
if (input.equalsIgnoreCase(Lang.get("cmdCancel")) == false) { if (input.equalsIgnoreCase(Lang.get("cmdCancel")) == false) {
String[] args = input.split(" "); String[] args = input.split(" ");
LinkedList<Integer> amounts = new LinkedList<Integer>(); List<Integer> amounts = new LinkedList<Integer>();
for (String s : args) { for (String s : args) {
try { try {
amounts.add(Integer.parseInt(s)); amounts.add(Integer.parseInt(s));
@ -637,7 +637,7 @@ public class RewardsPrompt extends FixedSetPrompt {
@Override @Override
public String getPromptText(ConversationContext cc) { public String getPromptText(ConversationContext cc) {
String text = ChatColor.DARK_PURPLE + Lang.get("heroesClassesTitle") + "\n"; String text = ChatColor.DARK_PURPLE + Lang.get("heroesClassesTitle") + "\n";
LinkedList<String> list = new LinkedList<String>(); List<String> list = new LinkedList<String>();
for (HeroClass hc : plugin.getDependencies().getHeroes().getClassManager().getClasses()) { for (HeroClass hc : plugin.getDependencies().getHeroes().getClassManager().getClasses()) {
list.add(hc.getName()); list.add(hc.getName());
} }
@ -658,7 +658,7 @@ public class RewardsPrompt extends FixedSetPrompt {
public Prompt acceptInput(ConversationContext cc, String input) { public Prompt acceptInput(ConversationContext cc, String input) {
if (input.equalsIgnoreCase(Lang.get("cmdCancel")) == false) { if (input.equalsIgnoreCase(Lang.get("cmdCancel")) == false) {
String[] arr = input.split(" "); String[] arr = input.split(" ");
LinkedList<String> classes = new LinkedList<String>(); List<String> classes = new LinkedList<String>();
for (String s : arr) { for (String s : arr) {
HeroClass hc = plugin.getDependencies().getHeroes().getClassManager().getClass(s); HeroClass hc = plugin.getDependencies().getHeroes().getClassManager().getClass(s);
if (hc == null) { if (hc == null) {
@ -691,7 +691,7 @@ public class RewardsPrompt extends FixedSetPrompt {
public Prompt acceptInput(ConversationContext cc, String input) { public Prompt acceptInput(ConversationContext cc, String input) {
if (input.equalsIgnoreCase(Lang.get("cmdCancel")) == false) { if (input.equalsIgnoreCase(Lang.get("cmdCancel")) == false) {
String[] arr = input.split(" "); String[] arr = input.split(" ");
LinkedList<Double> amounts = new LinkedList<Double>(); List<Double> amounts = new LinkedList<Double>();
for (String s : arr) { for (String s : arr) {
try { try {
double d = Double.parseDouble(s); double d = Double.parseDouble(s);
@ -727,7 +727,7 @@ public class RewardsPrompt extends FixedSetPrompt {
public Prompt acceptInput(ConversationContext cc, String input) { public Prompt acceptInput(ConversationContext cc, String input) {
if (input.equalsIgnoreCase(Lang.get("cmdCancel")) == false && input.equalsIgnoreCase(Lang.get("cmdClear")) == false) { if (input.equalsIgnoreCase(Lang.get("cmdCancel")) == false && input.equalsIgnoreCase(Lang.get("cmdClear")) == false) {
String[] arr = input.split(" "); String[] arr = input.split(" ");
LinkedList<String> loots = new LinkedList<String>(); List<String> loots = new LinkedList<String>();
for (String s : arr) { for (String s : arr) {
if (PhatLootsAPI.getPhatLoot(s) == null) { if (PhatLootsAPI.getPhatLoot(s) == null) {
String text = Lang.get("rewPhatLootsInvalid"); String text = Lang.get("rewPhatLootsInvalid");