From 54a3f8215f2acc62ec307f49247a9edfb957e573 Mon Sep 17 00:00:00 2001 From: Alastair Date: Wed, 2 Mar 2016 22:10:07 +0000 Subject: [PATCH] Possibly fixed more errors --- src/com/sekwah/advancedportals/PortalProtect.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/com/sekwah/advancedportals/PortalProtect.java b/src/com/sekwah/advancedportals/PortalProtect.java index b2213076..2d578d27 100644 --- a/src/com/sekwah/advancedportals/PortalProtect.java +++ b/src/com/sekwah/advancedportals/PortalProtect.java @@ -39,7 +39,11 @@ public class PortalProtect implements Listener { @SuppressWarnings("unused") @EventHandler(priority = EventPriority.HIGH) public void onBlockBreak(BlockBreakEvent event){ - + + if(!Portal.portalsActive){ + return; + } + if(!event.getPlayer().hasPermission("advancedportals.build")){ Block block = event.getBlock(); @@ -63,6 +67,10 @@ public class PortalProtect implements Listener { @SuppressWarnings("unused") @EventHandler(priority = EventPriority.HIGH) public void onBlockPlace(BlockPlaceEvent event){ + + if(!Portal.portalsActive){ + return; + } if(!event.getPlayer().hasPermission("advancedportals.build")){ Block block = event.getBlock(); @@ -86,6 +94,11 @@ public class PortalProtect implements Listener { @EventHandler(priority = EventPriority.HIGH) public void onExplosion(EntityExplodeEvent event){ + + if(!Portal.portalsActive){ + return; + } + List blockList = event.blockList(); for (int i = 0; i < blockList.size(); i++) { Block block = blockList.get(i);