Improve code syntax, part 8

This commit is contained in:
PikaMug 2021-10-07 04:41:56 -04:00
parent 3c8aa5ee4c
commit a8d59e6c12
2 changed files with 16 additions and 16 deletions

View File

@ -300,7 +300,7 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt {
if (context.getSessionData(stagePrefix + CK.S_PASSWORD_PHRASES) == null) { if (context.getSessionData(stagePrefix + CK.S_PASSWORD_PHRASES) == null) {
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")"; return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
} else { } else {
StringBuilder text = new StringBuilder("\n"); final StringBuilder text = new StringBuilder("\n");
final LinkedList<String> passPhrases final LinkedList<String> passPhrases
= (LinkedList<String>) context.getSessionData(stagePrefix + CK.S_PASSWORD_PHRASES); = (LinkedList<String>) context.getSessionData(stagePrefix + CK.S_PASSWORD_PHRASES);
final LinkedList<String> passDisplays final LinkedList<String> passDisplays
@ -410,7 +410,7 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt {
final List<String> overrides final List<String> overrides
= (List<String>) context.getSessionData(stagePrefix + CK.S_OVERRIDE_DISPLAY); = (List<String>) context.getSessionData(stagePrefix + CK.S_OVERRIDE_DISPLAY);
if (overrides != null) { if (overrides != null) {
for (String override : overrides) { for (final String override : overrides) {
text.append(ChatColor.GRAY).append(" - ").append(ChatColor.AQUA).append(override) text.append(ChatColor.GRAY).append(" - ").append(ChatColor.AQUA).append(override)
.append("\n"); .append("\n");
} }
@ -780,9 +780,9 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt {
context.setSessionData(stagePrefix + CK.S_REACH_LOCATIONS_NAMES, null); context.setSessionData(stagePrefix + CK.S_REACH_LOCATIONS_NAMES, null);
return new ReachListPrompt(context); return new ReachListPrompt(context);
case 5: case 5:
int one; final int one;
int two; final int two;
int three; final int three;
final List<String> locations final List<String> locations
= (List<String>) context.getSessionData(stagePrefix + CK.S_REACH_LOCATIONS); = (List<String>) context.getSessionData(stagePrefix + CK.S_REACH_LOCATIONS);
final List<Integer> radius final List<Integer> radius
@ -851,7 +851,7 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt {
final Block block = plugin.getQuestFactory().getSelectedReachLocations().get(player.getUniqueId()); final Block block = plugin.getQuestFactory().getSelectedReachLocations().get(player.getUniqueId());
if (block != null) { if (block != null) {
final Location loc = block.getLocation(); final Location loc = block.getLocation();
LinkedList<String> locations; final LinkedList<String> locations;
if (context.getSessionData(stagePrefix + CK.S_REACH_LOCATIONS) != null) { if (context.getSessionData(stagePrefix + CK.S_REACH_LOCATIONS) != null) {
locations = (LinkedList<String>) context.getSessionData(stagePrefix + CK.S_REACH_LOCATIONS); locations = (LinkedList<String>) context.getSessionData(stagePrefix + CK.S_REACH_LOCATIONS);
} else { } else {
@ -1096,8 +1096,8 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt {
context.setSessionData(stagePrefix + CK.S_PASSWORD_PHRASES, null); context.setSessionData(stagePrefix + CK.S_PASSWORD_PHRASES, null);
return new PasswordListPrompt(context); return new PasswordListPrompt(context);
case 4: case 4:
int one; final int one;
int two; final int two;
final List<String> displays final List<String> displays
= (List<String>) context.getSessionData(stagePrefix + CK.S_PASSWORD_DISPLAYS); = (List<String>) context.getSessionData(stagePrefix + CK.S_PASSWORD_DISPLAYS);
final List<String> phrases = (List<String>) context.getSessionData(stagePrefix + CK.S_PASSWORD_PHRASES); final List<String> phrases = (List<String>) context.getSessionData(stagePrefix + CK.S_PASSWORD_PHRASES);
@ -1904,8 +1904,8 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt {
= new QuestsEditorPostOpenStringPromptEvent(context, this); = new QuestsEditorPostOpenStringPromptEvent(context, this);
context.getPlugin().getServer().getPluginManager().callEvent(event); context.getPlugin().getServer().getPluginManager().callEvent(event);
} }
StringBuilder text = new StringBuilder(ChatColor.AQUA + "- " + getTitle(context) + " -\n"); final StringBuilder text = new StringBuilder(ChatColor.AQUA + "- " + getTitle(context) + " -\n");
if (plugin.getLoadedActions().isEmpty()) { if (plugin.getLoadedActions().isEmpty()) {
text.append(ChatColor.RED).append("- ").append(Lang.get("none")); text.append(ChatColor.RED).append("- ").append(Lang.get("none"));
} else { } else {
@ -2047,8 +2047,8 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt {
= new QuestsEditorPostOpenStringPromptEvent(context, this); = new QuestsEditorPostOpenStringPromptEvent(context, this);
context.getPlugin().getServer().getPluginManager().callEvent(event); context.getPlugin().getServer().getPluginManager().callEvent(event);
} }
StringBuilder text = new StringBuilder(ChatColor.AQUA + "- " + getTitle(context) + " -\n"); final StringBuilder text = new StringBuilder(ChatColor.AQUA + "- " + getTitle(context) + " -\n");
if (plugin.getLoadedConditions().isEmpty()) { if (plugin.getLoadedConditions().isEmpty()) {
text.append(ChatColor.RED).append("- ").append(Lang.get("none")).append("\n"); text.append(ChatColor.RED).append("- ").append(Lang.get("none")).append("\n");
} else { } else {
@ -2129,7 +2129,7 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt {
context.getForWhom().sendRawMessage(ChatColor.GREEN + Lang.get("stageEditorDelayCleared")); context.getForWhom().sendRawMessage(ChatColor.GREEN + Lang.get("stageEditorDelayCleared"));
return new StageMainPrompt(stageNum, context); return new StageMainPrompt(stageNum, context);
} }
long stageDelay; final long stageDelay;
try { try {
final int i = Integer.parseInt(input); final int i = Integer.parseInt(input);
stageDelay = i * 1000L; stageDelay = i * 1000L;
@ -2539,7 +2539,7 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@Override @Override
public @NotNull String getPromptText(final ConversationContext context) { public @NotNull String getPromptText(final ConversationContext context) {
StringBuilder text = new StringBuilder(ChatColor.GOLD + "- "); final StringBuilder text = new StringBuilder(ChatColor.GOLD + "- ");
final LinkedList<String> list = (LinkedList<String>) context.getSessionData(stagePrefix final LinkedList<String> list = (LinkedList<String>) context.getSessionData(stagePrefix
+ CK.S_CUSTOM_OBJECTIVES); + CK.S_CUSTOM_OBJECTIVES);
final LinkedList<Entry<String, Object>> dataMapList final LinkedList<Entry<String, Object>> dataMapList
@ -2604,7 +2604,7 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt {
} }
final LinkedList<Entry<String, Object>> dataMapList = found.getData(); final LinkedList<Entry<String, Object>> dataMapList = found.getData();
int numInput; final int numInput;
try { try {
numInput = Integer.parseInt(input); numInput = Integer.parseInt(input);
} catch (final NumberFormatException nfe) { } catch (final NumberFormatException nfe) {

View File

@ -127,7 +127,7 @@ public class StageMenuPrompt extends QuestsEditorNumericPrompt {
int current = stageNum; int current = stageNum;
String pref = "stage" + current; String pref = "stage" + current;
String newPref; String newPref;
boolean last = stageNum == stages; final boolean last = stageNum == stages;
while (true) { while (true) {
if (!last) { if (!last) {
current++; current++;