mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-28 07:36:01 +00:00
Reactors now scale steam and water tank capacity to injection rate
This commit is contained in:
1 parent
0e1a08474c
commit
0961b7e042
2 files changed
+21
-2
No files matched your search
@@ -25,7 +25,6 @@ import mekanism.generators.common.item.ItemHohlraum;
|
||||
import mekanism.generators.common.tile.reactor.TileEntityReactorController;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemCoal;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
@@ -492,6 +491,21 @@ public class FusionReactor implements IFusionReactor
|
||||
public void setInjectionRate(int rate)
|
||||
{
|
||||
injectionRate = rate;
|
||||
|
||||
int capRate = Math.max(1, rate);
|
||||
|
||||
controller.waterTank.setCapacity(TileEntityReactorController.MAX_WATER*capRate);
|
||||
controller.steamTank.setCapacity(TileEntityReactorController.MAX_STEAM*capRate);
|
||||
|
||||
if(controller.waterTank.getFluid() != null)
|
||||
{
|
||||
controller.waterTank.getFluid().amount = Math.min(controller.waterTank.getFluid().amount, controller.waterTank.getCapacity());
|
||||
}
|
||||
|
||||
if(controller.steamTank.getFluid() != null)
|
||||
{
|
||||
controller.steamTank.getFluid().amount = Math.min(controller.steamTank.getFluid().amount, controller.steamTank.getCapacity());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user