mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-26 14:52:58 +00:00
New "InternalMultiblock" framework to allow for easier multiblock component management, added "hot" state to superheating elements
This commit is contained in:
1 parent
5dcddaf25b
commit
e6f4102087
19 files changed
+237
-121
No files matched your search
@@ -1,13 +1,48 @@
|
||||
package mekanism.common.tile;
|
||||
|
||||
public class TileEntitySuperheatingElement extends TileEntityBasicBlock
|
||||
import mekanism.common.content.boiler.SynchronizedBoilerData;
|
||||
import mekanism.common.multiblock.TileEntityInternalMultiblock;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
|
||||
public class TileEntitySuperheatingElement extends TileEntityInternalMultiblock
|
||||
{
|
||||
public boolean prevHot;
|
||||
|
||||
@Override
|
||||
public void setMultiblock(String id)
|
||||
{
|
||||
if(id == null && multiblockUUID != null)
|
||||
{
|
||||
SynchronizedBoilerData.clientHotMap.remove(multiblockUUID);
|
||||
}
|
||||
|
||||
super.setMultiblock(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUpdate()
|
||||
{
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onUpdate() {}
|
||||
public void onUpdate()
|
||||
{
|
||||
if(worldObj.isRemote)
|
||||
{
|
||||
boolean newHot = false;
|
||||
|
||||
if(multiblockUUID != null && SynchronizedBoilerData.clientHotMap.get(multiblockUUID) != null)
|
||||
{
|
||||
newHot = SynchronizedBoilerData.clientHotMap.get(multiblockUUID);
|
||||
}
|
||||
|
||||
if(prevHot != newHot)
|
||||
{
|
||||
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
|
||||
|
||||
prevHot = newHot;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user