fix item rendering for #2222, add engine explosion option, improve engine overheat behaviour

This commit is contained in:
asiekierka 2014-11-23 14:48:31 +01:00
parent 20031e79e9
commit ba20bea0ec
5 changed files with 17 additions and 1 deletions

View file

@ -102,12 +102,13 @@ public class BuildCraftEnergy extends BuildCraftMod {
public static Item fuel; public static Item fuel;
public static boolean canOilBurn; public static boolean canOilBurn;
public static boolean canEnginesExplode;
public static double oilWellScalar = 1.0; public static double oilWellScalar = 1.0;
public static TreeMap<BlockIndex, Integer> saturationStored = new TreeMap<BlockIndex, Integer>();
public static ITriggerExternal triggerBlueEngineHeat = new TriggerEngineHeat(EnergyStage.BLUE); public static ITriggerExternal triggerBlueEngineHeat = new TriggerEngineHeat(EnergyStage.BLUE);
public static ITriggerExternal triggerGreenEngineHeat = new TriggerEngineHeat(EnergyStage.GREEN); public static ITriggerExternal triggerGreenEngineHeat = new TriggerEngineHeat(EnergyStage.GREEN);
public static ITriggerExternal triggerYellowEngineHeat = new TriggerEngineHeat(EnergyStage.YELLOW); public static ITriggerExternal triggerYellowEngineHeat = new TriggerEngineHeat(EnergyStage.YELLOW);
public static ITriggerExternal triggerRedEngineHeat = new TriggerEngineHeat(EnergyStage.RED); public static ITriggerExternal triggerRedEngineHeat = new TriggerEngineHeat(EnergyStage.RED);
public static ITriggerExternal triggerEngineOverheat = new TriggerEngineHeat(EnergyStage.OVERHEAT);
private static Fluid buildcraftFluidOil; private static Fluid buildcraftFluidOil;
private static Fluid buildcraftFluidFuel; private static Fluid buildcraftFluidFuel;
@ -120,6 +121,7 @@ public class BuildCraftEnergy extends BuildCraftMod {
int oilOceanBiomeId = BuildCraftCore.mainConfiguration.get("biomes", "biomeOilOcean", DefaultProps.BIOME_OIL_OCEAN).getInt(DefaultProps.BIOME_OIL_OCEAN); int oilOceanBiomeId = BuildCraftCore.mainConfiguration.get("biomes", "biomeOilOcean", DefaultProps.BIOME_OIL_OCEAN).getInt(DefaultProps.BIOME_OIL_OCEAN);
canOilBurn = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "burnOil", true, "Can oil burn?").getBoolean(true); canOilBurn = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "burnOil", true, "Can oil burn?").getBoolean(true);
oilWellScalar = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "oilWellGenerationRate", 1.0, "Probability of oil well generation").getDouble(1.0); oilWellScalar = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "oilWellGenerationRate", 1.0, "Probability of oil well generation").getDouble(1.0);
canEnginesExplode = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "enginesExplode", false, "Do engines explode upon overheat?").getBoolean(false);
setBiomeList( setBiomeList(
OilPopulate.INSTANCE.surfaceDepositBiomes, OilPopulate.INSTANCE.surfaceDepositBiomes,

View file

@ -17,6 +17,7 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import cofh.api.energy.IEnergyHandler; import cofh.api.energy.IEnergyHandler;
import buildcraft.BuildCraftEnergy;
import buildcraft.api.power.IEngine; import buildcraft.api.power.IEngine;
import buildcraft.api.tiles.IHeatable; import buildcraft.api.tiles.IHeatable;
import buildcraft.api.tools.IToolWrench; import buildcraft.api.tools.IToolWrench;
@ -172,6 +173,10 @@ public abstract class TileEngine extends TileBuildCraft implements IPipeConnecti
public void overheat() { public void overheat() {
this.isPumping = false; this.isPumping = false;
if (BuildCraftEnergy.canEnginesExplode) {
worldObj.createExplosion(null, xCoord, yCoord, zCoord, 3, true);
worldObj.setBlockToAir(xCoord, yCoord, zCoord);
}
} }
public void updateHeat() { public void updateHeat() {

View file

@ -140,6 +140,12 @@ public class TileEngineIron extends TileEngineWithInventory implements IFluidHan
return fuel != null && fuel.amount > 0 && penaltyCooling == 0 && isRedstonePowered; return fuel != null && fuel.amount > 0 && penaltyCooling == 0 && isRedstonePowered;
} }
@Override
public void overheat() {
// Evaporate all remaining coolant as a form of penalty.
tankCoolant.setFluid(null);
}
@Override @Override
public void burn() { public void burn() {
FluidStack fuel = this.tankFuel.getFluid(); FluidStack fuel = this.tankFuel.getFluid();

View file

@ -36,6 +36,7 @@ public class EnergyStatementProvider implements ITriggerProvider {
triggers.add(BuildCraftEnergy.triggerGreenEngineHeat); triggers.add(BuildCraftEnergy.triggerGreenEngineHeat);
triggers.add(BuildCraftEnergy.triggerYellowEngineHeat); triggers.add(BuildCraftEnergy.triggerYellowEngineHeat);
triggers.add(BuildCraftEnergy.triggerRedEngineHeat); triggers.add(BuildCraftEnergy.triggerRedEngineHeat);
triggers.add(BuildCraftEnergy.triggerEngineOverheat);
} }
return triggers; return triggers;

View file

@ -112,6 +112,8 @@ public class FacadeItemRenderer implements IItemRenderer {
GL11.glPopMatrix(); GL11.glPopMatrix();
RenderUtils.setGLColorFromInt(0xFFFFFF);
// Render StructurePipe // Render StructurePipe
block = BuildCraftTransport.genericPipeBlock; block = BuildCraftTransport.genericPipeBlock;
IIcon textureID = BuildCraftTransport.instance.pipeIconProvider.getIcon(PipeIconProvider.TYPE.PipeStructureCobblestone.ordinal()); // Structure pipe IIcon textureID = BuildCraftTransport.instance.pipeIconProvider.getIcon(PipeIconProvider.TYPE.PipeStructureCobblestone.ordinal()); // Structure pipe