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:33:42 +01:00
Ursprung 00e1e929ee
Commit 857e201ca8

Datei anzeigen

@ -28,6 +28,9 @@ import org.bukkit.entity.Player;
import org.bukkit.entity.TNTPrimed; import org.bukkit.entity.TNTPrimed;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.EntitySpawnEvent; import org.bukkit.event.entity.EntitySpawnEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
import java.util.EnumSet; import java.util.EnumSet;
@ -38,6 +41,14 @@ public class SpaceListener extends BasicListener {
super(EnumSet.allOf(FightState.class)); super(EnumSet.allOf(FightState.class));
} }
@EventHandler
public void onPlayerJoin(PlayerJoinEvent event) {
if (!Config.Space) return;
Player player = event.getPlayer();
player.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, Integer.MAX_VALUE, 2));
player.addPotionEffect(new PotionEffect(PotionEffectType.SLOW_FALLING, Integer.MAX_VALUE, 2));
}
@EventHandler @EventHandler
public void onEntitySpawn(EntitySpawnEvent event) { public void onEntitySpawn(EntitySpawnEvent event) {
if (!Config.Space) return; if (!Config.Space) return;