mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
27 lines
680 B
Java
27 lines
680 B
Java
package com.hbm.tileentity.network;
|
|
|
|
import api.hbm.energymk2.Nodespace;
|
|
|
|
public class TileEntityCableSwitch extends TileEntityCableBaseNT {
|
|
|
|
@Override
|
|
public boolean canUpdate() {
|
|
return super.canUpdate();
|
|
}
|
|
|
|
public void updateState() {
|
|
|
|
//if the meta is 0 (OFF) and there is a net present, destroy and de-reference it.
|
|
//that should be all, since the state being 0 also prevents the TE from updating and joining the new net.
|
|
if(this.getBlockMetadata() == 0 && this.node != null) {
|
|
Nodespace.destroyNode(worldObj, xCoord, yCoord, zCoord);
|
|
this.node = null;
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public boolean shouldCreateNode() {
|
|
return this.getBlockMetadata() == 1;
|
|
}
|
|
}
|