Merge pull request #363 from TehTemmie/patch-2

Fixed rounding errors with large reactor
This commit is contained in:
HbmMods 2021-12-10 08:46:15 +01:00 committed by GitHub
commit 6df784986b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -374,7 +374,7 @@ public class TileEntityMachineReactorLarge extends TileEntity
private void generate() {
int consumption = (maxFuel / cycleDuration) * rods / 100;
int consumption = (int) (((double)maxFuel / cycleDuration) * rods / 100);
if(consumption > fuel)
consumption = fuel;
@ -385,7 +385,7 @@ public class TileEntityMachineReactorLarge extends TileEntity
fuel -= consumption;
waste += consumption;
int heat = (consumption / size) * type.heat / fuelMult;
int heat = (int) (((double)consumption / size) * type.heat / fuelMult);
this.coreHeat += heat;