Skip to content

Commit

Permalink
Potentially fixes Ajneb97#9
Browse files Browse the repository at this point in the history
  • Loading branch information
alexsvorada committed Dec 12, 2024
1 parent bf29074 commit 64fd884
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/pb/ajneb97/managers/PartidaManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;

import org.bukkit.attribute.Attribute;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Firework;
Expand Down Expand Up @@ -69,7 +70,8 @@ public static void jugadorEntra(Partida partida,Player jugador,PaintballBattle p
jugador.setExp(0);
jugador.setLevel(0);
jugador.setFoodLevel(20);
jugador.setMaxHealth(20);
// Fix #9
jugador.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(20.0D);
jugador.setHealth(20);
jugador.setFlying(false);
jugador.setAllowFlight(false);
Expand Down Expand Up @@ -149,7 +151,8 @@ public static void jugadorSale(Partida partida,Player jugador,boolean finalizaPa
jugador.setLevel(levelGuardado);
jugador.setExp(xpGuardada);
jugador.setFoodLevel(hambreGuardada);
jugador.setMaxHealth(maxVidaGuardada);
// Fix #9
jugador.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(maxVidaGuardada);
jugador.setHealth(vidaGuardada);
for(PotionEffect p : jugador.getActivePotionEffects()) {
jugador.removePotionEffect(p.getType());
Expand Down

0 comments on commit 64fd884

Please sign in to comment.