RBMK heating column, heat exchanger, mug root beer coolant

and regular coolant too i guess
This commit is contained in:
Boblet 2022-04-15 15:07:17 +02:00
parent 646d22b4e4
commit 4549924dfd
16 changed files with 461 additions and 12 deletions

View File

@ -1102,6 +1102,7 @@ public class ModBlocks {
public static Block rbmk_outgasser;
public static Block rbmk_storage;
public static Block rbmk_cooler;
public static Block rbmk_heater;
public static Block rbmk_console;
public static Block rbmk_crane_console;
public static final int guiID_rbmk_rod = 113;
@ -1114,6 +1115,7 @@ public class ModBlocks {
public static Block rbmk_loader;
public static Block rbmk_steam_inlet;
public static Block rbmk_steam_outlet;
public static Block rbmk_heatex;
public static Block pribris;
public static Block pribris_burning;
public static Block pribris_radiating;
@ -2067,11 +2069,13 @@ public class ModBlocks {
rbmk_outgasser = new RBMKOutgasser().setBlockName("rbmk_outgasser").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":rbmk/rbmk_outgasser");
rbmk_storage = new RBMKStorage().setBlockName("rbmk_storage").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":rbmk/rbmk_storage");
rbmk_cooler = new RBMKCooler().setBlockName("rbmk_cooler").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":rbmk/rbmk_cooler");
rbmk_heater = new RBMKHeater().setBlockName("rbmk_heater").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":rbmk/rbmk_heater");
rbmk_console = new RBMKConsole().setBlockName("rbmk_console").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":rbmk/rbmk_console");
rbmk_crane_console = new RBMKCraneConsole().setBlockName("rbmk_crane_console").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":rbmk/rbmk_crane_console");
rbmk_loader = new BlockGeneric(Material.iron).setBlockName("rbmk_loader").setCreativeTab(MainRegistry.machineTab).setHardness(50.0F).setResistance(60.0F).setBlockTextureName(RefStrings.MODID + ":rbmk_loader");
rbmk_steam_inlet = new RBMKInlet(Material.iron).setBlockName("rbmk_steam_inlet").setCreativeTab(MainRegistry.machineTab).setHardness(50.0F).setResistance(60.0F).setBlockTextureName(RefStrings.MODID + ":rbmk_steam_inlet");
rbmk_steam_outlet = new RBMKOutlet(Material.iron).setBlockName("rbmk_steam_outlet").setCreativeTab(MainRegistry.machineTab).setHardness(50.0F).setResistance(60.0F).setBlockTextureName(RefStrings.MODID + ":rbmk_steam_outlet");
rbmk_heatex = new RBMKHeatex(Material.iron).setBlockName("rbmk_heatex").setCreativeTab(MainRegistry.machineTab).setHardness(50.0F).setResistance(60.0F).setBlockTextureName(RefStrings.MODID + ":rbmk_heatex");
pribris = new RBMKDebris().setBlockName("pribris").setCreativeTab(MainRegistry.machineTab).setHardness(50.0F).setResistance(600.0F).setBlockTextureName(RefStrings.MODID + ":rbmk/rbmk_debris");
pribris_burning = new RBMKDebrisBurning().setBlockName("pribris_burning").setCreativeTab(MainRegistry.machineTab).setHardness(50.0F).setResistance(600.0F).setBlockTextureName(RefStrings.MODID + ":rbmk/rbmk_debris_burning");
pribris_radiating = new RBMKDebrisRadiating().setBlockName("pribris_radiating").setCreativeTab(MainRegistry.machineTab).setHardness(50.0F).setResistance(600.0F).setBlockTextureName(RefStrings.MODID + ":rbmk/rbmk_debris_radiating");
@ -2983,11 +2987,13 @@ public class ModBlocks {
GameRegistry.registerBlock(rbmk_outgasser, rbmk_outgasser.getUnlocalizedName());
GameRegistry.registerBlock(rbmk_storage, rbmk_storage.getUnlocalizedName());
GameRegistry.registerBlock(rbmk_cooler, rbmk_cooler.getUnlocalizedName());
GameRegistry.registerBlock(rbmk_heater, rbmk_heater.getUnlocalizedName());
GameRegistry.registerBlock(rbmk_console, rbmk_console.getUnlocalizedName());
GameRegistry.registerBlock(rbmk_crane_console, rbmk_crane_console.getUnlocalizedName());
GameRegistry.registerBlock(rbmk_loader, rbmk_loader.getUnlocalizedName());
GameRegistry.registerBlock(rbmk_steam_inlet, rbmk_steam_inlet.getUnlocalizedName());
GameRegistry.registerBlock(rbmk_steam_outlet, rbmk_steam_outlet.getUnlocalizedName());
GameRegistry.registerBlock(rbmk_heatex, rbmk_heatex.getUnlocalizedName());
GameRegistry.registerBlock(pribris, pribris.getUnlocalizedName());
GameRegistry.registerBlock(pribris_burning, pribris_burning.getUnlocalizedName());
GameRegistry.registerBlock(pribris_radiating, pribris_radiating.getUnlocalizedName());

View File

@ -0,0 +1,23 @@
package com.hbm.blocks.machine.rbmk;
import com.hbm.tileentity.machine.rbmk.TileEntityRBMKHeater;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
public class RBMKHeater extends RBMKBase {
@Override
public TileEntity createNewTileEntity(World world, int meta) {
if(meta >= this.offset)
return new TileEntityRBMKHeater();
return null;
}
@Override
public int getRenderType(){
return this.renderIDControl;
}
}

View File

@ -0,0 +1,83 @@
package com.hbm.blocks.machine.rbmk;
import java.util.ArrayList;
import java.util.List;
import com.hbm.blocks.ILookOverlay;
import com.hbm.inventory.FluidTank;
import com.hbm.inventory.fluid.FluidType;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.items.machine.IItemFluidIdentifier;
import com.hbm.tileentity.machine.rbmk.TileEntityHeatex;
import com.hbm.tileentity.machine.rbmk.TileEntityRBMKHeater;
import com.hbm.util.I18nUtil;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.ChatStyle;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
public class RBMKHeatex extends BlockContainer implements ILookOverlay {
public RBMKHeatex(Material mat) {
super(mat);
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
return new TileEntityHeatex();
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float fX, float fY, float fZ) {
if(player.getHeldItem() != null && player.getHeldItem().getItem() instanceof IItemFluidIdentifier) {
IItemFluidIdentifier id = (IItemFluidIdentifier) player.getHeldItem().getItem();
FluidType type = id.getType(world, x, y, z, player.getHeldItem());
FluidType convert = TileEntityRBMKHeater.getConversion(type);
if(!player.isSneaking() && convert != Fluids.NONE) {
TileEntity te = world.getTileEntity(x, y, z);
if(te instanceof TileEntityHeatex) {
TileEntityHeatex heatex = (TileEntityHeatex) te;
heatex.coolantIn.setTankType(type);
heatex.coolantOut.setTankType(convert);
heatex.markDirty();
player.addChatComponentMessage(new ChatComponentText("Changed type to ").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.YELLOW)).appendSibling(new ChatComponentTranslation("hbmfluid." + type.getName().toLowerCase())).appendSibling(new ChatComponentText("!")));
}
}
}
return false;
}
@Override
public void printHook(Pre event, World world, int x, int y, int z) {
TileEntity te = world.getTileEntity(x, y, z);
if(!(te instanceof TileEntityHeatex))
return;
TileEntityHeatex extractor = (TileEntityHeatex) te;
List<String> text = new ArrayList();
addLine(text, extractor.coolantIn, true);
addLine(text, extractor.waterIn, true);
addLine(text, extractor.coolantOut, false);
addLine(text, extractor.waterOut, false);
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
}
private void addLine(List<String> text, FluidTank tank, boolean in) {
text.add((in ? (EnumChatFormatting.GREEN + "-> ") : (EnumChatFormatting.RED + "<- ")) + EnumChatFormatting.RESET + I18nUtil.resolveKey("hbmfluid." + tank.getTankType().getName().toLowerCase()) + ": " + tank.getFill() + "/" + tank.getMaxFill() + "mB");
}
}

View File

@ -29,6 +29,7 @@ public class FluidType {
public int reactivity;
public EnumSymbol symbol;
public int temperature;
public double heatCap;
public Set<ExtContainer> containers = new HashSet();
public List<FluidTrait> traits = new ArrayList();
private String stringId;
@ -61,6 +62,11 @@ public class FluidType {
return this;
}
public FluidType setHeatCap(double heatCap) {
this.heatCap = heatCap;
return this;
}
public FluidType addContainers(int color, ExtContainer... containers) {
this.containerColor = color;
Collections.addAll(this.containers, containers);

View File

@ -18,6 +18,7 @@ public class Fluids {
public static FluidType SUPERHOTSTEAM;
public static FluidType ULTRAHOTSTEAM;
public static FluidType COOLANT;
public static FluidType COOLANT_HOT;
public static FluidType LAVA;
public static FluidType DEUTERIUM;
public static FluidType TRITIUM;
@ -87,6 +88,8 @@ public class Fluids {
public static FluidType XPJUICE;
public static FluidType ENDERJUICE;
public static FluidType SULFURIC_ACID;
public static FluidType MUG;
public static FluidType MUG_HOT;
private static final HashMap<Integer, FluidType> idMapping = new HashMap();
private static final HashMap<String, FluidType> nameMapping = new HashMap();
@ -113,7 +116,7 @@ public class Fluids {
HOTSTEAM = new FluidType( "HOTSTEAM", 0xE7D6D6, 4, 0, 0, EnumSymbol.NONE).setTemp(300);
SUPERHOTSTEAM = new FluidType( "SUPERHOTSTEAM", 0xE7B7B7, 4, 0, 0, EnumSymbol.NONE).setTemp(450);
ULTRAHOTSTEAM = new FluidType( "ULTRAHOTSTEAM", 0xE39393, 4, 0, 0, EnumSymbol.NONE).setTemp(600);
COOLANT = new FluidType( "COOLANT", 0xd8fcff, 1, 0, 0, EnumSymbol.NONE);
COOLANT = new FluidType( "COOLANT", 0xd8fcff, 1, 0, 0, EnumSymbol.NONE).setHeatCap(0.25D);
LAVA = new FluidType( "LAVA", 0xFF3300, 4, 0, 0, EnumSymbol.NOWATER).setTemp(1200);
DEUTERIUM = new FluidTypeCombustible( "DEUTERIUM", 0x0000FF, 3, 4, 0, EnumSymbol.NONE).setCombustionEnergy(FuelGrade.HIGH, 10_000).setHeatEnergy(5_000);
TRITIUM = new FluidTypeCombustible( "TRITIUM", 0x000099, 3, 4, 0, EnumSymbol.RADIATION).setCombustionEnergy(FuelGrade.HIGH, 10_000).setHeatEnergy(5_000);
@ -183,6 +186,9 @@ public class Fluids {
GASOLINE_LEADED = new FluidTypeCombustible( "GASOLINE_LEADED", 0x445772, 1, 2, 0, EnumSymbol.NONE).setCombustionEnergy(FuelGrade.HIGH, 1_500_000).setHeatEnergy(((FluidTypeFlammable)GASOLINE).getHeatEnergy());
COALGAS_LEADED = new FluidTypeCombustible( "COALGAS_LEADED", 0x445772, 1, 2, 0, EnumSymbol.NONE).setCombustionEnergy(FuelGrade.MEDIUM, 250_000).setHeatEnergy(((FluidTypeFlammable)COALGAS).getHeatEnergy());
SULFURIC_ACID = new FluidType( "SULFURIC_ACID", 0xB0AA64, 3, 0, 2, EnumSymbol.ACID).addTraits(FluidTrait.CORROSIVE);
COOLANT_HOT = new FluidType( "COOLANT_HOT", 0x99525E, 1, 0, 0, EnumSymbol.NONE).setTemp(600).setHeatCap(STEAM.heatCap);
MUG = new FluidType( "MUG", 0xd8fcff, 0, 0, 0, EnumSymbol.NONE).setHeatCap(1D);
MUG_HOT = new FluidType( "MUG_HOT", 0xd8fcff, 0, 0, 0, EnumSymbol.NONE).setHeatCap(MUG.heatCap).setTemp(500);
// ^ ^ ^ ^ ^ ^ ^ ^
@ -205,7 +211,10 @@ public class Fluids {
//coolants
metaOrder.add(CARBONDIOXIDE);
metaOrder.add(COOLANT);
metaOrder.add(COOLANT_HOT);
metaOrder.add(CRYOGEL);
metaOrder.add(MUG);
metaOrder.add(MUG_HOT);
//pure elements, cyogenic gasses
metaOrder.add(HYDROGEN);
metaOrder.add(DEUTERIUM);

View File

@ -0,0 +1,161 @@
package com.hbm.tileentity.machine.rbmk;
import java.util.ArrayList;
import java.util.List;
import com.hbm.interfaces.IFluidAcceptor;
import com.hbm.interfaces.IFluidSource;
import com.hbm.inventory.FluidTank;
import com.hbm.inventory.fluid.FluidType;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.lib.Library;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityHeatex extends TileEntity implements IFluidAcceptor, IFluidSource {
public List<IFluidAcceptor> coolantList = new ArrayList();
public List<IFluidAcceptor> waterList = new ArrayList();
public FluidTank coolantIn;
public FluidTank coolantOut;
public FluidTank waterIn;
public FluidTank waterOut;
public double heatBuffer;
public static final double maxHeat = 10_000;
public TileEntityHeatex() {
coolantIn = new FluidTank(Fluids.COOLANT_HOT, 1000, 0);
coolantOut = new FluidTank(Fluids.COOLANT, 1000, 1);
waterIn = new FluidTank(Fluids.WATER, 1000, 2);
waterOut = new FluidTank(Fluids.SUPERHOTSTEAM, 1000, 3);
}
@Override
public void updateEntity() {
if(!worldObj.isRemote) {
/* Cool input */
double heatCap = maxHeat - heatBuffer;
int fillCap = coolantOut.getMaxFill() - coolantOut.getFill();
double deltaT = coolantIn.getTankType().temperature - coolantOut.getTankType().temperature;
double heatPot = coolantIn.getFill() * coolantIn.getTankType().heatCap * deltaT;
double heatEff = Math.min(heatCap, heatPot);
int convertMax = (int) (heatEff / (coolantIn.getTankType().heatCap * deltaT));
int convertEff = Math.min(convertMax, fillCap);
coolantIn.setFill(coolantIn.getFill() - convertEff);
coolantOut.setFill(coolantOut.getFill() + convertEff);
this.heatBuffer += convertEff * coolantIn.getTankType().heatCap * deltaT;
double HEAT_PER_MB_WATER = RBMKDials.getBoilerHeatConsumption(worldObj);
/* Heat water */
int waterCap = waterOut.getMaxFill() - waterOut.getFill();
int maxBoil = (int) Math.min(waterIn.getFill(), heatBuffer / HEAT_PER_MB_WATER);
int boilEff = Math.min(maxBoil, waterCap);
waterIn.setFill(waterIn.getFill() - boilEff);
waterOut.setFill(waterOut.getFill() + boilEff);
this.heatBuffer -= boilEff * HEAT_PER_MB_WATER;
coolantIn.updateTank(this, 15);
coolantOut.updateTank(this, 15);
waterIn.updateTank(this, 15);
waterOut.updateTank(this, 15);
this.fillFluidInit(coolantOut.getTankType());
this.fillFluidInit(waterOut.getTankType());
}
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
this.coolantIn.readFromNBT(nbt, "cI");
this.coolantOut.readFromNBT(nbt, "cO");
this.waterIn.readFromNBT(nbt, "wI");
this.waterOut.readFromNBT(nbt, "wO");
this.heatBuffer = nbt.getDouble("heat");
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
this.coolantIn.writeToNBT(nbt, "cI");
this.coolantOut.writeToNBT(nbt, "cO");
this.waterIn.writeToNBT(nbt, "wI");
this.waterOut.writeToNBT(nbt, "wO");
nbt.setDouble("heat", this.heatBuffer);
}
@Override
public void setFillForSync(int fill, int index) {
if(index == 0) coolantIn.setFill(fill);
if(index == 1) coolantOut.setFill(fill);
if(index == 2) waterIn.setFill(fill);
if(index == 3) waterOut.setFill(fill);
}
@Override
public void setFluidFill(int fill, FluidType type) {
if(type == coolantIn.getTankType()) coolantIn.setFill(fill);
if(type == coolantOut.getTankType()) coolantOut.setFill(fill);
if(type == waterIn.getTankType()) waterIn.setFill(fill);
if(type == waterOut.getTankType()) waterOut.setFill(fill);
}
@Override
public void setTypeForSync(FluidType type, int index) {
if(index == 0) coolantIn.setTankType(type);
if(index == 1) coolantOut.setTankType(type);
if(index == 2) waterIn.setTankType(type);
if(index == 3) waterOut.setTankType(type);
}
@Override
public int getFluidFill(FluidType type) {
if(type == coolantIn.getTankType()) return coolantIn.getFill();
if(type == coolantOut.getTankType()) return coolantOut.getFill();
if(type == waterIn.getTankType()) return waterIn.getFill();
if(type == waterOut.getTankType()) return waterOut.getFill();
return 0;
}
@Override
public void fillFluidInit(FluidType type) {
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
fillFluid(this.xCoord + dir.offsetX, this.yCoord + dir.offsetY, this.zCoord + dir.offsetZ, getTact(), type);
}
@Override
public void fillFluid(int x, int y, int z, boolean newTact, FluidType type) {
Library.transmitFluid(x, y, z, newTact, this, worldObj, type);
}
@Override
@Deprecated
public boolean getTact() { return worldObj.getTotalWorldTime() % 2 == 0; }
@Override
public List<IFluidAcceptor> getFluidList(FluidType type) {
if(type == coolantOut.getTankType()) return this.coolantList;
if(type == waterOut.getTankType()) return this.waterList;
return new ArrayList();
}
@Override
public void clearFluidList(FluidType type) {
if(type == coolantOut.getTankType()) this.coolantList.clear();
if(type == waterOut.getTankType()) this.waterList.clear();
}
@Override
public int getMaxFluidFill(FluidType type) {
if(type == coolantIn.getTankType()) return coolantIn.getMaxFill();
if(type == waterIn.getTankType()) return waterIn.getMaxFill();
return 0;
}
}

View File

@ -57,7 +57,7 @@ public class TileEntityRBMKBoiler extends TileEntityRBMKSlottedBase implements I
steam.setFill(steam.getMaxFill());
}
this.heat -= waterUsed * RBMKDials.getBoilerHeatConsumption(worldObj);
this.heat -= waterUsed * feed.getTankType().heatCap;
}
fillFluidInit(steam.getTankType());
@ -66,7 +66,7 @@ public class TileEntityRBMKBoiler extends TileEntityRBMKSlottedBase implements I
super.updateEntity();
}
public double getHeatFromSteam(FluidType type) {
public static double getHeatFromSteam(FluidType type) {
if(type == Fluids.STEAM) return 100D;
if(type == Fluids.HOTSTEAM) return 300D;
if(type == Fluids.SUPERHOTSTEAM) return 450D;
@ -74,7 +74,7 @@ public class TileEntityRBMKBoiler extends TileEntityRBMKSlottedBase implements I
return 0D;
}
public double getFactorFromSteam(FluidType type) {
public static double getFactorFromSteam(FluidType type) {
if(type == Fluids.STEAM) return 1D;
if(type == Fluids.HOTSTEAM) return 10D;
if(type == Fluids.SUPERHOTSTEAM) return 100D;
@ -202,10 +202,10 @@ public class TileEntityRBMKBoiler extends TileEntityRBMKSlottedBase implements I
if(data.hasKey("compression")) {
FluidType type = steam.getTankType();
if(type == Fluids.STEAM) { steam.setTankType(Fluids.HOTSTEAM); steam.setFill(steam.getFill() / 10); }
if(type == Fluids.HOTSTEAM) { steam.setTankType(Fluids.SUPERHOTSTEAM); steam.setFill(steam.getFill() / 10); }
if(type == Fluids.SUPERHOTSTEAM) { steam.setTankType(Fluids.ULTRAHOTSTEAM); steam.setFill(steam.getFill() / 10); }
if(type == Fluids.ULTRAHOTSTEAM) { steam.setTankType(Fluids.STEAM); steam.setFill(Math.min(steam.getFill() * 1000, steam.getMaxFill())); }
if(type == Fluids.STEAM) { steam.setTankType(Fluids.HOTSTEAM); steam.setFill(steam.getFill() / 10); }
if(type == Fluids.HOTSTEAM) { steam.setTankType(Fluids.SUPERHOTSTEAM); steam.setFill(steam.getFill() / 10); }
if(type == Fluids.SUPERHOTSTEAM) { steam.setTankType(Fluids.ULTRAHOTSTEAM); steam.setFill(steam.getFill() / 10); }
if(type == Fluids.ULTRAHOTSTEAM) { steam.setTankType(Fluids.STEAM); steam.setFill(Math.min(steam.getFill() * 1000, steam.getMaxFill())); }
this.markDirty();
}

View File

@ -276,7 +276,8 @@ public class TileEntityRBMKConsole extends TileEntityMachineBase implements ICon
OUTGASSER(80),
BREEDER(100),
STORAGE(110),
COOLER(120);
COOLER(120),
HEATEX(130);
public int offset;

View File

@ -0,0 +1,163 @@
package com.hbm.tileentity.machine.rbmk;
import java.util.ArrayList;
import java.util.List;
import com.hbm.blocks.ModBlocks;
import com.hbm.interfaces.IFluidAcceptor;
import com.hbm.interfaces.IFluidSource;
import com.hbm.inventory.FluidTank;
import com.hbm.inventory.fluid.FluidType;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.lib.Library;
import com.hbm.tileentity.machine.rbmk.TileEntityRBMKConsole.ColumnType;
public class TileEntityRBMKHeater extends TileEntityRBMKSlottedBase implements IFluidAcceptor, IFluidSource {
public FluidTank feed;
public FluidTank steam;
public List<IFluidAcceptor> list = new ArrayList();
public TileEntityRBMKHeater() {
super(1);
}
@Override
public String getName() {
return "container.rbmkHeater";
}
@Override
public ColumnType getConsoleType() {
return ColumnType.HEATEX;
}
@Override
public void updateEntity() {
if(!worldObj.isRemote) {
feed.updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId);
steam.updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId);
double heatCap = this.getConversionHeat(feed.getTankType());
double heatProvided = this.heat - heatCap;
if(heatProvided > 0) {
int converted = (int)Math.floor(heatProvided / RBMKDials.getBoilerHeatConsumption(worldObj));
converted = Math.min(converted, feed.getFill());
converted = Math.min(converted, steam.getMaxFill() - steam.getFill());
feed.setFill(feed.getFill() - converted);
steam.setFill(steam.getFill() + converted);
this.heat -= converted * RBMKDials.getBoilerHeatConsumption(worldObj);
}
fillFluidInit(steam.getTankType());
}
super.updateEntity();
}
public static double getConversionHeat(FluidType type) {
return getConversion(type).temperature;
}
public static FluidType getConversion(FluidType type) {
if(type == Fluids.MUG) return Fluids.MUG_HOT;
if(type == Fluids.COOLANT) return Fluids.COOLANT_HOT;
return Fluids.NONE;
}
@Override
public void fillFluidInit(FluidType type) {
fillFluid(this.xCoord, this.yCoord + RBMKDials.getColumnHeight(worldObj) + 1, this.zCoord, getTact(), type);
if(worldObj.getBlock(xCoord, yCoord - 1, zCoord) == ModBlocks.rbmk_loader) {
fillFluid(this.xCoord + 1, this.yCoord - 1, this.zCoord, getTact(), type);
fillFluid(this.xCoord - 1, this.yCoord - 1, this.zCoord, getTact(), type);
fillFluid(this.xCoord, this.yCoord - 1, this.zCoord + 1, getTact(), type);
fillFluid(this.xCoord, this.yCoord - 1, this.zCoord - 1, getTact(), type);
fillFluid(this.xCoord, this.yCoord - 2, this.zCoord, getTact(), type);
}
if(worldObj.getBlock(xCoord, yCoord - 2, zCoord) == ModBlocks.rbmk_loader) {
fillFluid(this.xCoord + 1, this.yCoord - 2, this.zCoord, getTact(), type);
fillFluid(this.xCoord - 1, this.yCoord - 2, this.zCoord, getTact(), type);
fillFluid(this.xCoord, this.yCoord - 2, this.zCoord + 1, getTact(), type);
fillFluid(this.xCoord, this.yCoord - 2, this.zCoord - 1, getTact(), type);
fillFluid(this.xCoord, this.yCoord - 1, this.zCoord, getTact(), type);
fillFluid(this.xCoord, this.yCoord - 3, this.zCoord, getTact(), type);
}
}
@Override
public void fillFluid(int x, int y, int z, boolean newTact, FluidType type) {
Library.transmitFluid(x, y, z, newTact, this, worldObj, type);
}
@Override
@Deprecated //why are we still doing this?
public boolean getTact() { return worldObj.getTotalWorldTime() % 2 == 0; }
@Override
public void setFluidFill(int i, FluidType type) {
if(type == feed.getTankType())
feed.setFill(i);
else if(type == steam.getTankType())
steam.setFill(i);
}
@Override
public int getFluidFill(FluidType type) {
if(type == feed.getTankType())
return feed.getFill();
else if(type == steam.getTankType())
return steam.getFill();
return 0;
}
@Override
public int getMaxFluidFill(FluidType type) {
if(type == feed.getTankType())
return feed.getMaxFill();
else if(type == steam.getTankType())
return steam.getMaxFill();
return 0;
}
@Override
public void setFillForSync(int fill, int index) {
if(index == 0)
feed.setFill(fill);
else if(index == 1)
steam.setFill(fill);
}
@Override
public void setTypeForSync(FluidType type, int index) {
if(index == 0)
feed.setTankType(type);
else if(index == 1)
steam.setTankType(type);
}
@Override
public List<IFluidAcceptor> getFluidList(FluidType type) {
return list;
}
@Override
public void clearFluidList(FluidType type) {
list.clear();
}
}

View File

@ -1,7 +1,5 @@
package com.hbm.tileentity.machine.rbmk;
import java.util.List;
import com.hbm.blocks.machine.rbmk.RBMKBase;
import com.hbm.interfaces.IFluidAcceptor;
import com.hbm.inventory.FluidTank;
@ -12,7 +10,6 @@ import net.minecraft.block.Block;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
import scala.actors.threadpool.Arrays;
public class TileEntityRBMKInlet extends TileEntity implements IFluidAcceptor {

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 701 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 675 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB