mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
FENSU and DFC fixes
This commit is contained in:
parent
157456a0c8
commit
6b381821b8
@ -43,6 +43,7 @@ public class TileEntityCoreEmitter extends TileEntityMachineBase implements IEne
|
||||
public boolean isOn;
|
||||
public FluidTank tank;
|
||||
public long prev;
|
||||
public static long maxJoules = Long.MAX_VALUE / 100_000;
|
||||
|
||||
public static final int range = 50;
|
||||
|
||||
@ -98,6 +99,8 @@ public class TileEntityCoreEmitter extends TileEntityMachineBase implements IEne
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata());
|
||||
for(int i = 1; i <= range; i++) {
|
||||
|
||||
if(out > maxJoules) out = maxJoules;
|
||||
|
||||
beam = i;
|
||||
|
||||
int x = xCoord + dir.offsetX * i;
|
||||
|
||||
@ -146,4 +146,30 @@ public class TileEntityMachineFENSU extends TileEntityMachineBattery {
|
||||
public double getMaxRenderDistanceSquared() {
|
||||
return 65536.0D;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long transferPower(long power) {
|
||||
|
||||
long overshoot = 0;
|
||||
|
||||
// if power exceeds our transfer limit, truncate
|
||||
if(power > maxTransfer) {
|
||||
overshoot += power - maxTransfer;
|
||||
power = maxTransfer;
|
||||
}
|
||||
|
||||
// this check is in essence the same as the default implementation, but re-arranged to never overflow the int64 range
|
||||
// if the remaining power exceeds the power cap, truncate again
|
||||
long freespace = this.getMaxPower() - this.getPower();
|
||||
|
||||
if(freespace < power) {
|
||||
overshoot += power - freespace;
|
||||
power = freespace;
|
||||
}
|
||||
|
||||
// what remains is sure to not exceed the transfer limit and the power cap (and therefore the int64 range)
|
||||
this.setPower(this.getPower() + power);
|
||||
|
||||
return overshoot;
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.2 KiB |
BIN
src/main/resources/assets/hbm/textures/gui/reactors/gui_pwr.png
Normal file
BIN
src/main/resources/assets/hbm/textures/gui/reactors/gui_pwr.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.7 KiB |
Loading…
x
Reference in New Issue
Block a user