fix fluid valves not deactivating (was clearing power net rather than fluid net connections)

This commit is contained in:
George Paton 2025-03-24 11:49:53 +11:00
parent d6c15c8ff2
commit 6db42e6d4b

View File

@ -1,26 +1,27 @@
package com.hbm.tileentity.network; package com.hbm.tileentity.network;
import api.hbm.energymk2.Nodespace; import com.hbm.uninos.UniNodespace;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.world.World; import net.minecraft.world.World;
public class TileEntityFluidValve extends TileEntityPipeBaseNT { public class TileEntityFluidValve extends TileEntityPipeBaseNT {
@Override @Override
public boolean shouldCreateNode() { public boolean shouldCreateNode() {
return this.getBlockMetadata() == 1; return this.getBlockMetadata() == 1;
} }
public void updateState() { public void updateState() {
this.blockMetadata = -1; // delete cache this.blockMetadata = -1; // delete cache
if(this.getBlockMetadata() == 0 && this.node != null) { if(this.getBlockMetadata() == 0 && this.node != null) {
Nodespace.destroyNode(worldObj, xCoord, yCoord, zCoord); UniNodespace.destroyNode(worldObj, xCoord, yCoord, zCoord, this.getType().getNetworkProvider());
this.node = null; this.node = null;
} }
} }
@Override @Override
public boolean shouldRefresh(Block oldBlock, Block newBlock, int oldMeta, int newMeta, World world, int x, int y, int z) { public boolean shouldRefresh(Block oldBlock, Block newBlock, int oldMeta, int newMeta, World world, int x, int y, int z) {
return oldBlock != newBlock; return oldBlock != newBlock;