fuck, whatever

This commit is contained in:
Boblet 2024-07-15 14:29:53 +02:00
parent f8465b5071
commit 02c9582b21
2 changed files with 16 additions and 16 deletions

View File

@ -22,8 +22,8 @@ public class TileEntityConverterHeRf extends TileEntityLoadedBase implements IEn
public long power;
public final long maxPower = 5_000_000;
public static long heInput = 1;
public static long rfOutput = 5;
public static long heInput = 5;
public static long rfOutput = 1;
public static double inputDecay = 0.05;
public EnergyStorage storage = new EnergyStorage(1_000_000, 1_000_000, 1_000_000);
@ -32,8 +32,8 @@ public class TileEntityConverterHeRf extends TileEntityLoadedBase implements IEn
if (!worldObj.isRemote) {
long rfCreated = Math.min(storage.getMaxEnergyStored() - storage.getEnergyStored(), power / rfOutput * heInput);
this.power -= rfCreated * rfOutput / heInput;
long rfCreated = Math.min(storage.getMaxEnergyStored() - storage.getEnergyStored(), power / heInput * rfOutput);
this.power -= rfCreated * heInput / rfOutput;
this.storage.setEnergyStored((int) (storage.getEnergyStored() + rfCreated));
if(power > 0) this.power *= (1D - inputDecay);
if(rfCreated > 0) this.worldObj.markTileEntityChunkModified(this.xCoord, this.yCoord, this.zCoord, this);
@ -91,15 +91,15 @@ public class TileEntityConverterHeRf extends TileEntityLoadedBase implements IEn
@Override
public void readIfPresent(JsonObject obj) {
heInput = IConfigurableMachine.grab(obj, "L:HEUsed", heInput);
rfOutput = IConfigurableMachine.grab(obj, "L:RFCreated", rfOutput);
heInput = IConfigurableMachine.grab(obj, "L:HE_Used", heInput);
rfOutput = IConfigurableMachine.grab(obj, "L:RF_Created", rfOutput);
inputDecay = IConfigurableMachine.grab(obj, "D:inputDecay", inputDecay);
}
@Override
public void writeConfig(JsonWriter writer) throws IOException {
writer.name("L:HEUsed").value(heInput);
writer.name("L:RFCreated").value(rfOutput);
writer.name("L:HE_Used").value(heInput);
writer.name("L:RF_Created").value(rfOutput);
writer.name("D:inputDecay").value(inputDecay);
}
}

View File

@ -17,8 +17,8 @@ public class TileEntityConverterRfHe extends TileEntityLoadedBase implements IEn
public long power;
public final long maxPower = 5_000_000;
public static long rfInput = 5;
public static long heOutput = 1;
public static long rfInput = 1;
public static long heOutput = 5;
public static double inputDecay = 0.05;
public EnergyStorage storage = new EnergyStorage(1_000_000, 1_000_000, 1_000_000);
@ -28,9 +28,9 @@ public class TileEntityConverterRfHe extends TileEntityLoadedBase implements IEn
if (!worldObj.isRemote) {
long rfCreated = Math.min(storage.getEnergyStored(), (maxPower - power) * heOutput / rfInput);
long rfCreated = Math.min(storage.getEnergyStored(), (maxPower - power) * rfInput / heOutput);
storage.setEnergyStored((int) (storage.getEnergyStored() - rfCreated));
power += rfCreated * rfInput / heOutput;
power += rfCreated * heOutput / rfInput;
if(storage.getEnergyStored() > 0) storage.extractEnergy((int) Math.ceil(storage.getEnergyStored() * inputDecay), false);
if(rfCreated > 0) this.worldObj.markTileEntityChunkModified(this.xCoord, this.yCoord, this.zCoord, this);
@ -73,15 +73,15 @@ public class TileEntityConverterRfHe extends TileEntityLoadedBase implements IEn
@Override
public void readIfPresent(JsonObject obj) {
rfInput = IConfigurableMachine.grab(obj, "L:RFUsed", rfInput);
heOutput = IConfigurableMachine.grab(obj, "L:HECreated", heOutput);
rfInput = IConfigurableMachine.grab(obj, "L:RF_Used", rfInput);
heOutput = IConfigurableMachine.grab(obj, "L:HE_Created", heOutput);
inputDecay = IConfigurableMachine.grab(obj, "D:inputDecay", inputDecay);
}
@Override
public void writeConfig(JsonWriter writer) throws IOException {
writer.name("L:RFUsed").value(rfInput);
writer.name("L:HECreated").value(heOutput);
writer.name("L:RF_Used").value(rfInput);
writer.name("L:HE_Created").value(heOutput);
writer.name("D:inputDecay").value(inputDecay);
}
}