Clear player potion effects on class reset

Ensure active potion effects are removed when resetting a player's class. This prevents lingering effects from other classes, maintaining consistent game behavior.
This commit is contained in:
Teriuihi 2025-02-08 23:11:41 +01:00
parent 55b88a950d
commit 4f8a7a0416

View File

@ -86,6 +86,7 @@ public abstract class GameClass {
player.setHealth(health);
//Always reset the player inventory since other classes might have had them get items
player.getInventory().clear();
player.clearActivePotionEffects();
player.getInventory().setContents(tools.toArray(ItemStack[]::new));
TeamColor color = teamPlayer.getTeam().getColor();