From 8922e472bfc39a6158da958863b10479246f6db3 Mon Sep 17 00:00:00 2001 From: jojo Date: Thu, 4 Feb 2021 10:09:49 +0100 Subject: [PATCH] Fix Freeze in 1.12 --- .../steamwar/bausystem/commands/CommandFreeze.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandFreeze.java b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandFreeze.java index ad268b1..edd616f 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandFreeze.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandFreeze.java @@ -54,14 +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.getEntityType() == EntityType.PRIMED_TNT) { - Bukkit.getScheduler().runTaskLater(BauSystem.getPlugin(), () -> { - e.getLocation().getBlock().setType(Material.TNT, false); - }, 1L); - } + if (!Region.getRegion(e.getLocation()).isFreeze()) return; + e.setCancelled(true); + if (Core.getVersion() == 12 && e.getEntityType() == EntityType.PRIMED_TNT) { + Bukkit.getScheduler().runTaskLater(BauSystem.getPlugin(), () -> { + e.getLocation().getBlock().setType(Material.TNT, false); + }, 1L); } }