Skip to content

Commit

Permalink
Cleanup formatting of RegionProtectionListener.
Browse files Browse the repository at this point in the history
  • Loading branch information
sk89q committed Aug 19, 2014
1 parent 416006d commit 06df458
Showing 1 changed file with 12 additions and 5 deletions.
Expand Up @@ -113,10 +113,11 @@ public void onPlaceBlock(final PlaceBlockEvent event) {
public boolean apply(Location target) {
boolean canPlace;

// Flint and steel, fire charge
/* Flint and steel, fire charge, etc. */
if (type == Material.FIRE) {
canPlace = query.testBuild(target, associable, DefaultFlag.LIGHTER);

/* Everything else */
} else {
canPlace = query.testBuild(target, associable);
}
Expand Down Expand Up @@ -171,19 +172,19 @@ public void onUseBlock(final UseBlockEvent event) {
public boolean apply(Location target) {
boolean canUse;

// Inventory blocks (CHEST_ACCESS)
/* Inventory */
if (Materials.isInventoryBlock(type)) {
canUse = query.testBuild(target, associable, DefaultFlag.USE, DefaultFlag.CHEST_ACCESS);

// Beds (SLEEP)
/* Beds */
} else if (type == Material.BED) {
canUse = query.testBuild(target, associable, DefaultFlag.USE, DefaultFlag.SLEEP);

// TNT (TNT)
/* TNT */
} else if (type == Material.TNT) {
canUse = query.testBuild(target, associable, DefaultFlag.TNT);

// Everything else
/* Everything else */
} else {
canUse = query.testBuild(target, associable, DefaultFlag.USE);
}
Expand Down Expand Up @@ -211,8 +212,11 @@ public void onSpawnEntity(SpawnEntityEvent event) {

boolean canSpawn;

/* Vehicles */
if (Entities.isVehicle(type)) {
canSpawn = query.testBuild(target, associable, DefaultFlag.PLACE_VEHICLE);

/* Everything else */
} else {
canSpawn = query.testBuild(target, associable);
}
Expand All @@ -235,8 +239,11 @@ public void onDestroyEntity(DestroyEntityEvent event) {
RegionQuery query = getPlugin().getRegionContainer().createQuery();
boolean canDestroy;

/* Vehicles */
if (Entities.isVehicle(type)) {
canDestroy = query.testBuild(target, associable, DefaultFlag.DESTROY_VEHICLE);

/* Everything else */
} else {
canDestroy = query.testBuild(target, associable);
}
Expand Down

0 comments on commit 06df458

Please sign in to comment.