null checks for tempblocks in surge remove water

This commit is contained in:
PhanaticD 2019-01-12 16:37:56 -05:00
parent 76c86bce37
commit aa6bf5a849

View file

@ -352,7 +352,9 @@ public class SurgeWall extends WaterAbility {
if (!GeneralMethods.isAdjacentToThreeOrMoreSources(block)) { if (!GeneralMethods.isAdjacentToThreeOrMoreSources(block)) {
if (this.oldTemps.containsKey(block)) { if (this.oldTemps.containsKey(block)) {
final TempBlock tb = TempBlock.get(block); final TempBlock tb = TempBlock.get(block);
if (tb != null) {
tb.setType(this.oldTemps.get(block)); tb.setType(this.oldTemps.get(block));
}
} else { } else {
TempBlock.revertBlock(block, Material.AIR); TempBlock.revertBlock(block, Material.AIR);
} }
@ -367,7 +369,9 @@ public class SurgeWall extends WaterAbility {
if (AFFECTED_BLOCKS.containsKey(block)) { if (AFFECTED_BLOCKS.containsKey(block)) {
if (this.oldTemps.containsKey(block)) { if (this.oldTemps.containsKey(block)) {
final TempBlock tb = TempBlock.get(block); final TempBlock tb = TempBlock.get(block);
if (tb != null) {
tb.setType(this.oldTemps.get(block)); tb.setType(this.oldTemps.get(block));
}
} else { } else {
TempBlock.revertBlock(block, Material.AIR); TempBlock.revertBlock(block, Material.AIR);
} }