Removed check at tabcomplete because it errored once
This commit is contained in:
parent
ee1430036c
commit
e0459fa36f
2 changed files with 2 additions and 14 deletions
|
@ -1,8 +1,6 @@
|
||||||
package buttondevteam.chat.listener;
|
package buttondevteam.chat.listener;
|
||||||
|
|
||||||
import java.util.Timer;
|
import java.util.Timer;
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
@ -100,16 +98,7 @@ public class PlayerJoinLeaveListener implements Listener {
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerLeave(PlayerQuitEvent event) {
|
public void onPlayerLeave(PlayerQuitEvent event) {
|
||||||
String deletenick = null;
|
PlayerListener.nicknames.inverse().remove(event.getPlayer().getUniqueId());
|
||||||
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);
|
|
||||||
UnlolCommand.Lastlol.values().removeIf(lld -> lld.getLolowner().equals(event.getPlayer()));
|
UnlolCommand.Lastlol.values().removeIf(lld -> lld.getLolowner().equals(event.getPlayer()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -155,8 +155,7 @@ public class PlayerListener implements Listener {
|
||||||
public void onTabComplete(PlayerChatTabCompleteEvent e) {
|
public void onTabComplete(PlayerChatTabCompleteEvent e) {
|
||||||
String name = e.getLastToken();
|
String name = e.getLastToken();
|
||||||
for (Entry<String, UUID> nicknamekv : nicknames.entrySet()) {
|
for (Entry<String, UUID> nicknamekv : nicknames.entrySet()) {
|
||||||
if (nicknamekv.getKey().startsWith(name)
|
if (nicknamekv.getKey().startsWith(name))
|
||||||
&& !nicknamekv.getKey().equals(Bukkit.getPlayer(nicknamekv.getValue()).getName()))
|
|
||||||
e.getTabCompletions().add(nicknamekv.getKey());
|
e.getTabCompletions().add(nicknamekv.getKey());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue