Removed check at tabcomplete because it errored once

This commit is contained in:
Norbi Peti 2017-09-09 22:03:45 +02:00
parent ee1430036c
commit e0459fa36f
2 changed files with 2 additions and 14 deletions

View file

@ -1,8 +1,6 @@
package buttondevteam.chat.listener;
import java.util.Timer;
import java.util.UUID;
import org.bukkit.Bukkit;
import org.bukkit.GameMode;
import org.bukkit.entity.Player;
@ -100,16 +98,7 @@ public class PlayerJoinLeaveListener implements Listener {
@EventHandler
public void onPlayerLeave(PlayerQuitEvent event) {
String deletenick = null;
for (String nickname : PlayerListener.nicknames.keySet()) {
UUID uuid = PlayerListener.nicknames.get(nickname);
if (event.getPlayer().getUniqueId().equals(uuid)) {
deletenick = nickname;
break;
}
}
if (deletenick != null)
PlayerListener.nicknames.remove(deletenick);
PlayerListener.nicknames.inverse().remove(event.getPlayer().getUniqueId());
UnlolCommand.Lastlol.values().removeIf(lld -> lld.getLolowner().equals(event.getPlayer()));
}

View file

@ -155,8 +155,7 @@ public class PlayerListener implements Listener {
public void onTabComplete(PlayerChatTabCompleteEvent e) {
String name = e.getLastToken();
for (Entry<String, UUID> nicknamekv : nicknames.entrySet()) {
if (nicknamekv.getKey().startsWith(name)
&& !nicknamekv.getKey().equals(Bukkit.getPlayer(nicknamekv.getValue()).getName()))
if (nicknamekv.getKey().startsWith(name))
e.getTabCompletions().add(nicknamekv.getKey());
}
}