From 88b9ae0ec4b74ad4e563983ddb954343b2260b9b Mon Sep 17 00:00:00 2001 From: jojo Date: Wed, 3 Feb 2021 11:12:27 +0100 Subject: [PATCH] Fix tnt spawning on redstone sources --- .../de/steamwar/bausystem/commands/CommandFreeze.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandFreeze.java b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandFreeze.java index c158459..8ab7445 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandFreeze.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandFreeze.java @@ -19,7 +19,9 @@ package de.steamwar.bausystem.commands; -import de.steamwar.bausystem.world.Region; +import de.steamwar.bausystem.BauSystem; +import org.bukkit.Bukkit; +import org.bukkit.Material; import org.bukkit.entity.EntityType; import org.bukkit.event.EventHandler; import org.bukkit.event.block.*; @@ -53,6 +55,11 @@ public class CommandFreeze extends ToggleCommand { @EventHandler public void onEntitySpawn(EntitySpawnEvent e) { e.setCancelled(true); + if (e.getEntityType() == EntityType.PRIMED_TNT) { + Bukkit.getScheduler().runTaskLater(BauSystem.getPlugin(), () -> { + e.getLocation().getBlock().setType(Material.TNT, false); + }, 1); + } } @EventHandler