Skip to content

Commit

Permalink
fixed bug where forcestop command didnt work with offline players
Browse files Browse the repository at this point in the history
  • Loading branch information
TiagoFar78 committed Jul 21, 2024
1 parent aa116b7 commit bbf4bdf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/net/tiagofar78/prisonescape/game/PEGame.java
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ private void addPlayerToStartedGame(PEPlayer player, Kit kit, Location location,

public void removePlayerFromGame(PEPlayer player) {
player.removeScoreboard();
_bossBar.removePlayer(player.getBukkitPlayer());
player.removeBossBar(_bossBar);
teleportToLeavingLocation(player);
}

Expand Down
7 changes: 7 additions & 0 deletions src/main/java/net/tiagofar78/prisonescape/game/PEPlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,13 @@ public void setBossBar(BossBar bossBar) {
}
}

public void removeBossBar(BossBar bossBar) {
Player player = getBukkitPlayer();
if (player != null) {
bossBar.removePlayer(player);
}
}

public void setEffect(PotionEffectType effect, int seconds, int level) {
Player player = Bukkit.getPlayer(getName());
if (player == null || !player.isOnline()) {
Expand Down

0 comments on commit bbf4bdf

Please sign in to comment.