From 180ab0f8a402110ef7620da3038c49fd1763eca7 Mon Sep 17 00:00:00 2001 From: jojo Date: Thu, 4 Feb 2021 10:00:44 +0100 Subject: [PATCH] Fix Freeze Exceptions --- .../steamwar/bausystem/commands/CommandFreeze.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandFreeze.java b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandFreeze.java index 5baa134..a366121 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandFreeze.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandFreeze.java @@ -54,6 +54,12 @@ public class CommandFreeze extends RegionToggleCommand { @EventHandler public void onEntitySpawn(EntitySpawnEvent e) { if (Region.getRegion(e.getLocation()).isFreeze()) e.setCancelled(true); + if (Core.getVersion() == 15) return; + if (e.isCancelled()) { + Bukkit.getScheduler().runTaskLater(BauSystem.getPlugin(), () -> { + e.getLocation().getBlock().setType(Material.TNT, false); + }, 1L); + } } @EventHandler @@ -70,12 +76,6 @@ public class CommandFreeze extends RegionToggleCommand { @EventHandler public void onEntityChangeBlock(EntityChangeBlockEvent e) { if (Region.getRegion(e.getBlock().getLocation()).isFreeze()) e.setCancelled(true); - if (Core.getVersion() == 15) return; - if (e.isCancelled()) { - Bukkit.getScheduler().runTaskLater(BauSystem.getPlugin(), () -> { - e.getBlock().setType(Material.TNT, false); - }, 1L); - } } @EventHandler