From 5776d56039c1a646d90e5ce807a22da048d48658 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Wed, 28 Dec 2022 21:16:22 +0100 Subject: [PATCH] Fix SpaceListener --- .../misslewars/listener/special/SpaceListener.java | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/de/steamwar/misslewars/listener/special/SpaceListener.java b/src/de/steamwar/misslewars/listener/special/SpaceListener.java index f146df4..f1a4b48 100644 --- a/src/de/steamwar/misslewars/listener/special/SpaceListener.java +++ b/src/de/steamwar/misslewars/listener/special/SpaceListener.java @@ -24,10 +24,9 @@ package de.steamwar.misslewars.listener.special; import de.steamwar.misslewars.Config; import de.steamwar.misslewars.FightState; import de.steamwar.misslewars.listener.BasicListener; -import org.bukkit.entity.Entity; -import org.bukkit.entity.TNTPrimed; +import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; -import org.bukkit.event.entity.ExplosionPrimeEvent; +import org.bukkit.event.entity.EntitySpawnEvent; import java.util.EnumSet; @@ -38,12 +37,9 @@ public class SpaceListener extends BasicListener { } @EventHandler - public void onExplosionPrime(ExplosionPrimeEvent event) { + public void onEntitySpawn(EntitySpawnEvent event) { if (!Config.Space) return; - Entity entity = event.getEntity(); - if (entity instanceof TNTPrimed) { - TNTPrimed tnt = (TNTPrimed) entity; - tnt.setGravity(false); - } + if (event.getEntity() instanceof Player) return; + event.getEntity().setGravity(false); } }