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:22:49 +01:00
Ursprung ca956564eb
Commit 00e1e929ee

Datei anzeigen

@ -25,6 +25,7 @@ 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.Player; 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.EntitySpawnEvent; import org.bukkit.event.entity.EntitySpawnEvent;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
@ -43,7 +44,9 @@ public class SpaceListener extends BasicListener {
if (event.getEntity() instanceof Player) return; if (event.getEntity() instanceof Player) return;
event.getEntity().setGravity(false); event.getEntity().setGravity(false);
Vector vector = event.getEntity().getVelocity(); Vector vector = event.getEntity().getVelocity();
if (event.getEntity() instanceof TNTPrimed) {
vector.setY(0); vector.setY(0);
}
event.getEntity().setVelocity(vector); event.getEntity().setVelocity(vector);
} }
} }