Some more minor turbine tweaks

This commit is contained in:
Calclavia 2014-02-28 20:47:20 +08:00
parent 53bbf1f4ef
commit fde9a63f78
3 changed files with 23 additions and 18 deletions

View file

@ -175,11 +175,15 @@ public class Mechanical
GameRegistry.addRecipe(new ShapedOreRecipe(blockDetector, "SWS", "SRS", "SWS", 'S', Item.ingotIron, 'W', UniversalRecipe.WIRE.get()));
GameRegistry.addRecipe(new ShapedOreRecipe(blockRejector, "S S", "SPS", "SRS", 'P', Block.pistonBase, 'S', Item.ingotIron, 'R', Item.redstone));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockWindTurbine, 1, 0), "CWC", "WGW", "CWC", 'G', itemGear, 'C', Block.cloth, 'W', "plankWood"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockWaterTurbine, 1, 0), " W ", "WGW", " W ", 'G', itemGear, 'W', UniversalRecipe.PRIMARY_METAL.get()));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockWindTurbine, 1, 0), "CWC", "WGW", "CWC", 'G', itemGear, 'C', Block.cloth, 'W', Item.stick));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockWindTurbine, 1, 1), "CWC", "WGW", "CWC", 'G', new ItemStack(blockWindTurbine, 1, 0), 'C', Block.stone, 'W', Item.stick));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockWindTurbine, 1, 2), "CWC", "WGW", "CWC", 'G', new ItemStack(blockWindTurbine, 1, 1), 'C', Item.ingotIron, 'W', Item.stick));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockWaterTurbine, 1, 0), "SWS", "WGW", "SWS", 'G', itemGear, 'W', "plankWood", 'S', Item.stick));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockWaterTurbine, 1, 1), "SWS", "WGW", "SWS", 'G', new ItemStack(blockWaterTurbine, 1, 0), 'W', Block.stone, 'S', Item.stick));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockWaterTurbine, 1, 2), "SWS", "WGW", "SWS", 'G', new ItemStack(blockWaterTurbine, 1, 1), 'W', UniversalRecipe.PRIMARY_METAL.get(), 'S', Item.stick));
GameRegistry.addRecipe(new ShapedOreRecipe(blockTank, "GGG", "GSG", "GGG", 'G', Block.glass, 'S', Item.ingotIron));
GameRegistry.addRecipe(new ShapedOreRecipe(blockPump, "PPP", "GGG", "PPP", 'P', itemPipe, 'G', itemGear));
GameRegistry.addRecipe(new ShapedOreRecipe(blockPump, "PPP", "GGG", "PPP", 'P', itemPipe, 'G', new ItemStack(itemGear, 1, 2)));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemPipe, 3), "BBB", " ", "BBB", 'B', Item.ingotIron));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemPipe, 4), "BBB", " ", "BBB", 'B', UniversalRecipe.SECONDARY_METAL.get()));
@ -187,6 +191,5 @@ public class Mechanical
GameRegistry.addRecipe(new ShapedOreRecipe(blockGrinderWheel, "III", "LGL", "III", 'I', UniversalRecipe.PRIMARY_METAL.get(), 'L', "logWood", 'G', itemGear));
GameRegistry.addRecipe(new ShapedOreRecipe(blockPurifier, "IGI", "IGI", "IGI", 'I', UniversalRecipe.PRIMARY_METAL.get(), 'G', itemGear));
GameRegistry.addRecipe(new ShapedOreRecipe(blockFilter, "BBB", "PPP", "BBB", 'B', Block.fenceIron, 'P', Item.paper));
}
}

View file

@ -34,6 +34,17 @@ public class TileWindTurbine extends TileMechanicalTurbine
@Override
public void updateEntity()
{
/**
* Break under storm.
*/
if (tier == 0 && getDirection().offsetY == 0 && worldObj.isRaining() && worldObj.isThundering() && worldObj.rand.nextFloat() < 0.00000008)
{
InventoryUtility.dropItemStack(worldObj, new Vector3(this), new ItemStack(Block.cloth, 1 + worldObj.rand.nextInt(2)));
InventoryUtility.dropItemStack(worldObj, new Vector3(this), new ItemStack(Item.stick, 3 + worldObj.rand.nextInt(8)));
worldObj.setBlockToAir(xCoord, yCoord, zCoord);
return;
}
/**
* Only the primary turbine ticks.
*/
@ -45,21 +56,11 @@ public class TileWindTurbine extends TileMechanicalTurbine
*/
if (getDirection().offsetY == 0)
{
maxPower = 120;
if (ticks % 20 == 0 && !worldObj.isRemote)
computePower();
/**
* Break under storm.
*/
if (tier == 0 && worldObj.isRaining() && worldObj.isThundering() && worldObj.rand.nextFloat() < 0.00000008)
{
InventoryUtility.dropItemStack(worldObj, new Vector3(this), new ItemStack(Block.cloth, 1 + worldObj.rand.nextInt(2)));
InventoryUtility.dropItemStack(worldObj, new Vector3(this), new ItemStack(Item.stick, 3 + worldObj.rand.nextInt(8)));
worldObj.setBlockToAir(xCoord, yCoord, zCoord);
return;
}
maxPower = 120;
getMultiBlock().get().power += windPower;
}
else
@ -116,11 +117,12 @@ public class TileWindTurbine extends TileMechanicalTurbine
checkCount = (checkCount + 1) % (openBlockCache.length - 1);
float multiblockMultiplier = (multiBlockRadius + 0.5f) * 2;
float materialMultiplier = tier == 0 ? 1.1f : tier == 1 ? 0.9f : 1;
BiomeGenBase biome = worldObj.getBiomeGenForCoords(xCoord, zCoord);
boolean hasBonus = biome instanceof BiomeGenOcean || biome instanceof BiomeGenPlains || biome == BiomeGenBase.river;
float windSpeed = (worldObj.rand.nextFloat() / 8) + (yCoord / 256f) * (hasBonus ? 1.2f : 1) + worldObj.getRainStrength(1.5f);
windPower = (long) ((multiblockMultiplier * windSpeed * efficiency * 0.01f) * maxPower);
windPower = (long) (materialMultiplier * multiblockMultiplier * windSpeed * efficiency * 0.01f) * maxPower;
}
}

View file

@ -133,7 +133,7 @@ resonantinduction.machine.smelter=Smelter
### Electrical Module
## Blocks
tile.resonantinduction\:tesla.name=Tesla Coil
tile.resonantinduction\:tesla.tooltip=Transfer electricity wirelessly. Link with a configurator for cross-dimension teleportation.
tile.resonantinduction\:tesla.tooltip=Transfer electricity wirelessly. Link with a configurator for cross dimension teleportation.
item.resonantinduction\:levitator.name=Electromagnetic Levitator
tile.resonantinduction\:battery.name=Battery
tile.resonantinduction\:armbot.name=Armbot