From 4bac9dcd111aa3bc3e10d999f0e3e3d7475d6321 Mon Sep 17 00:00:00 2001 From: Steven Scott Date: Sun, 3 Feb 2013 21:12:25 -0800 Subject: [PATCH] Remove BlockPhysics, it was a waste of CPU --- src/net/TheDgtl/Stargate/Stargate.java | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/net/TheDgtl/Stargate/Stargate.java b/src/net/TheDgtl/Stargate/Stargate.java index 07ca274..9fe5571 100644 --- a/src/net/TheDgtl/Stargate/Stargate.java +++ b/src/net/TheDgtl/Stargate/Stargate.java @@ -1101,18 +1101,10 @@ public class Stargate extends JavaPlugin { portal.unregister(true); Stargate.sendMessage(player, Stargate.getString("destroyMsg"), false); } - - @EventHandler - public void onBlockPhysics(BlockPhysicsEvent event) { - Block block = event.getBlock(); - Portal portal = Portal.getByEntrance(block); - if (portal != null) event.setCancelled(true); - portal = Portal.getByControl(block); - if (portal != null) event.setCancelled(true); - } - + @EventHandler public void onBlockFromTo(BlockFromToEvent event) { + if (!Stargate.protectEntrance) return; Portal portal = Portal.getByEntrance(event.getBlock()); if (portal != null) {