From 10613f22ded27779602b20c7a5d17b13ba22d48b Mon Sep 17 00:00:00 2001 From: Boblet Date: Fri, 6 Mar 2026 13:56:39 +0100 Subject: [PATCH] the spingus --- changelog | 8 +- .../machine/TileEntityTurbineBase.java | 2 +- .../machine/rbmk/TileEntityRBMKBase.java | 15 +- .../machine/rbmk/TileEntityRBMKCooler.java | 183 +++++++++--------- .../machine/rbmk/TileEntityRBMKHeater.java | 7 +- .../blocks/rbmk/rbmk_absorber_cover_top.png | Bin 285 -> 325 bytes .../textures/blocks/rbmk/rbmk_cooler_side.png | Bin 364 -> 440 bytes .../blocks/rbmk/rbmk_moderator_cover_top.png | Bin 307 -> 381 bytes .../blocks/rbmk/rbmk_moderator_top.png | Bin 452 -> 460 bytes 9 files changed, 105 insertions(+), 110 deletions(-) diff --git a/changelog b/changelog index d831c9401..9be2b3edd 100644 --- a/changelog +++ b/changelog @@ -37,6 +37,11 @@ * There is now a second passive cooling variable used for rods on the inside (`dialPassiveCoolingInner`, 0.1°C/t by default) * The effective passive cooling value is scaled smoothly depending on how many sides are exposed, using `dialPassiveCoolingInner` with no exposed sides and `dialPassiveCooling` for rods with four exposed sides * Simply put, spindly RBMKs are now way less desirable, structural columns no longer just debuff the reactor and reactors that actually look like reactors are now more powerful +* Chanced the way RBMK coolers work + * Instead of using cryogel, coolers use 50mB of cold PFM per tick and return an equal amount of warm PFM + * In a 5x5 square around the cooler, all components are cooled down by 200°C per tick, down to a minimum of 20°C + * This renders that section of the reactor unsuitable for boiling water, however it means very high heat fuels can be used + * Cold PFM is used up at a steady rate, even if the reactor is already cold ## Fixed * Fixed NBTStack serialization omitting the stack size most of the time, preventing deserialization (mainly in the precision assembler config) @@ -46,4 +51,5 @@ * Fixed outdated info on the QMAW pages involving AA and BSCCO due to the fusion reactor update * Fixed ammo container giving 9mm instead of .22 for the akimbo target pistols * Fixed RBMK control rods incorrectly showing up in the red group when no group is set -* Fixed fluid output direction being incorrect on boilers, causing them to break with pipe anchors \ No newline at end of file +* Fixed fluid output direction being incorrect on boilers, causing them to break with pipe anchors +* Fixed an issue where the industrial turbine's tendency to round up the possible operation counter would cause it to use up steam it doesn't actually have diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityTurbineBase.java b/src/main/java/com/hbm/tileentity/machine/TileEntityTurbineBase.java index 7e4bedee8..aa76b01d1 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityTurbineBase.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityTurbineBase.java @@ -59,7 +59,7 @@ public abstract class TileEntityTurbineBase extends TileEntityLoadedBase impleme double eff = trait.getEfficiency(CoolingType.TURBINE) * getEfficiency(); if(eff > 0) { tanks[1].setTankType(trait.coolsTo); - int inputOps = (int) Math.ceil((tanks[0].getFill() * consumptionPercent()) / trait.amountReq); + int inputOps = (int) (Math.min(Math.ceil(tanks[0].getFill() * consumptionPercent()), tanks[0].getFill()) / trait.amountReq); int outputOps = (tanks[1].getMaxFill() - tanks[1].getFill()) / trait.amountProduced; int ops = Math.min(inputOps, outputOps); if(ops > 0) { diff --git a/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKBase.java b/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKBase.java index e485c2603..a0952b330 100644 --- a/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKBase.java +++ b/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKBase.java @@ -83,10 +83,10 @@ public abstract class TileEntityRBMKBase extends TileEntityLoadedBase { * Requires the amount of connected neighbors to scale cooling * @return */ - public double passiveCooling(int members) { + public double passiveCooling(int neighbors) { double min = RBMKDials.getPassiveCoolingInner(worldObj); //default: 0.1D double max = RBMKDials.getPassiveCooling(worldObj); //default: 1.0D - return min + (max - min) * ((4 - members) / 4D); + return min + (max - min) * ((4 - MathHelper.clamp_int(neighbors, 0, 4)) / 4D); } //necessary checks to figure out whether players are close enough to ensure that the reactor can be safely used @@ -222,7 +222,7 @@ public abstract class TileEntityRBMKBase extends TileEntityLoadedBase { } this.worldObj.theProfiler.endStartSection("rbmkBase_rpassive_cooling"); - coolPassively(members); + coolPassively(members - 1); this.worldObj.theProfiler.endSection(); } @@ -246,12 +246,9 @@ public abstract class TileEntityRBMKBase extends TileEntityLoadedBase { } } - protected void coolPassively(int members) { - - this.heat -= this.passiveCooling(members); - - if(heat < 20) - heat = 20D; + protected void coolPassively(int neighbors) { + this.heat -= this.passiveCooling(neighbors); + if(heat < 20) heat = 20D; } public RBMKType getRBMKType() { diff --git a/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKCooler.java b/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKCooler.java index fe3ddc71d..5227b0b81 100644 --- a/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKCooler.java +++ b/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKCooler.java @@ -1,135 +1,148 @@ package com.hbm.tileentity.machine.rbmk; -import api.hbm.fluid.IFluidStandardReceiver; +import api.hbm.fluidmk2.IFluidStandardTransceiverMK2; + +import com.hbm.blocks.ModBlocks; import com.hbm.handler.CompatHandler; import com.hbm.inventory.fluid.Fluids; import com.hbm.inventory.fluid.tank.FluidTank; import com.hbm.lib.Library; import com.hbm.tileentity.machine.rbmk.TileEntityRBMKConsole.ColumnType; +import com.hbm.util.Compat; +import com.hbm.util.fauxpointtwelve.DirPos; + import cpw.mods.fml.common.Optional; import io.netty.buffer.ByteBuf; import li.cil.oc.api.machine.Arguments; import li.cil.oc.api.machine.Callback; import li.cil.oc.api.machine.Context; import li.cil.oc.api.network.SimpleComponent; -import net.minecraft.entity.Entity; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.DamageSource; - -import java.util.List; +import net.minecraft.tileentity.TileEntity; @Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")}) -public class TileEntityRBMKCooler extends TileEntityRBMKBase implements IFluidStandardReceiver, SimpleComponent, CompatHandler.OCComponent { +public class TileEntityRBMKCooler extends TileEntityRBMKBase implements IFluidStandardTransceiverMK2, SimpleComponent, CompatHandler.OCComponent { - private FluidTank tank; - private int lastCooled; + protected int timer = 0; + private FluidTank[] tanks; + protected TileEntityRBMKBase[] neighborCache = new TileEntityRBMKBase[25]; public TileEntityRBMKCooler() { super(); - this.tank = new FluidTank(Fluids.CRYOGEL, 8_000); + this.tanks = new FluidTank[2]; + this.tanks[0] = new FluidTank(Fluids.PERFLUOROMETHYL_COLD, 4_000); + this.tanks[1] = new FluidTank(Fluids.PERFLUOROMETHYL, 4_000); } @Override public void updateEntity() { - if (!worldObj.isRemote) { - - if (this.worldObj.getTotalWorldTime() % 20 == 0) - this.trySubscribe(tank.getTankType(), worldObj, xCoord, yCoord - 1, zCoord, Library.NEG_Y); - - if ((int) (this.heat) > 750) { - - int heatProvided = (int) (this.heat - 750D); - int cooling = Math.min(heatProvided, tank.getFill()); - - this.heat -= cooling; - this.tank.setFill(this.tank.getFill() - cooling); - - this.lastCooled = cooling; - - if (lastCooled > 0) { - List entities = worldObj.getEntitiesWithinAABB(Entity.class, AxisAlignedBB.getBoundingBox(xCoord, yCoord + 4, zCoord, xCoord + 1, yCoord + 8, zCoord + 1)); - - for (Entity e : entities) { - e.setFire(5); - e.attackEntityFrom(DamageSource.inFire, 10); + if(!worldObj.isRemote) { + + if(timer <= 0) { + timer = 60; + + for(int i = 0; i < 25; i++) { + int x = xCoord - 2 + i / 5; + int z = zCoord - 2 + i % 5; + TileEntity tile = Compat.getTileStandard(worldObj, x, yCoord, z); + if(tile instanceof TileEntityRBMKBase) { + neighborCache[i] = (TileEntityRBMKBase) tile; + } else { + neighborCache[i] = null; } } + } else { - this.lastCooled = 0; + timer--; + } + + if(tanks[0].getFill() >= 50 && tanks[1].getMaxFill() - tanks[1].getFill() >= 50) { + tanks[0].setFill(tanks[0].getFill() - 50); + tanks[1].setFill(tanks[1].getFill() + 50); + + for(TileEntityRBMKBase neighbor : neighborCache) { + if(neighbor != null) { + neighbor.heat -= 200; + if(neighbor.heat < 20) neighbor.heat = 20; + } + } } - } else { - - if (this.lastCooled > 100) { - for (int i = 0; i < 2; i++) { - worldObj.spawnParticle("flame", xCoord + 0.25 + worldObj.rand.nextDouble() * 0.5, yCoord + 4.5, zCoord + 0.25 + worldObj.rand.nextDouble() * 0.5, 0, 0.2, 0); - worldObj.spawnParticle("smoke", xCoord + 0.25 + worldObj.rand.nextDouble() * 0.5, yCoord + 4.5, zCoord + 0.25 + worldObj.rand.nextDouble() * 0.5, 0, 0.2, 0); - } - - if (worldObj.rand.nextInt(20) == 0) - worldObj.spawnParticle("lava", xCoord + 0.25 + worldObj.rand.nextDouble() * 0.5, yCoord + 4.5, zCoord + 0.25 + worldObj.rand.nextDouble() * 0.5, 0, 0.0, 0); - } else if (this.lastCooled > 50) { - for (int i = 0; i < 2; i++) { - worldObj.spawnParticle("cloud", xCoord + 0.25 + worldObj.rand.nextDouble() * 0.5, yCoord + 4.5, zCoord + 0.25 + worldObj.rand.nextDouble() * 0.5, worldObj.rand.nextGaussian() * 0.05, 0.2, worldObj.rand.nextGaussian() * 0.05); - } - } else if (this.lastCooled > 0) { - - if (worldObj.getTotalWorldTime() % 2 == 0) - worldObj.spawnParticle("cloud", xCoord + 0.25 + worldObj.rand.nextDouble() * 0.5, yCoord + 4.5, zCoord + 0.25 + worldObj.rand.nextDouble() * 0.5, 0, 0.2, 0); - + this.trySubscribe(tanks[0].getTankType(), worldObj, xCoord, yCoord - 1, zCoord, Library.NEG_Y); + + if(this.tanks[1].getFill() > 0) for(DirPos pos : getOutputPos()) { + this.tryProvide(this.tanks[1], worldObj, pos); } + } super.updateEntity(); } + protected DirPos[] getOutputPos() { + + if(worldObj.getBlock(xCoord, yCoord - 1, zCoord) == ModBlocks.rbmk_loader) { + return new DirPos[] { + new DirPos(this.xCoord, this.yCoord + RBMKDials.getColumnHeight(worldObj) + 1, this.zCoord, Library.POS_Y), + new DirPos(this.xCoord + 1, this.yCoord - 1, this.zCoord, Library.POS_X), + new DirPos(this.xCoord - 1, this.yCoord - 1, this.zCoord, Library.NEG_X), + new DirPos(this.xCoord, this.yCoord - 1, this.zCoord + 1, Library.POS_Z), + new DirPos(this.xCoord, this.yCoord - 1, this.zCoord - 1, Library.NEG_Z), + new DirPos(this.xCoord, this.yCoord - 2, this.zCoord, Library.NEG_Y) + }; + } else if(worldObj.getBlock(xCoord, yCoord - 2, zCoord) == ModBlocks.rbmk_loader) { + return new DirPos[] { + new DirPos(this.xCoord, this.yCoord + RBMKDials.getColumnHeight(worldObj) + 1, this.zCoord, Library.POS_Y), + new DirPos(this.xCoord + 1, this.yCoord - 2, this.zCoord, Library.POS_X), + new DirPos(this.xCoord - 1, this.yCoord - 2, this.zCoord, Library.NEG_X), + new DirPos(this.xCoord, this.yCoord - 2, this.zCoord + 1, Library.POS_Z), + new DirPos(this.xCoord, this.yCoord - 2, this.zCoord - 1, Library.NEG_Z), + new DirPos(this.xCoord, this.yCoord - 3, this.zCoord, Library.NEG_Y) + }; + } else { + return new DirPos[] { + new DirPos(this.xCoord, this.yCoord + RBMKDials.getColumnHeight(worldObj) + 1, this.zCoord, Library.POS_Y) + }; + } + } + @Override public void readFromNBT(NBTTagCompound nbt) { super.readFromNBT(nbt); - tank.readFromNBT(nbt, "cryo"); - this.lastCooled = nbt.getInteger("cooled"); + tanks[0].readFromNBT(nbt, "t0"); + tanks[1].readFromNBT(nbt, "t1"); } @Override public void writeToNBT(NBTTagCompound nbt) { super.writeToNBT(nbt); - tank.writeToNBT(nbt, "cryo"); - nbt.setInteger("cooled", this.lastCooled); + tanks[0].writeToNBT(nbt, "t0"); + tanks[1].writeToNBT(nbt, "t1"); } @Override public void serialize(ByteBuf buf) { super.serialize(buf); - this.tank.serialize(buf); - buf.writeInt(this.lastCooled); + this.tanks[0].serialize(buf); + this.tanks[1].serialize(buf); } @Override public void deserialize(ByteBuf buf) { super.deserialize(buf); - this.tank.deserialize(buf); - this.lastCooled = buf.readInt(); + this.tanks[0].deserialize(buf); + this.tanks[1].deserialize(buf); } - @Override - public ColumnType getConsoleType() { - return ColumnType.COOLER; - } + @Override public ColumnType getConsoleType() { return ColumnType.COOLER; } - @Override - public FluidTank[] getAllTanks() { - return new FluidTank[]{tank}; - } - - @Override - public FluidTank[] getReceivingTanks() { - return new FluidTank[]{tank}; - } + @Override public FluidTank[] getAllTanks() { return tanks; } + @Override public FluidTank[] getReceivingTanks() { return new FluidTank[] {tanks[0]}; } + @Override public FluidTank[] getSendingTanks() { return new FluidTank[] {tanks[1]}; } //do some opencomputers stuff @@ -143,28 +156,6 @@ public class TileEntityRBMKCooler extends TileEntityRBMKBase implements IFluidSt public Object[] getHeat(Context context, Arguments args) { return new Object[]{heat}; } - - @Callback(direct = true) - @Optional.Method(modid = "OpenComputers") - public Object[] getCryo(Context context, Arguments args) { - return new Object[]{tank.getFill()}; - } - - @Callback(direct = true) - @Optional.Method(modid = "OpenComputers") - public Object[] getCryoMax(Context context, Arguments args) { - return new Object[]{tank.getMaxFill()}; - } - - @Callback(direct = true) - @Optional.Method(modid = "OpenComputers") - public Object[] getCoordinates(Context context, Arguments args) { - return new Object[] {xCoord, yCoord, zCoord}; - } - - @Callback(direct = true) - @Optional.Method(modid = "OpenComputers") - public Object[] getInfo(Context context, Arguments args) { - return new Object[]{heat, tank.getFill(), tank.getMaxFill(), xCoord, yCoord, zCoord}; - } + + // don't know shit about OC - someone else has to add those back } diff --git a/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKHeater.java b/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKHeater.java index dcc6b09f1..08397ddb2 100644 --- a/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKHeater.java +++ b/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKHeater.java @@ -1,6 +1,7 @@ package com.hbm.tileentity.machine.rbmk; -import api.hbm.fluid.IFluidStandardTransceiver; +import api.hbm.fluidmk2.IFluidStandardTransceiverMK2; + import com.hbm.blocks.ModBlocks; import com.hbm.entity.projectile.EntityRBMKDebris.DebrisType; import com.hbm.handler.CompatHandler; @@ -28,7 +29,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; @Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "opencomputers")}) -public class TileEntityRBMKHeater extends TileEntityRBMKSlottedBase implements IFluidStandardTransceiver, SimpleComponent, CompatHandler.OCComponent { +public class TileEntityRBMKHeater extends TileEntityRBMKSlottedBase implements IFluidStandardTransceiverMK2, SimpleComponent, CompatHandler.OCComponent { public FluidTank feed; public FluidTank steam; @@ -82,7 +83,7 @@ public class TileEntityRBMKHeater extends TileEntityRBMKSlottedBase implements I this.trySubscribe(feed.getTankType(), worldObj, xCoord, yCoord - 1, zCoord, Library.NEG_Y); for(DirPos pos : getOutputPos()) { - if(this.steam.getFill() > 0) this.sendFluid(steam, worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir()); + if(this.steam.getFill() > 0) this.tryProvide(steam, worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir()); } } diff --git a/src/main/resources/assets/hbm/textures/blocks/rbmk/rbmk_absorber_cover_top.png b/src/main/resources/assets/hbm/textures/blocks/rbmk/rbmk_absorber_cover_top.png index c530221bda61ae33e63a1395305060a87a799887..7f3357c8bde3e5f63e34ab866a15a5bdf39bfe18 100644 GIT binary patch delta 282 zcmV+#0puK5G=Ka_L_t(Ijh&OvO2jY_hd-Ah1VT@yeH0(Tw-*ss5pi9;rGqPk zK-iNWb|+4^*5b}-(&_h`f62wmzow!z8$wpF07*qoM6N<$f`s#fg8%>k delta 241 zcmV#vOSjvlUeo}1JRS{OuQ=pUq>Hp#P$7h1zu*7K zU^<;rFDmP*hGF3Qek)1!50K}%KHFk&zuz^3dK)R;$LhtlR4M`z;1)C!pF3)q8`1>PJec8Nic+FikFD$l`|sJh>Tw zUJj*NPyQWhe7b1;XHgU{8GKq6UqJx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