Permalink
Browse files

Adding water protection in addition to lava for rails.

Conflicts:

	src/com/untamedears/citadel/listener/BlockListener.java
  • Loading branch information...
1 parent 39ec0da commit 65f749f67781f88c2f80fb1f7b763c1885c5a408 @remyroy remyroy committed with Sep 8, 2012
@@ -216,18 +216,16 @@ public void blockBurn(BlockBurnEvent bbe) {
@EventHandler(ignoreCancelled = true, priority = EventPriority.LOW)
public void blockPhysics(BlockPhysicsEvent bpe) {
Material changedType = bpe.getChangedType();
- if (Material.LAVA == changedType) {
+ if (Material.LAVA == changedType || Material.WATER == changedType) {
Block block = bpe.getBlock();
- // Protection for reinforced rails types from lava. Similar to water, transform surrounding blocks in cobblestone to stop the lava effect.
+ // Protection for reinforced rails types from lava and water. Similar to water/lava, transform surrounding blocks in cobblestone or obsidian to stop the lava/water effect.
if (Material.RAILS == block.getType() || Material.POWERED_RAIL == block.getType() || Material.DETECTOR_RAIL == block.getType()) {
boolean isReinforced = maybeReinforcementDamaged(block);
if (isReinforced) {
- for (BlockFace blockFace : new BlockFace[]{BlockFace.DOWN, BlockFace.UP, BlockFace.EAST, BlockFace.WEST, BlockFace.NORTH, BlockFace.SOUTH}) {
+ for (final BlockFace blockFace : new BlockFace[]{BlockFace.DOWN, BlockFace.UP, BlockFace.EAST, BlockFace.WEST, BlockFace.NORTH, BlockFace.SOUTH}) {
Block otherBlock = block.getRelative(blockFace);
- if (Material.LAVA == otherBlock.getType()) {
- otherBlock.setType(Material.COBBLESTONE);
- otherBlock.getWorld().playEffect(otherBlock.getLocation(), Effect.EXTINGUISH, 0);
- }
+ otherBlock.setType(Material.COBBLESTONE);
+ otherBlock.getWorld().playEffect(otherBlock.getLocation(), Effect.EXTINGUISH, 0);
}
}
}
@@ -96,7 +96,7 @@ public void bookshelf(PlayerInteractEvent pie) {
@EventHandler(ignoreCancelled = true, priority = EventPriority.LOW)
public void bucketEmpty(PlayerBucketEmptyEvent pbee) {
Material bucket = pbee.getBucket();
- if (Material.LAVA_BUCKET == bucket) {
+ if (Material.LAVA_BUCKET == bucket || Material.WATER_BUCKET == bucket) {
Block block = pbee.getBlockClicked();
BlockFace face = pbee.getBlockFace();
Block relativeBlock = block.getRelative(face);

0 comments on commit 65f749f

Please sign in to comment.