Skip to content

Commit

Permalink
Add dCuboid support to BlockListener
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeebiss committed Aug 30, 2013
1 parent 2f9a43c commit 2677c45
Showing 1 changed file with 17 additions and 1 deletion.
Expand Up @@ -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!!
Expand All @@ -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!!
Expand Down Expand Up @@ -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!!
Expand All @@ -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) {

Expand Down

0 comments on commit 2677c45

Please sign in to comment.