From 2677c4597642823c6fb26949384b9d449252ce31 Mon Sep 17 00:00:00 2001 From: Mason Adkins Date: Fri, 30 Aug 2013 16:31:11 -0400 Subject: [PATCH] Add dCuboid support to BlockListener --- .../listeners/core/BlockListenerInstance.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/aufdemrand/denizen/listeners/core/BlockListenerInstance.java b/src/main/java/net/aufdemrand/denizen/listeners/core/BlockListenerInstance.java index c2013f6f6a..f00f228c96 100644 --- a/src/main/java/net/aufdemrand/denizen/listeners/core/BlockListenerInstance.java +++ b/src/main/java/net/aufdemrand/denizen/listeners/core/BlockListenerInstance.java @@ -144,6 +144,10 @@ public void listenBreak(BlockBreakEvent event) { if (region != null) if (!WorldGuardUtilities.inRegion(player.getPlayerEntity().getLocation(), region)) return; + // Same with the CUBOID argument... + if (cuboid != null) + if (!cuboid.isInsideCuboid(player.getLocation())) return; + //Type BREAK if (type == BlockType.BREAK) { //If the block matches, count it!! @@ -168,6 +172,10 @@ public void listenCollect(PlayerPickupItemEvent event) { if (region != null) if (!WorldGuardUtilities.inRegion(player.getPlayerEntity().getLocation(), region)) return; + // Same with the CUBOID argument... + if (cuboid != null) + if (!cuboid.isInsideCuboid(player.getLocation())) return; + //Type COLLECT if (type == BlockType.COLLECT) { //If the block matches, count it!! @@ -195,6 +203,10 @@ public void listenBucket(PlayerBucketFillEvent event) { if (region != null) if (!WorldGuardUtilities.inRegion(player.getPlayerEntity().getLocation(), region)) return; + // Same with the CUBOID argument... + if (cuboid != null) + if (!cuboid.isInsideCuboid(player.getLocation())) return; + //Type COLLECT if (type == BlockType.COLLECT) { //If the block matches, count it!! @@ -217,7 +229,11 @@ public void listenPlace(BlockPlaceEvent event) { //Check if region is specified, and if so, is the player in it. if (region != null) if (!WorldGuardUtilities.inRegion(player.getPlayerEntity().getLocation(), region)) return; - + + // Same with the CUBOID argument... + if (cuboid != null) + if (!cuboid.isInsideCuboid(player.getLocation())) return; + //Type BUILD if (type == BlockType.BUILD) {