adding
parent
05e0f30896
commit
f5dbf42d01
|
@ -13,7 +13,9 @@ import java.util.Random;
|
||||||
*/
|
*/
|
||||||
public class Mortar {
|
public class Mortar {
|
||||||
|
|
||||||
/**The block that represents this mortar.*/
|
/**
|
||||||
|
* The block that represents this mortar.
|
||||||
|
*/
|
||||||
private final Block block;
|
private final Block block;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -51,6 +53,11 @@ public class Mortar {
|
||||||
Nameable brewingStandMortar = (Nameable) mortar.getState();
|
Nameable brewingStandMortar = (Nameable) mortar.getState();
|
||||||
String mortarName = brewingStandMortar.getCustomName();
|
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)){
|
if(mortarName.equals(BASIC_MORTAR_NAME)){
|
||||||
failMultiplier = 25;
|
failMultiplier = 25;
|
||||||
jamChance = .4;
|
jamChance = .4;
|
||||||
|
|
|
@ -103,23 +103,21 @@ public class Shell {
|
||||||
for(int i = 0; i < shellStats.length(); i++){
|
for(int i = 0; i < shellStats.length(); i++){
|
||||||
if(shellStats.charAt(i) == ','){
|
if(shellStats.charAt(i) == ','){
|
||||||
commaCount++;
|
commaCount++;
|
||||||
switch(commaCount) {
|
if(commaCount == 1){ //Parsing explosive power
|
||||||
case 1: //Parsing explosive power
|
explosivePower = Float.parseFloat(shellStats.substring(0, i));
|
||||||
explosivePower = Float.parseFloat(shellStats.substring(0, i));
|
lastCommaIndex = i;
|
||||||
lastCommaIndex = i;
|
}
|
||||||
break;
|
else if(commaCount == 2){ //Parsing penetration value
|
||||||
case 2: //Parsing penetration value
|
penetration = Integer.parseInt(shellStats.substring(lastCommaIndex + 1, i));
|
||||||
penetration = Integer.parseInt(shellStats.substring(lastCommaIndex+1, i));
|
lastCommaIndex = i;
|
||||||
lastCommaIndex = i;
|
}
|
||||||
break;
|
else if(commaCount == 3){ //Parsing incendiary type
|
||||||
case 3: //Parsing incendiary type
|
incendiaryType = Boolean.parseBoolean(shellStats.substring(lastCommaIndex + 1, i));
|
||||||
incendiaryType = Boolean.parseBoolean(shellStats.substring(lastCommaIndex+1, i));
|
lastCommaIndex = i;
|
||||||
lastCommaIndex = i;
|
}
|
||||||
break;
|
else if(commaCount == 4){ //Parsing base velocity and fail chance
|
||||||
case 4: //Parsing base velocity and fail chance
|
baseVelocity = Double.parseDouble(shellStats.substring(lastCommaIndex + 1, i));
|
||||||
baseVelocity = Double.parseDouble(shellStats.substring(lastCommaIndex+1, i));
|
failChance = Double.parseDouble(shellStats.substring(i + 1));
|
||||||
failChance = Double.parseDouble(shellStats.substring(i+1));
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue