adding
parent
05e0f30896
commit
f5dbf42d01
|
@ -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;
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue