diff --git a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandFreeze.java b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandFreeze.java index 9c2ddac..4873c01 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandFreeze.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandFreeze.java @@ -19,11 +19,8 @@ package de.steamwar.bausystem.commands; -import de.steamwar.bausystem.BauSystem; import de.steamwar.bausystem.world.Region; -import org.bukkit.Bukkit; import org.bukkit.Material; -import org.bukkit.entity.EntityType; import org.bukkit.event.EventHandler; import org.bukkit.event.block.*; import org.bukkit.event.entity.EntityChangeBlockEvent; diff --git a/BauSystem_Main/src/de/steamwar/bausystem/world/RegionListener.java b/BauSystem_Main/src/de/steamwar/bausystem/world/RegionListener.java index 0719a4f..3019aad 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/world/RegionListener.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/world/RegionListener.java @@ -29,7 +29,7 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.block.BlockBreakEvent; -import org.bukkit.event.block.BlockPlaceEvent; +import org.bukkit.event.block.BlockCanBuildEvent; import org.bukkit.event.block.SignChangeEvent; import org.bukkit.event.player.PlayerCommandPreprocessEvent; @@ -59,13 +59,13 @@ public class RegionListener implements Listener { } @EventHandler(priority = EventPriority.LOWEST) - public void onBlockPlace(BlockPlaceEvent e) { + public void onBlockCanBuild(BlockCanBuildEvent e) { Player p = e.getPlayer(); try{ if (Welt.noPermission(p, Permission.build)){ p.sendMessage(BauSystem.PREFIX + "§cDu darfst hier keine Blöcke platzieren"); - e.setCancelled(true); + e.setBuildable(false); } }catch(NullPointerException ex){ //ignored, caused by worldedit brushes