mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-23 21:39:40 +00:00
A few fixes, need to fix an output issue
This commit is contained in:
1 parent
5747c9f904
commit
af4c1c6cd7
10 files changed
+157
-69
No files matched your search
@@ -54,7 +54,7 @@ public class TileEntityInductionCasing extends TileEntityMultiblock<Synchronized
|
||||
|
||||
if(structure != null)
|
||||
{
|
||||
data.add(structure.electricityStored);
|
||||
data.add(structure.getEnergy(worldObj));
|
||||
data.add(structure.storageCap);
|
||||
data.add(structure.outputCap);
|
||||
data.add(structure.lastOutput);
|
||||
@@ -77,7 +77,7 @@ public class TileEntityInductionCasing extends TileEntityMultiblock<Synchronized
|
||||
|
||||
if(clientHasStructure)
|
||||
{
|
||||
structure.electricityStored = dataStream.readDouble();
|
||||
structure.clientEnergy = dataStream.readDouble();
|
||||
structure.storageCap = dataStream.readDouble();
|
||||
structure.outputCap = dataStream.readDouble();
|
||||
structure.lastOutput = dataStream.readDouble();
|
||||
@@ -123,7 +123,13 @@ public class TileEntityInductionCasing extends TileEntityMultiblock<Synchronized
|
||||
@Override
|
||||
public double getEnergy()
|
||||
{
|
||||
return structure != null ? structure.electricityStored : 0;
|
||||
if(!worldObj.isRemote)
|
||||
{
|
||||
return structure != null ? structure.getEnergy(worldObj) : 0;
|
||||
}
|
||||
else {
|
||||
return structure.clientEnergy;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -131,7 +137,7 @@ public class TileEntityInductionCasing extends TileEntityMultiblock<Synchronized
|
||||
{
|
||||
if(structure != null)
|
||||
{
|
||||
structure.electricityStored = Math.max(Math.min(energy, getMaxEnergy()), 0);
|
||||
structure.setEnergy(worldObj, Math.max(Math.min(energy, getMaxEnergy()), 0));
|
||||
MekanismUtils.saveChunk(this);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user