Remove revertBlock recursive calls in EarthAbility and Collapse (#1023)

## Fixes
* Fixes recursive calls to `EarthAbility#revertBlock(Block)`
This commit is contained in:
Benford Whitaker 2019-09-08 23:19:49 -04:00 committed by Christopher Martin
parent 861f0055d5
commit 0f2940f5eb
2 changed files with 5 additions and 5 deletions

View file

@ -604,10 +604,10 @@ public abstract class EarthAbility extends ElementalAbility {
if (block.equals(sourceblock)) {
info.getState().update(true, false);
if (RaiseEarth.blockInAllAffectedBlocks(sourceblock)) {
EarthAbility.revertBlock(sourceblock);
RaiseEarth.revertAffectedBlock(sourceblock);
}
if (RaiseEarth.blockInAllAffectedBlocks(block)) {
EarthAbility.revertBlock(block);
RaiseEarth.revertAffectedBlock(block);
}
MOVED_EARTH.remove(block);
return true;
@ -636,10 +636,10 @@ public abstract class EarthAbility extends ElementalAbility {
}
if (RaiseEarth.blockInAllAffectedBlocks(sourceblock)) {
EarthAbility.revertBlock(sourceblock);
RaiseEarth.revertAffectedBlock(sourceblock);
}
if (RaiseEarth.blockInAllAffectedBlocks(block)) {
EarthAbility.revertBlock(block);
RaiseEarth.revertAffectedBlock(block);
}
MOVED_EARTH.remove(block);
}

View file

@ -98,7 +98,7 @@ public class Collapse extends EarthAbility {
thisBlock = this.block.getWorld().getBlockAt(this.location.clone().add(this.direction.clone().multiply(-i)));
this.affectedBlocks.put(thisBlock, thisBlock);
if (RaiseEarth.blockInAllAffectedBlocks(thisBlock)) {
EarthAbility.revertBlock(thisBlock);
RaiseEarth.revertAffectedBlock(thisBlock);
}
}
}