2023-06-29 16:08:32 +02:00

28 lines
567 B
Java

package com.hbm.tileentity.network;
import api.hbm.fluid.PipeNet;
public class TileEntityFluidValve extends TileEntityPipeBaseNT {
@Override
public boolean canUpdate() {
return this.worldObj != null && this.getBlockMetadata() == 1 && super.canUpdate();
}
public void updateState() {
if(this.getBlockMetadata() == 0 && this.network != null) {
this.network.destroy();
this.network = null;
}
if(this.getBlockMetadata() == 1) {
this.connect();
if(this.getPipeNet(type) == null) {
new PipeNet(type).joinLink(this);
}
}
}
}