From d66c102c2ee1113d6f51a03e5444f7263ad34eb7 Mon Sep 17 00:00:00 2001 From: jojo Date: Tue, 26 Jan 2021 14:51:59 +0100 Subject: [PATCH] Fix CommandFreeze for entity spawning and redstone ore activation --- .../steamwar/bausystem/commands/CommandFreeze.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandFreeze.java b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandFreeze.java index 6443e32..c158459 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandFreeze.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandFreeze.java @@ -19,8 +19,12 @@ package de.steamwar.bausystem.commands; +import de.steamwar.bausystem.world.Region; +import org.bukkit.entity.EntityType; import org.bukkit.event.EventHandler; import org.bukkit.event.block.*; +import org.bukkit.event.entity.EntityChangeBlockEvent; +import org.bukkit.event.entity.EntitySpawnEvent; import org.bukkit.event.inventory.InventoryMoveItemEvent; public class CommandFreeze extends ToggleCommand { @@ -46,6 +50,16 @@ public class CommandFreeze extends ToggleCommand { return "§aWelt aufgetaut"; } + @EventHandler + public void onEntitySpawn(EntitySpawnEvent e) { + e.setCancelled(true); + } + + @EventHandler + public void onEntityChangeBlock(EntityChangeBlockEvent e) { + e.setCancelled(true); + } + @EventHandler public void onPhysicsEvent(BlockPhysicsEvent e){ e.setCancelled(true);