mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-23 21:39:40 +00:00
Reactor now auto-forms
This commit is contained in:
1 parent
22db67c895
commit
4090fcf490
14 files changed
+212
-80
No files matched your search
@@ -104,7 +104,9 @@ public abstract class TileEntityElectricBlock extends TileEntityContainerBlock i
|
||||
public void onUpdate()
|
||||
{
|
||||
if(MekanismUtils.useBuildCraft())
|
||||
{
|
||||
reconfigure();
|
||||
}
|
||||
}
|
||||
|
||||
public EnumSet<ForgeDirection> getOutputtingSides()
|
||||
@@ -157,12 +159,25 @@ public abstract class TileEntityElectricBlock extends TileEntityContainerBlock i
|
||||
data.add(getEnergy());
|
||||
return data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAdded()
|
||||
{
|
||||
super.onAdded();
|
||||
|
||||
if(MekanismUtils.useIC2())
|
||||
{
|
||||
register();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload()
|
||||
{
|
||||
if(MekanismUtils.useIC2())
|
||||
{
|
||||
deregister();
|
||||
}
|
||||
|
||||
super.onChunkUnload();
|
||||
}
|
||||
@@ -173,7 +188,9 @@ public abstract class TileEntityElectricBlock extends TileEntityContainerBlock i
|
||||
super.invalidate();
|
||||
|
||||
if(MekanismUtils.useIC2())
|
||||
{
|
||||
deregister();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -184,7 +201,9 @@ public abstract class TileEntityElectricBlock extends TileEntityContainerBlock i
|
||||
electricityStored = nbtTags.getDouble("electricityStored");
|
||||
|
||||
if(MekanismUtils.useBuildCraft())
|
||||
{
|
||||
reconfigure();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -210,7 +229,7 @@ public abstract class TileEntityElectricBlock extends TileEntityContainerBlock i
|
||||
@Method(modid = "BuildCraftAPI|power")
|
||||
protected void reconfigure()
|
||||
{
|
||||
powerHandler.configure(0, (float)((getMaxEnergy()-getEnergy())* general.TO_BC), 0, (float)(getMaxEnergy()* general.TO_BC));
|
||||
powerHandler.configure(0, (float)((getMaxEnergy()-getEnergy())*general.TO_BC), 0, (float)(getMaxEnergy()*general.TO_BC));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user