diff --git a/FightSystem_Main/src/de/steamwar/fightsystem/listener/Recording.java b/FightSystem_Main/src/de/steamwar/fightsystem/listener/Recording.java index bb08635..0460e50 100644 --- a/FightSystem_Main/src/de/steamwar/fightsystem/listener/Recording.java +++ b/FightSystem_Main/src/de/steamwar/fightsystem/listener/Recording.java @@ -25,6 +25,7 @@ import com.comphenix.protocol.events.PacketAdapter; import com.comphenix.protocol.events.PacketContainer; import com.comphenix.protocol.events.PacketEvent; import com.comphenix.protocol.wrappers.EnumWrappers; +import de.steamwar.core.Core; import de.steamwar.fightsystem.ArenaMode; import de.steamwar.fightsystem.FightSystem; import de.steamwar.fightsystem.fight.Fight; @@ -123,6 +124,22 @@ public class Recording implements Listener { GlobalRecorder.getInstance().entitySpeed(tnt); } }, 1, 1); + if(Core.getVersion() > 12){ + new StateDependentListener(ArenaMode.AntiReplay, FightState.All, new Listener() { + @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) + public void onBlockPhysics(BlockPhysicsEvent e){ + if(e.getBlock() == e.getSourceBlock() || e.getChangedType() == Material.AIR) + GlobalRecorder.getInstance().blockChange(e.getBlock()); + } + }); + }else{ + new StateDependentListener(ArenaMode.AntiReplay, FightState.All, new Listener() { + @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) + public void onBlockPhysics(BlockPhysicsEvent e){ + GlobalRecorder.getInstance().blockChange(e.getBlock()); + } + }); + } } @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) @@ -198,12 +215,6 @@ public class Recording implements Listener { GlobalRecorder.getInstance().tntSpawn(e.getEntity()); } - @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) - public void onBlockPhysics(BlockPhysicsEvent e){ - if(e.getBlock() == e.getSourceBlock() || e.getChangedType() == Material.AIR) - GlobalRecorder.getInstance().blockChange(e.getBlock()); - } - @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onExplosion(EntityExplodeEvent e){ if(e.getEntityType() != EntityType.PRIMED_TNT)