use of buildcraft.transport.pipe.PluggableHolder in project BuildCraft by BuildCraft.
the class TilePipeHolder method replacePluggable.
public PipePluggable replacePluggable(EnumFacing side, PipePluggable with) {
redstoneValues = new int[6];
PluggableHolder holder = pluggables.get(side);
PipePluggable old = holder.pluggable;
holder.pluggable = with;
eventBus.unregisterHandler(old);
eventBus.registerHandler(with);
if (pipe != null) {
pipe.markForUpdate();
}
if (!world.isRemote && old != with) {
wireManager.getWireSystems().rebuildWireSystemsAround(this);
}
scheduleNetworkUpdate(PipeMessageReceiver.PLUGGABLES[side.getIndex()]);
scheduleRenderUpdate();
world.neighborChanged(pos.offset(side), BCTransportBlocks.pipeHolder, pos);
return old;
}
Aggregations