Some misc fixes

I may have to move to seperate inputs/outputs
This commit is contained in:
malte0811 2018-06-15 21:11:25 +02:00
parent 375c30d139
commit 5364b14f5b
3 changed files with 10 additions and 6 deletions

View file

@ -207,6 +207,8 @@ public class TileEntityIC2ConnectorTin extends TileEntityImmersiveConnectable im
final double insert = Math.min(maxStored - bufferToMachine, eu);
if (!simulate) {
bufferToMachine += insert;
} else {
//Yes, this is weird. But it works, otherwise the system can get stuck at a lower output rate with a full buffer
ieInputInTick += insert;
}
return eu - insert;

View file

@ -222,7 +222,7 @@ public abstract class MechPartEnergyIO extends MechMBPart implements IMBPartElec
public double getOfferedEnergy() {
if (wfToWorld.isDC() && getLastIOState().canSwitchToOutput()) {
return Math.min(ConversionUtil.euPerJoule()*bufferToWorld,
ConversionUtil.euPerJoule()*getMaxBuffer()/getEnergyConnections().size()*2);
ConversionUtil.euPerJoule()*getMaxBuffer())/getEnergyConnections().size()*2;
}
return 0;
}
@ -231,7 +231,7 @@ public abstract class MechPartEnergyIO extends MechMBPart implements IMBPartElec
public double getDemandedEnergy() {
if (getLastIOState().canSwitchToInput()) {
return Math.min(ConversionUtil.euPerJoule()*(getMaxBuffer()-bufferToMB),
ConversionUtil.euPerJoule()*getMaxBuffer()/getEnergyConnections().size()*2);
ConversionUtil.euPerJoule()*getMaxBuffer())/getEnergyConnections().size()*2;
}
return 0;
}

View file

@ -178,10 +178,12 @@ public class MechPartSpeedometer extends MechMBPart implements IPlayerInteractio
}
return true;
} else if (OreDictionary.itemMatches(heldItem, voltMeter, false)) {
double speed = energy!=null?energy.getSpeed():0;
ChatUtils.sendServerNoSpamMessages(player,
new TextComponentTranslation(IndustrialWires.MODID + ".chat.currSpeed",
format.format(speed), format.format(speed*60D/(2*Math.PI))));
if (!world.isRemote) {
double speed = energy != null ? energy.getSpeed() : 0;
ChatUtils.sendServerNoSpamMessages(player,
new TextComponentTranslation(IndustrialWires.MODID + ".chat.currSpeed",
format.format(speed), format.format(speed * 60D / (2 * Math.PI))));
}
return true;
}
return false;