mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Added smokestack support to fluid burning lads
This commit is contained in:
parent
78f9d19b8d
commit
81a3c19e88
@ -173,6 +173,9 @@ public class MobConfig {
|
|||||||
if(pollutionMult == 1) {
|
if(pollutionMult == 1) {
|
||||||
pollutionMult = 3;
|
pollutionMult = 3;
|
||||||
}
|
}
|
||||||
|
if (bombardierChance[2] == 1){
|
||||||
|
bombardierChance[2] = 0;
|
||||||
|
}
|
||||||
RadiationConfig.sootFogThreshold *= pollutionMult;
|
RadiationConfig.sootFogThreshold *= pollutionMult;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,13 +2,19 @@ package com.hbm.tileentity;
|
|||||||
|
|
||||||
import com.hbm.handler.pollution.PollutionHandler;
|
import com.hbm.handler.pollution.PollutionHandler;
|
||||||
import com.hbm.handler.pollution.PollutionHandler.PollutionType;
|
import com.hbm.handler.pollution.PollutionHandler.PollutionType;
|
||||||
|
import com.hbm.inventory.fluid.FluidType;
|
||||||
import com.hbm.inventory.fluid.Fluids;
|
import com.hbm.inventory.fluid.Fluids;
|
||||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||||
|
|
||||||
import api.hbm.fluid.IFluidUser;
|
import api.hbm.fluid.IFluidUser;
|
||||||
|
import com.hbm.inventory.fluid.trait.FT_Polluting;
|
||||||
|
import com.hbm.inventory.fluid.trait.FluidTrait;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
public abstract class TileEntityMachinePolluting extends TileEntityMachineBase implements IFluidUser {
|
public abstract class TileEntityMachinePolluting extends TileEntityMachineBase implements IFluidUser {
|
||||||
|
|
||||||
public FluidTank smoke;
|
public FluidTank smoke;
|
||||||
@ -36,6 +42,30 @@ public abstract class TileEntityMachinePolluting extends TileEntityMachineBase i
|
|||||||
if(worldObj.rand.nextInt(3) == 0) worldObj.playSoundEffect(xCoord, yCoord, zCoord, "random.fizz", 0.1F, 1.5F);
|
if(worldObj.rand.nextInt(3) == 0) worldObj.playSoundEffect(xCoord, yCoord, zCoord, "random.fizz", 0.1F, 1.5F);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public void pollute(FluidType type, FluidTrait.FluidReleaseType release, float amount) {
|
||||||
|
FluidTank tank;
|
||||||
|
FT_Polluting trait = type.getTrait(FT_Polluting.class);
|
||||||
|
if(trait == null) return;
|
||||||
|
if(release == FluidTrait.FluidReleaseType.VOID) return;
|
||||||
|
|
||||||
|
HashMap<PollutionType, Float> map = release == FluidTrait.FluidReleaseType.BURN ? trait.burnMap : trait.releaseMap;
|
||||||
|
|
||||||
|
for(Map.Entry<PollutionType, Float> entry : map.entrySet()) {
|
||||||
|
|
||||||
|
tank = entry.getKey() == PollutionType.SOOT ? smoke : entry.getKey() == PollutionType.HEAVYMETAL ? smoke_leaded : smoke_poison;
|
||||||
|
int fluidAmount = (int) Math.ceil(entry.getValue() * amount * 100);
|
||||||
|
tank.setFill(tank.getFill() + fluidAmount);
|
||||||
|
|
||||||
|
if (tank.getFill() > tank.getMaxFill()) {
|
||||||
|
int overflow = tank.getFill() - tank.getMaxFill();
|
||||||
|
tank.setFill(tank.getMaxFill());
|
||||||
|
PollutionHandler.incrementPollution(worldObj, xCoord, yCoord, zCoord, entry.getKey(), overflow / 100F);
|
||||||
|
|
||||||
|
if (worldObj.rand.nextInt(3) == 0)
|
||||||
|
worldObj.playSoundEffect(xCoord, yCoord, zCoord, "random.fizz", 0.1F, 1.5F);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void sendSmoke(int x, int y, int z, ForgeDirection dir) {
|
public void sendSmoke(int x, int y, int z, ForgeDirection dir) {
|
||||||
if(this.smoke.getFill() > 0) this.sendFluid(smoke, worldObj, x, y, z, dir);
|
if(this.smoke.getFill() > 0) this.sendFluid(smoke, worldObj, x, y, z, dir);
|
||||||
|
|||||||
@ -172,7 +172,7 @@ public class TileEntityCrucible extends TileEntityMachineBase implements IGUIPro
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PollutionHandler.incrementPollution(worldObj, xCoord, yCoord, zCoord, PollutionType.SOOT, PollutionHandler.SOOT_PER_SECOND / 2F);
|
PollutionHandler.incrementPollution(worldObj, xCoord, yCoord, zCoord, PollutionType.SOOT, PollutionHandler.SOOT_PER_SECOND / 20F);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* pour recipe stack */
|
/* pour recipe stack */
|
||||||
|
|||||||
@ -82,7 +82,7 @@ public class TileEntityHeaterOilburner extends TileEntityMachinePolluting implem
|
|||||||
this.heatEnergy += heat * toBurn;
|
this.heatEnergy += heat * toBurn;
|
||||||
|
|
||||||
if(worldObj.getTotalWorldTime() % 5 == 0 && toBurn > 0) {
|
if(worldObj.getTotalWorldTime() % 5 == 0 && toBurn > 0) {
|
||||||
FT_Polluting.pollute(worldObj, xCoord, yCoord, zCoord, tank.getTankType(), FluidReleaseType.BURN, toBurn * 5);
|
super.pollute(tank.getTankType(), FluidReleaseType.BURN, toBurn * 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
shouldCool = false;
|
shouldCool = false;
|
||||||
|
|||||||
@ -87,7 +87,7 @@ public class TileEntityMachineCombustionEngine extends TileEntityMachinePollutin
|
|||||||
fill -= toBurn;
|
fill -= toBurn;
|
||||||
|
|
||||||
if(worldObj.getTotalWorldTime() % 5 == 0 && toBurn > 0) {
|
if(worldObj.getTotalWorldTime() % 5 == 0 && toBurn > 0) {
|
||||||
FT_Polluting.pollute(worldObj, xCoord, yCoord, zCoord, tank.getTankType(), FluidReleaseType.BURN, toBurn * 5);
|
super.pollute(tank.getTankType(), FluidReleaseType.BURN, toBurn * 0.5F);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(toBurn > 0) {
|
if(toBurn > 0) {
|
||||||
|
|||||||
@ -212,7 +212,7 @@ public class TileEntityMachineDiesel extends TileEntityMachinePolluting implemen
|
|||||||
tank.setFill(0);
|
tank.setFill(0);
|
||||||
|
|
||||||
if(worldObj.getTotalWorldTime() % 5 == 0) {
|
if(worldObj.getTotalWorldTime() % 5 == 0) {
|
||||||
FT_Polluting.pollute(worldObj, xCoord, yCoord, zCoord, tank.getTankType(), FluidReleaseType.BURN, 5F);
|
super.pollute(tank.getTankType(), FluidReleaseType.BURN, 5F);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(power + getHEFromFuel() <= powerCap) {
|
if(power + getHEFromFuel() <= powerCap) {
|
||||||
|
|||||||
@ -16,6 +16,7 @@ import com.hbm.inventory.fluid.Fluids;
|
|||||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||||
import com.hbm.inventory.fluid.trait.FT_Combustible;
|
import com.hbm.inventory.fluid.trait.FT_Combustible;
|
||||||
import com.hbm.inventory.fluid.trait.FT_Combustible.FuelGrade;
|
import com.hbm.inventory.fluid.trait.FT_Combustible.FuelGrade;
|
||||||
|
import com.hbm.inventory.fluid.trait.FluidTrait;
|
||||||
import com.hbm.inventory.gui.GUIMachineTurbofan;
|
import com.hbm.inventory.gui.GUIMachineTurbofan;
|
||||||
import com.hbm.items.ModItems;
|
import com.hbm.items.ModItems;
|
||||||
import com.hbm.items.machine.ItemMachineUpgrade.UpgradeType;
|
import com.hbm.items.machine.ItemMachineUpgrade.UpgradeType;
|
||||||
@ -176,7 +177,7 @@ public class TileEntityMachineTurbofan extends TileEntityMachinePolluting implem
|
|||||||
this.power += this.output;
|
this.power += this.output;
|
||||||
this.consumption = amountToBurn;
|
this.consumption = amountToBurn;
|
||||||
|
|
||||||
if(worldObj.getTotalWorldTime() % 20 == 0) PollutionHandler.incrementPollution(worldObj, xCoord, yCoord, zCoord, PollutionType.SOOT, PollutionHandler.SOOT_PER_SECOND * amountToBurn);
|
if(worldObj.getTotalWorldTime() % 20 == 0) super.pollute(tank.getTankType(), FluidTrait.FluidReleaseType.BURN, amountToBurn * 5);;
|
||||||
}
|
}
|
||||||
|
|
||||||
power = Library.chargeItemsFromTE(slots, 3, power, power);
|
power = Library.chargeItemsFromTE(slots, 3, power, power);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user