Merge pull request #185 from kingbirdy/bug-fix

Fix LavaFlow affecting plants
This commit is contained in:
MistPhizzle 2015-08-04 01:03:20 -04:00
commit 2740e22a20

View file

@ -331,9 +331,8 @@ public class LavaFlow {
} }
/** /**
* Creates a LavaBlock and also accounts for melting over plants by creating * Creates a LavaBlock and appends the TempBlock to our arraylist called
* new Plantbending() objects. It also appends the TempBlock to our * TEMP_LAVA_BLOCKS.
* arraylist called TEMP_LAVA_BLOCKS.
* *
* If ALLOW_NATURAL_FLOW is turned on then this method will remove the block * If ALLOW_NATURAL_FLOW is turned on then this method will remove the block
* from TempBlock.instances, which will allow the lava to flow naturally. * from TempBlock.instances, which will allow the lava to flow naturally.
@ -341,15 +340,7 @@ public class LavaFlow {
* @param block the block that will be turned to lava * @param block the block that will be turned to lava
*/ */
public void createLava(Block block) { public void createLava(Block block) {
boolean valid = false; if (isEarthbendableMaterial(block.getType(), player)) {
if (!isEarthbendableMaterial(block.getType(), player) && WaterMethods.isPlant(block)) {
new Plantbending(block);
block.setType(Material.AIR);
valid = true;
} else if (isEarthbendableMaterial(block.getType(), player))
valid = true;
if (valid) {
TempBlock tblock = new TempBlock(block, Material.STATIONARY_LAVA, (byte) 0); TempBlock tblock = new TempBlock(block, Material.STATIONARY_LAVA, (byte) 0);
TEMP_LAVA_BLOCKS.add(tblock); TEMP_LAVA_BLOCKS.add(tblock);
affectedBlocks.add(tblock); affectedBlocks.add(tblock);