Search in sources :

Example 1 with PluggableLens

use of buildcraft.transport.plug.PluggableLens in project BuildCraft by BuildCraft.

the class ItemPluggableLens method onPlace.

@Override
public PipePluggable onPlace(@Nonnull ItemStack stack, IPipeHolder holder, EnumFacing side, EntityPlayer player, EnumHand hand) {
    IPipe pipe = holder.getPipe();
    if (pipe == null || !(pipe.getFlow() instanceof IFlowItems)) {
        return null;
    }
    LensData data = getData(stack);
    SoundUtil.playBlockPlace(holder.getPipeWorld(), holder.getPipePos(), Blocks.STONE.getDefaultState());
    PluggableDefinition def = BCTransportPlugs.lens;
    return new PluggableLens(def, holder, side, data.colour, data.isFilter);
}
Also used : PluggableLens(buildcraft.transport.plug.PluggableLens) PluggableDefinition(buildcraft.api.transport.pluggable.PluggableDefinition) IFlowItems(buildcraft.api.transport.pipe.IFlowItems) IPipe(buildcraft.api.transport.pipe.IPipe)

Aggregations

IFlowItems (buildcraft.api.transport.pipe.IFlowItems)1 IPipe (buildcraft.api.transport.pipe.IPipe)1 PluggableDefinition (buildcraft.api.transport.pluggable.PluggableDefinition)1 PluggableLens (buildcraft.transport.plug.PluggableLens)1