use of buildcraft.api.transport.pipe.IItemPipe in project BuildCraft by BuildCraft.
the class TilePipeHolder method onPlacedBy.
// Misc
@Override
public void onPlacedBy(EntityLivingBase placer, ItemStack stack) {
super.onPlacedBy(placer, stack);
Item item = stack.getItem();
if (item instanceof IItemPipe) {
PipeDefinition definition = ((IItemPipe) item).getDefinition();
this.pipe = new Pipe(this, definition);
eventBus.registerHandler(pipe.behaviour);
eventBus.registerHandler(pipe.flow);
if (pipe.flow instanceof IFlowItems) {
eventBus.registerHandler(FilterEventHandler.class);
}
int meta = stack.getMetadata();
if (meta > 0 && meta <= 16) {
pipe.setColour(EnumDyeColor.byMetadata(meta - 1));
}
}
scheduleRenderUpdate();
}
Aggregations