Skip to content

Commit

Permalink
fixed #11
Browse files Browse the repository at this point in the history
  • Loading branch information
PMFRTT committed Apr 9, 2021
1 parent 2a238ca commit 5590e58
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/bingo/SideList.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Objects;


Expand Down Expand Up @@ -80,4 +79,9 @@ private static void startRender(Player player) {
DebugSender.sendDebug(DebugType.GUI, "rendered sidelist", "Sidelist");
}

public static void removePlayer(Player player){
playerScoreboards.remove(player.getDisplayName());
playerScoreboardsDisplay.remove(player.getDisplayName());
}

}
7 changes: 7 additions & 0 deletions src/main/java/bingo/eventhandler/BingoEventhandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.bukkit.event.inventory.*;
import org.bukkit.event.player.PlayerDropItemEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.inventory.ItemStack;

public class BingoEventhandler implements Listener {
Expand Down Expand Up @@ -85,4 +86,10 @@ public void onPlayerJoin(PlayerJoinEvent e) {
SideList.updateScoreboard();
}
}

@EventHandler
public void onPlayerDisconnect(PlayerQuitEvent e){
Player player = e.getPlayer();
SideList.removePlayer(player);
}
}

0 comments on commit 5590e58

Please sign in to comment.