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:16:22 +01:00
Ursprung eed250ce95
Commit 5776d56039

Datei anzeigen

@ -24,10 +24,9 @@ package de.steamwar.misslewars.listener.special;
import de.steamwar.misslewars.Config; import de.steamwar.misslewars.Config;
import de.steamwar.misslewars.FightState; import de.steamwar.misslewars.FightState;
import de.steamwar.misslewars.listener.BasicListener; import de.steamwar.misslewars.listener.BasicListener;
import org.bukkit.entity.Entity; import org.bukkit.entity.Player;
import org.bukkit.entity.TNTPrimed;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.ExplosionPrimeEvent; import org.bukkit.event.entity.EntitySpawnEvent;
import java.util.EnumSet; import java.util.EnumSet;
@ -38,12 +37,9 @@ public class SpaceListener extends BasicListener {
} }
@EventHandler @EventHandler
public void onExplosionPrime(ExplosionPrimeEvent event) { public void onEntitySpawn(EntitySpawnEvent event) {
if (!Config.Space) return; if (!Config.Space) return;
Entity entity = event.getEntity(); if (event.getEntity() instanceof Player) return;
if (entity instanceof TNTPrimed) { event.getEntity().setGravity(false);
TNTPrimed tnt = (TNTPrimed) entity;
tnt.setGravity(false);
}
} }
} }