Set final local variables for enclosing scope

This commit is contained in:
BuildTools 2018-12-04 15:19:18 -05:00
parent 39032c3af9
commit 5bd07bf78f

View File

@ -295,17 +295,17 @@ public class PlayerListener implements Listener {
@EventHandler @EventHandler
public void onPlayerChat(AsyncPlayerChatEvent evt) { public void onPlayerChat(AsyncPlayerChatEvent evt) {
if (plugin.checkQuester(evt.getPlayer().getUniqueId()) == false) { if (plugin.checkQuester(evt.getPlayer().getUniqueId()) == false) {
Quester quester = plugin.getQuester(evt.getPlayer().getUniqueId()); final Quester quester = plugin.getQuester(evt.getPlayer().getUniqueId());
if (quester.currentQuests.isEmpty() == false) { if (quester.currentQuests.isEmpty() == false) {
for (Quest quest : quester.currentQuests.keySet()) { for (final Quest quest : quester.currentQuests.keySet()) {
Stage currentStage = quester.getCurrentStage(quest); final Stage currentStage = quester.getCurrentStage(quest);
if (currentStage == null) { if (currentStage == null) {
plugin.getLogger().severe("currentStage was null for " + quester.id.toString() + " on chat"); plugin.getLogger().severe("currentStage was null for " + quester.id.toString() + " on chat");
continue; continue;
} }
if (currentStage.chatEvents.isEmpty() == false) { if (currentStage.chatEvents.isEmpty() == false) {
String chat = evt.getMessage(); String chat = evt.getMessage();
for (String s : currentStage.chatEvents.keySet()) { for (final String s : currentStage.chatEvents.keySet()) {
if (s.equalsIgnoreCase(chat)) { if (s.equalsIgnoreCase(chat)) {
if (quester.getQuestData(quest).eventFired.get(s) == null || quester.getQuestData(quest).eventFired.get(s) == false) { if (quester.getQuestData(quest).eventFired.get(s) == null || quester.getQuestData(quest).eventFired.get(s) == false) {
new BukkitRunnable() { new BukkitRunnable() {