Remove unnecessary AtomicReference usage

This commit is contained in:
Alexander Meech 2018-01-07 05:41:35 -05:00
parent 57b49eab50
commit 4db3ab12f1

View File

@ -1,7 +1,5 @@
package mineplex.core.punish.Command; package mineplex.core.punish.Command;
import java.util.concurrent.atomic.AtomicReference;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -46,7 +44,7 @@ public class HistoryCommand extends CommandBase<Punish>
return; return;
} }
AtomicReference<String> playerName = new AtomicReference<>(args[0]); final String playerName = args[0];
Plugin.GetRepository().MatchPlayerName(matches -> Plugin.GetRepository().MatchPlayerName(matches ->
{ {
@ -54,7 +52,7 @@ public class HistoryCommand extends CommandBase<Punish>
for (String match : matches) for (String match : matches)
{ {
if (match.equalsIgnoreCase(playerName.get())) if (match.equalsIgnoreCase(playerName))
{ {
matchedExact = true; matchedExact = true;
} }
@ -62,7 +60,7 @@ public class HistoryCommand extends CommandBase<Punish>
if (matchedExact) if (matchedExact)
{ {
matches.removeIf(s -> !s.equalsIgnoreCase(playerName.get())); matches.removeIf(s -> !s.equalsIgnoreCase(playerName));
} }
UtilPlayer.searchOffline(matches, t -> UtilPlayer.searchOffline(matches, t ->
@ -75,9 +73,9 @@ public class HistoryCommand extends CommandBase<Punish>
Plugin.GetRepository().LoadPunishClient(t, clientToken -> Plugin.GetRepository().LoadPunishClient(t, clientToken ->
{ {
Plugin.LoadClient(clientToken); Plugin.LoadClient(clientToken);
_punishShop.openPageForPlayer(caller, new PunishHistoryPage(Plugin, _punishShop, caller, playerName.get(), false, null, null)); _punishShop.openPageForPlayer(caller, new PunishHistoryPage(Plugin, _punishShop, caller, playerName, false, null, null));
}); });
}, caller, playerName.get(), true); }, caller, playerName, true);
}, playerName.get()); }, playerName);
} }
} }