Boblet c16818c15d i can hear satan's voice, he's telling me to invest in apple.
what does this mean? why does he want me to buy apples??
2024-04-11 16:08:04 +02:00

56 lines
1.2 KiB
Java

package com.hbm.tileentity.network;
import api.hbm.energymk2.IEnergyConductorMK2;
import api.hbm.energymk2.Nodespace;
import api.hbm.energymk2.Nodespace.PowerNode;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityCableBaseNT extends TileEntity implements IEnergyConductorMK2 {
protected PowerNode node;
@Override
public void updateEntity() {
if(!worldObj.isRemote) {
if(this.node == null || this.node.expired) {
if(this.shouldCreateNode()) {
this.node = Nodespace.getNode(worldObj, xCoord, yCoord, zCoord);
if(this.node == null || this.node.expired) {
this.node = this.createNode();
Nodespace.createNode(worldObj, this.node);
}
}
}
}
}
public boolean shouldCreateNode() {
return true;
}
public void onNodeDestroyedCallback() {
this.node = null;
}
@Override
public void invalidate() {
super.invalidate();
if(!worldObj.isRemote) {
if(this.node != null) {
Nodespace.destroyNode(worldObj, xCoord, yCoord, zCoord);
}
}
}
@Override
public boolean canConnect(ForgeDirection dir) {
return dir != ForgeDirection.UNKNOWN;
}
}