From 0f2940f5ebbf96b2223f50a85b647e6d47b0be59 Mon Sep 17 00:00:00 2001 From: Benford Whitaker Date: Sun, 8 Sep 2019 23:19:49 -0400 Subject: [PATCH] Remove revertBlock recursive calls in EarthAbility and Collapse (#1023) ## Fixes * Fixes recursive calls to `EarthAbility#revertBlock(Block)` --- .../projectkorra/projectkorra/ability/EarthAbility.java | 8 ++++---- .../projectkorra/projectkorra/earthbending/Collapse.java | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/com/projectkorra/projectkorra/ability/EarthAbility.java b/src/com/projectkorra/projectkorra/ability/EarthAbility.java index 890102ae..200bc1c2 100644 --- a/src/com/projectkorra/projectkorra/ability/EarthAbility.java +++ b/src/com/projectkorra/projectkorra/ability/EarthAbility.java @@ -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); } diff --git a/src/com/projectkorra/projectkorra/earthbending/Collapse.java b/src/com/projectkorra/projectkorra/earthbending/Collapse.java index c4d518dd..1bcf02ac 100644 --- a/src/com/projectkorra/projectkorra/earthbending/Collapse.java +++ b/src/com/projectkorra/projectkorra/earthbending/Collapse.java @@ -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); } } }