本文整理汇总了Java中buildcraft.api.transport.IPipeTile类的典型用法代码示例。如果您正苦于以下问题:Java IPipeTile类的具体用法?Java IPipeTile怎么用?Java IPipeTile使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IPipeTile类属于buildcraft.api.transport包,在下文中一共展示了IPipeTile类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPipeTriggers
import buildcraft.api.transport.IPipeTile; //导入依赖的package包/类
public static List<ITrigger> getPipeTriggers(IPipeTile pipe) {
List<ITrigger> result = new LinkedList<ITrigger>();
for (ITriggerProvider provider : triggerProviders) {
List<ITrigger> toAdd = provider.getPipeTriggers(pipe);
if (toAdd != null) {
for (ITrigger t : toAdd) {
if (!result.contains(t)) {
result.add(t);
}
}
}
}
return result;
}
示例2: isBlockPipe
import buildcraft.api.transport.IPipeTile; //导入依赖的package包/类
public static boolean isBlockPipe(TileEntity tileEntity, ForgeDirection direction) {
if (Loader.isModLoaded(ModIDs.BUILDCRAFT)) {
if (tileEntity instanceof IPipeTile) {
if (((IPipeTile) tileEntity).isPipeConnected(direction.getOpposite())) {
return true;
}
}
}
if (Loader.isModLoaded(ModIDs.THERMAL_EXPANSION) || Loader.isModLoaded(ModIDs.THERMAL_DYNAMICS)) {
if (tileEntity instanceof IEnergyProvider) {
if (((IEnergyProvider) tileEntity).canConnectEnergy(direction.getOpposite())) {
return true;
}
}
}
return false;
}
示例3: getPipeTriggers
import buildcraft.api.transport.IPipeTile; //导入依赖的package包/类
public static List<ITrigger> getPipeTriggers(IPipeTile pipe) {
List<ITrigger> triggers = new LinkedList<ITrigger>();
for (ITriggerProvider provider : triggerProviders) {
List<ITrigger> toAdd = provider.getPipeTriggers(pipe);
if (toAdd != null) {
for (ITrigger t : toAdd) {
if (!triggers.contains(t)) {
triggers.add(t);
}
}
}
}
return triggers;
}
示例4: insert
import buildcraft.api.transport.IPipeTile; //导入依赖的package包/类
public static ItemStack insert(TileEntity tile, ItemStack itemStack, ForgeDirection side, boolean simulate) {
if (tile instanceof IRelocator) {
return ((IRelocator) tile).insert(itemStack, side.ordinal(), simulate);
} else if (Mods.IS_COFH_TRANSPORT_API_LOADED && tile instanceof IItemDuct) {
if (simulate) {
return null;
}
return ((IItemDuct) tile).insertItem(side, itemStack);
}
if (Mods.IS_BC_TRANSPORT_API_LOADED && tile instanceof IPipeTile) {
IPipeTile pipe = (IPipeTile) tile;
if (pipe.isPipeConnected(side)) {
int size = pipe.injectItem(itemStack, !simulate, side, null);
itemStack.stackSize -= size;
if (itemStack.stackSize == 0) {
return null;
}
return itemStack;
}
} else if (tile instanceof IInventory) {
return insert((IInventory) tile, itemStack, side.ordinal(), simulate);
}
return itemStack;
}
示例5: changeOrientation
import buildcraft.api.transport.IPipeTile; //导入依赖的package包/类
public boolean changeOrientation(boolean toPipe)
{
for (int n = this.orientation.ordinal() + 1; n <= orientation.ordinal() + 6; ++n)
{
ForgeDirection i = ForgeDirection.VALID_DIRECTIONS[n % 6];
TileEntity tile = this.tilesOnSides[i.ordinal()];
if ((!toPipe || tile instanceof IPipeTile) && ((tile instanceof IPowerReceptor) && ((IPowerReceptor)tile).getPowerReceiver(this.orientation) != null))
{
this.orientation = i;
if (!worldObj.isRemote)
{
MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this));
isAddedToENet = false;
}
this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
this.worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, this.worldObj.getBlockId(xCoord, yCoord, zCoord));
return true;
}
}
return false;
}
示例6: exportStackToBCPipe
import buildcraft.api.transport.IPipeTile; //导入依赖的package包/类
@Override
@Optional.Method(modid = ModIds.BUILDCRAFT)
public ItemStack exportStackToBCPipe(TileEntity te, ItemStack stack, ForgeDirection side){
if(isBCPipe(te)) {
int amount = ((IPipeTile)te).injectItem(stack, true, side);
stack.stackSize -= amount;
if(stack.stackSize <= 0) stack = null;
}
return stack;
}
示例7: canInterfaceWith
import buildcraft.api.transport.IPipeTile; //导入依赖的package包/类
public static boolean canInterfaceWith(TileEntity tile, ForgeDirection side) {
if (tile instanceof IRelocator) {
return ((IRelocator) tile).connectsToSide(side.ordinal());
} else if (Mods.IS_COFH_TRANSPORT_API_LOADED && tile instanceof IItemDuct) {
return true;
} else if (Mods.IS_BC_TRANSPORT_API_LOADED && tile instanceof IPipeTile) {
if (((IPipeTile) tile).getPipeType() == IPipeTile.PipeType.ITEM)
return true;
} else if (Mods.IS_BC_TRANSPORT_API_LOADED && tile instanceof IPipeConnection) {
return ((IPipeConnection) tile).overridePipeConnection(IPipeTile.PipeType.ITEM, side) != IPipeConnection.ConnectOverride.DISCONNECT;
} else if (tile instanceof IInventory) {
return !(tile instanceof ISidedInventory) || ((ISidedInventory) tile).getAccessibleSlotsFromSide(side.ordinal()).length > 0;
}
return false;
}
示例8: requestEnergy
import buildcraft.api.transport.IPipeTile; //导入依赖的package包/类
@Override
public float requestEnergy(ForgeDirection arg0, float arg1)
{
if (!(container.getTile(arg0) instanceof IPipeTile))
{
return 0;
}
return arg1;
}
示例9: getTargetClass
import buildcraft.api.transport.IPipeTile; //导入依赖的package包/类
@Override
public Class<?> getTargetClass() {
return IPipeTile.class;
}
示例10: getPipe
import buildcraft.api.transport.IPipeTile; //导入依赖的package包/类
private static IPipe getPipe(IPipeTile target) {
IPipe pipe = target.getPipe();
Preconditions.checkNotNull(pipe, "Invalid pipe");
return pipe;
}
示例11: hasGate
import buildcraft.api.transport.IPipeTile; //导入依赖的package包/类
@ScriptCallable(description = "Checks if this pipe has a gate", returnTypes = ReturnType.BOOLEAN)
public boolean hasGate(IPipeTile target, @Arg(name = "side") ForgeDirection side) {
return getPipe(target).hasGate(side);
}
示例12: isWired
import buildcraft.api.transport.IPipeTile; //导入依赖的package包/类
@ScriptCallable(description = "Checks if a wire is on the pipe", returnTypes = ReturnType.BOOLEAN)
public boolean isWired(IPipeTile target,
@Arg(name = "wire", description = "The colour of the wire") PipeWire wire) {
return getPipe(target).isWired(wire);
}
示例13: isWireActive
import buildcraft.api.transport.IPipeTile; //导入依赖的package包/类
@ScriptCallable(description = "Checks if a wire on the pipe is active", returnTypes = ReturnType.BOOLEAN)
public boolean isWireActive(IPipeTile target,
@Arg(name = "wire", description = "The colour of the wire") PipeWire wire) {
return getPipe(target).isWireActive(wire);
}
示例14: getPipeType
import buildcraft.api.transport.IPipeTile; //导入依赖的package包/类
@ScriptCallable(description = "Get type of pipe", returnTypes = ReturnType.STRING)
public PipeType getPipeType(IPipeTile target) {
return target.getPipeType();
}
示例15: isPipeConnected
import buildcraft.api.transport.IPipeTile; //导入依赖的package包/类
@ScriptCallable(description = "Get type of pipe", returnTypes = ReturnType.BOOLEAN)
public boolean isPipeConnected(IPipeTile target, @Arg(name = "side") ForgeDirection side) {
return target.isPipeConnected(side);
}