SteamWar/MissileWars
Archiviert
13
0

Fix SpaceListener
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
yoyosource 2022-12-28 21:40:43 +01:00
Ursprung 15c204fe68
Commit 7a0c763923

Datei anzeigen

@ -31,6 +31,7 @@ import org.bukkit.entity.TNTPrimed;
import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.EntitySpawnEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerRespawnEvent;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import org.bukkit.util.Vector;
@ -50,7 +51,19 @@ public class SpaceListener extends BasicListener {
Player player = event.getPlayer();
player.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, Integer.MAX_VALUE, 3));
player.addPotionEffect(new PotionEffect(PotionEffectType.SLOW_FALLING, Integer.MAX_VALUE, 3));
}, 1);
player.setHealthScale(0.25);
}, 5);
}
@EventHandler
public void onPlayerRespawn(PlayerRespawnEvent event) {
if (!Config.Space) return;
Bukkit.getScheduler().runTaskLater(MissileWars.getPlugin(), () -> {
Player player = event.getPlayer();
player.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, Integer.MAX_VALUE, 3));
player.addPotionEffect(new PotionEffect(PotionEffectType.SLOW_FALLING, Integer.MAX_VALUE, 3));
player.setHealthScale(0.25);
}, 5);
}
@EventHandler