use of buildcraft.transport.plug.PluggablePulsar in project BuildCraft by BuildCraft.
the class ItemPluggablePulsar method onPlace.
@Override
public PipePluggable onPlace(@Nonnull ItemStack stack, IPipeHolder holder, EnumFacing side, EntityPlayer player, EnumHand hand) {
IPipe pipe = holder.getPipe();
if (pipe == null) {
return null;
}
PipeBehaviour behaviour = pipe.getBehaviour();
if (behaviour instanceof IMjRedstoneReceiver) {
SoundUtil.playBlockPlace(holder.getPipeWorld(), holder.getPipePos());
return new PluggablePulsar(BCTransportPlugs.pulsar, holder, side);
} else {
return null;
}
}
use of buildcraft.transport.plug.PluggablePulsar in project BuildCraft by BuildCraft.
the class ActionPowerPulsar method actionActivate.
@Override
public void actionActivate(EnumFacing side, IStatementContainer source, IStatementParameter[] parameters) {
if (source instanceof IGate) {
IGate gate = (IGate) source;
IPipeHolder pipe = gate.getPipeHolder();
PipePluggable plug = pipe.getPluggable(side);
if (plug instanceof PluggablePulsar) {
PluggablePulsar pulsar = (PluggablePulsar) plug;
if (constant) {
pulsar.enablePulsar();
} else {
pulsar.addSinglePulse();
}
}
}
}
Aggregations