else if(split[0].equals("MaxNegativeThrottle"))
maxNegativeThrottle = Float.parseFloat(split[1]);
else if(split[0].equals("Drag"))
drag = Float.parseFloat(split[1]);
else if(split[0].equals("TurretOrigin"))
turretOrigin = new Vector3f(Float.parseFloat(split[1]) / 16F, Float.parseFloat(split[2]) / 16F, Float.parseFloat(split[3]) / 16F);
else if(split[0].equals("CollisionPoint") || split[0].equals("AddCollisionPoint"))
collisionPoints.add(new DriveablePosition(split));
//Boats
else if(split[0].equals("PlaceableOnLand"))
placeableOnLand = Boolean.parseBoolean(split[1]);
else if(split[0].equals("PlaceableOnWater"))
placeableOnWater = Boolean.parseBoolean(split[1]);
else if(split[0].equals("FloatOnWater"))
floatOnWater = Boolean.parseBoolean(split[1]);
else if(split[0].equals("Boat"))
{
placeableOnLand = false;
placeableOnWater = true;
floatOnWater = true;
wheelStepHeight = 0F;
}
else if(split[0].equals("Buoyancy"))
buoyancy = Float.parseFloat(split[1]);
//Wheels
else if(split[0].equals("Wheel") || split[0].equals("WheelPosition"))
{
wheelPositions[Integer.parseInt(split[1])] = new DriveablePosition(new Vector3f(Float.parseFloat(split[2]) / 16F, Float.parseFloat(split[3]) / 16F, Float.parseFloat(split[4]) / 16F), split.length > 5 ? EnumDriveablePart.getPart(split[5]) : EnumDriveablePart.coreWheel);
}
else if(split[0].equals("WheelRadius") || split[0].equals("WheelStepHeight"))
wheelStepHeight = Float.parseFloat(split[1]);
else if(split[0].equals("WheelSpringStrength") || split[0].equals("SpringStrength"))
wheelSpringStrength = Float.parseFloat(split[1]);
//Cargo / Payload
else if(split[0].equals("CargoSlots"))
numCargoSlots = Integer.parseInt(split[1]);
else if(split[0].equals("BombSlots") || split[0].equals("MineSlots"))
numBombSlots = Integer.parseInt(split[1]);
else if(split[0].equals("MissileSlots") || split[0].equals("ShellSlots"))
numMissileSlots = Integer.parseInt(split[1]);
else if(split[0].equals("FuelTankSize"))
fuelTankSize = Integer.parseInt(split[1]);
else if(split[0].equals("BulletDetection"))
bulletDetectionRadius = Integer.parseInt(split[1]);
//Ammo limiters
else if(split[0].equals("AddAmmo"))
ammo.add(BulletType.getBullet(split[1]));
else if(split[0].equals("AllowAllAmmo") || split[0].equals("AcceptAllAmmo"))
acceptAllAmmo = Boolean.parseBoolean(split[1]);
//Weaponry
else if(split[0].equals("Primary"))
primary = EnumWeaponType.valueOf(split[1].toUpperCase());
else if(split[0].equals("Secondary"))
secondary = EnumWeaponType.valueOf(split[1].toUpperCase());
else if(split[0].equals("ShootDelayPrimary"))
shootDelayPrimary = Integer.parseInt(split[1]);
else if(split[0].equals("ShootDelaySecondary"))
shootDelaySecondary = Integer.parseInt(split[1]);
else if(split[0].equals("AlternatePrimary"))
alternatePrimary = Boolean.parseBoolean(split[1]);
else if(split[0].equals("AlternateSecondary"))
alternateSecondary = Boolean.parseBoolean(split[1]);
else if(split[0].equals("ModePrimary"))
modePrimary = EnumFireMode.valueOf(split[1].toUpperCase());
else if(split[0].equals("ModeSecondary"))
modeSecondary = EnumFireMode.valueOf(split[1].toUpperCase());
else if(split[0].equals("ShootPointPrimary"))
{
DriveablePosition shootPoint = getShootPoint(split);
shootPointsPrimary.add(shootPoint);
if(shootPoint instanceof PilotGun)
pilotGuns.add((PilotGun)shootPoint);
}
else if(split[0].equals("ShootPointSecondary"))
{
DriveablePosition shootPoint = getShootPoint(split);
shootPointsSecondary.add(shootPoint);
if(shootPoint instanceof PilotGun)
pilotGuns.add((PilotGun)shootPoint);
}
//Backwards compatibility stuff
else if(split[0].equals("AddGun"))
{
secondary = EnumWeaponType.GUN;
PilotGun pilotGun = (PilotGun)getShootPoint(split);
shootPointsSecondary.add(pilotGun);
pilotGuns.add(pilotGun);
recipe.add(new ItemStack(pilotGun.type.item));
}
else if(split[0].equals("BombPosition"))
{
primary = EnumWeaponType.BOMB;
shootPointsPrimary.add(new DriveablePosition(new Vector3f(Float.parseFloat(split[1]) / 16F, Float.parseFloat(split[2]) / 16F, Float.parseFloat(split[3]) / 16F), EnumDriveablePart.core));
}
else if(split[0].equals("BarrelPosition"))
{
primary = EnumWeaponType.SHELL;
shootPointsPrimary.add(new DriveablePosition(new Vector3f(Float.parseFloat(split[1]) / 16F, Float.parseFloat(split[2]) / 16F, Float.parseFloat(split[3]) / 16F), EnumDriveablePart.turret));
}
else if(split[0].equals("ShootDelay"))
shootDelaySecondary = Integer.parseInt(split[1]);
else if(split[0].equals("ShellDelay") || split[0].equals("BombDelay"))
shootDelayPrimary = Integer.parseInt(split[1]);
//Recipe
else if(split[0].equals("AddRecipeParts"))
{
EnumDriveablePart part = EnumDriveablePart.getPart(split[1]);
ItemStack[] stacks = new ItemStack[(split.length - 2) / 2];
for(int i = 0; i < (split.length - 2) / 2; i++)
{
int amount = Integer.parseInt(split[2 * i + 2]);
boolean damaged = split[2 * i + 3].contains(".");
String itemName = damaged ? split[2 * i + 3].split("\\.")[0] : split[2 * i + 3];
int damage = damaged ? Integer.parseInt(split[2 * i + 3].split("\\.")[1]) : 0;
stacks[i] = getRecipeElement(itemName, amount, damage, shortName);
recipe.add(stacks[i]);
}
partwiseRecipe.put(part, stacks);
}
//Dyes
else if(split[0].equals("AddDye"))
{
int amount = Integer.parseInt(split[1]);
int damage = -1;
for(int i = 0; i < ItemDye.field_150923_a.length; i++)
{
if(ItemDye.field_150923_a[i].equals(split[2]))
damage = i;
}
if(damage == -1)
{
FlansMod.log("Failed to find dye colour : " + split[2] + " while adding " + file.name);
return;
}
recipe.add(new ItemStack(Items.dye, amount, damage));
}
//Health
else if(split[0].equals("SetupPart"))
{
EnumDriveablePart part = EnumDriveablePart.getPart(split[1]);
CollisionBox box = new CollisionBox(Integer.parseInt(split[2]), Integer.parseInt(split[3]), Integer.parseInt(split[4]), Integer.parseInt(split[5]), Integer.parseInt(split[6]), Integer.parseInt(split[7]), Integer.parseInt(split[8]));
health.put(part, box);
}
//Driver Position
else if(split[0].equals("Driver") || split[0].equals("Pilot"))
{
if(split.length > 4)
seats[0] = new Seat(Integer.parseInt(split[1]), Integer.parseInt(split[2]), Integer.parseInt(split[3]), Float.parseFloat(split[4]), Float.parseFloat(split[5]), Float.parseFloat(split[6]), Float.parseFloat(split[7]));
else seats[0] = new Seat(Integer.parseInt(split[1]), Integer.parseInt(split[2]), Integer.parseInt(split[3]));
}
else if(split[0].equals("RotatedDriverOffset"))
{
seats[0].rotatedOffset = new Vector3f(Integer.parseInt(split[1]) / 16F, Integer.parseInt(split[2]) / 16F, Integer.parseInt(split[3]) / 16F);
}
else if(split[0].equals("RotatedPassengerOffset"))
{
seats[Integer.parseInt(split[1])].rotatedOffset = new Vector3f(Integer.parseInt(split[2]) / 16F, Integer.parseInt(split[3]) / 16F, Integer.parseInt(split[4]) / 16F);
}
//Passengers / Gunner Seats
else if(split[0].equals("Passenger"))
{
Seat seat = new Seat(split);
seats[seat.id] = seat;
if(seat.gunType != null)
{
seat.gunnerID = numPassengerGunners++;
recipe.add(new ItemStack(seat.gunType.item));
}
}
else if(split[0].equals("GunOrigin"))
seats[Integer.parseInt(split[1])].gunOrigin = new Vector3f(Float.parseFloat(split[2]) / 16F, Float.parseFloat(split[3]) / 16F, Float.parseFloat(split[4]) / 16F);
//Y offset for badly built models :P
else if(split[0].equals("YOffset"))
yOffset = Float.parseFloat(split[1]);
//Third person camera distance