diff --git a/src/xyz/soper/arty/item/Mortar.java b/src/xyz/soper/arty/item/Mortar.java index c1e4d82..7c39932 100644 --- a/src/xyz/soper/arty/item/Mortar.java +++ b/src/xyz/soper/arty/item/Mortar.java @@ -13,7 +13,9 @@ import java.util.Random; */ public class Mortar { - /**The block that represents this mortar.*/ + /** + * The block that represents this mortar. + */ private final Block block; /** @@ -51,6 +53,11 @@ public class Mortar { Nameable brewingStandMortar = (Nameable) mortar.getState(); String mortarName = brewingStandMortar.getCustomName(); + if(block.hasMetadata("direction_x")){ +// float x = block.getMetadata("direction_x").; +// float TODO: figure out metadata + } + if(mortarName.equals(BASIC_MORTAR_NAME)){ failMultiplier = 25; jamChance = .4; diff --git a/src/xyz/soper/arty/item/Shell.java b/src/xyz/soper/arty/item/Shell.java index a888c2e..767cffa 100644 --- a/src/xyz/soper/arty/item/Shell.java +++ b/src/xyz/soper/arty/item/Shell.java @@ -103,23 +103,21 @@ public class Shell { for(int i = 0; i < shellStats.length(); i++){ if(shellStats.charAt(i) == ','){ commaCount++; - switch(commaCount) { - case 1: //Parsing explosive power - explosivePower = Float.parseFloat(shellStats.substring(0, i)); - lastCommaIndex = i; - break; - case 2: //Parsing penetration value - penetration = Integer.parseInt(shellStats.substring(lastCommaIndex+1, i)); - lastCommaIndex = i; - break; - case 3: //Parsing incendiary type - incendiaryType = Boolean.parseBoolean(shellStats.substring(lastCommaIndex+1, i)); - lastCommaIndex = i; - break; - case 4: //Parsing base velocity and fail chance - baseVelocity = Double.parseDouble(shellStats.substring(lastCommaIndex+1, i)); - failChance = Double.parseDouble(shellStats.substring(i+1)); - break; + if(commaCount == 1){ //Parsing explosive power + explosivePower = Float.parseFloat(shellStats.substring(0, i)); + lastCommaIndex = i; + } + else if(commaCount == 2){ //Parsing penetration value + penetration = Integer.parseInt(shellStats.substring(lastCommaIndex + 1, i)); + lastCommaIndex = i; + } + else if(commaCount == 3){ //Parsing incendiary type + incendiaryType = Boolean.parseBoolean(shellStats.substring(lastCommaIndex + 1, i)); + lastCommaIndex = i; + } + else if(commaCount == 4){ //Parsing base velocity and fail chance + baseVelocity = Double.parseDouble(shellStats.substring(lastCommaIndex + 1, i)); + failChance = Double.parseDouble(shellStats.substring(i + 1)); } } }