Search in sources :

Example 1 with PluggableHolder

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;
}
Also used : PluggableHolder(buildcraft.transport.pipe.PluggableHolder) PipePluggable(buildcraft.api.transport.pluggable.PipePluggable)

Aggregations

PipePluggable (buildcraft.api.transport.pluggable.PipePluggable)1 PluggableHolder (buildcraft.transport.pipe.PluggableHolder)1