From 2c076b50da59dd14ff6920b959ca5ced6dda1dd6 Mon Sep 17 00:00:00 2001 From: Archie Date: Sun, 17 Jul 2016 20:23:12 +0100 Subject: [PATCH] EarthSmash & EarthBlast fixes (#516) * Adds slabs to default earth lists, stops slabs from changing to stone when fired * Fixes EarthSmash deleting sand / gravel blocks when riding EarthSmash into them --- .../projectkorra/configuration/ConfigManager.java | 1 + .../projectkorra/projectkorra/earthbending/EarthBlast.java | 6 +++++- .../projectkorra/projectkorra/earthbending/EarthSmash.java | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/com/projectkorra/projectkorra/configuration/ConfigManager.java b/src/com/projectkorra/projectkorra/configuration/ConfigManager.java index 72178091..8051f6d8 100644 --- a/src/com/projectkorra/projectkorra/configuration/ConfigManager.java +++ b/src/com/projectkorra/projectkorra/configuration/ConfigManager.java @@ -354,6 +354,7 @@ public class ConfigManager { earthBlocks.add("NETHERRACK"); earthBlocks.add("QUARTZ_ORE"); earthBlocks.add("COBBLESTONE"); + earthBlocks.add("STEP"); ArrayList metalBlocks = new ArrayList(); metalBlocks.add("IRON_BLOCK"); diff --git a/src/com/projectkorra/projectkorra/earthbending/EarthBlast.java b/src/com/projectkorra/projectkorra/earthbending/EarthBlast.java index 558dcabd..0dcdbe17 100644 --- a/src/com/projectkorra/projectkorra/earthbending/EarthBlast.java +++ b/src/com/projectkorra/projectkorra/earthbending/EarthBlast.java @@ -107,7 +107,11 @@ public class EarthBlast extends EarthAbility { sourceBlock.setType(Material.RED_SANDSTONE); } else { sourceBlock.setType(Material.SANDSTONE); - } + } + } if (sourceBlock.getType() == Material.STEP) { + sourceBlock.setType(Material.STEP); + sourceType = Material.STEP; + } else if (sourceBlock.getType() == Material.STONE) { sourceBlock.setType(Material.COBBLESTONE); sourceType = Material.STONE; diff --git a/src/com/projectkorra/projectkorra/earthbending/EarthSmash.java b/src/com/projectkorra/projectkorra/earthbending/EarthSmash.java index a96d3c78..ef0454c2 100644 --- a/src/com/projectkorra/projectkorra/earthbending/EarthSmash.java +++ b/src/com/projectkorra/projectkorra/earthbending/EarthSmash.java @@ -399,7 +399,7 @@ public class EarthSmash extends EarthAbility { for (BlockRepresenter blockRep : currentBlocks) { Block block = location.clone().add(blockRep.getX(), blockRep.getY(), blockRep.getZ()).getBlock(); if (block.getType().equals(Material.SAND) || block.getType().equals(Material.GRAVEL)) { //Check if block can be affected by gravity. - addTempAirBlock(block); //If so, set it to a temp air block. + } if (player != null && isTransparent(block)) { affectedBlocks.add(new TempBlock(block, blockRep.getType(), blockRep.getData()));