Possibly fixed more errors

This commit is contained in:
Alastair 2016-03-02 22:10:07 +00:00
parent 9adfc2e58b
commit 54a3f8215f
1 changed files with 14 additions and 1 deletions

View File

@ -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<Block> blockList = event.blockList();
for (int i = 0; i < blockList.size(); i++) {
Block block = blockList.get(i);