当前位置: 首页>>代码示例>>Java>>正文


Java IPipeTile类代码示例

本文整理汇总了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;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:18,代码来源:ActionManager.java

示例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;
}
 
开发者ID:Dragon9815,项目名称:PlayerInterfaceMod,代码行数:21,代码来源:BlockHelper.java

示例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;
}
 
开发者ID:asiekierka,项目名称:endernet,代码行数:18,代码来源:ActionManager.java

示例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;
}
 
开发者ID:Dynious,项目名称:RefinedRelocation,代码行数:25,代码来源:IOHelper.java

示例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;
}
 
开发者ID:adamros,项目名称:Transducers,代码行数:26,代码来源:AbstractElectricEngine.java

示例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;
}
 
开发者ID:MineMaarten,项目名称:PneumaticCraft,代码行数:11,代码来源:ModInteractionUtilImplementation.java

示例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;
}
 
开发者ID:Dynious,项目名称:RefinedRelocation,代码行数:16,代码来源:IOHelper.java

示例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;
}
 
开发者ID:adamros,项目名称:Transducers,代码行数:11,代码来源:HighThroughputPowerPipe.java

示例9: getTargetClass

import buildcraft.api.transport.IPipeTile; //导入依赖的package包/类
@Override
public Class<?> getTargetClass() {
	return IPipeTile.class;
}
 
开发者ID:OpenMods,项目名称:OpenPeripheral-Integration,代码行数:5,代码来源:AdapterPipe.java

示例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;
}
 
开发者ID:OpenMods,项目名称:OpenPeripheral-Integration,代码行数:6,代码来源:AdapterPipe.java

示例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);
}
 
开发者ID:OpenMods,项目名称:OpenPeripheral-Integration,代码行数:5,代码来源:AdapterPipe.java

示例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);
}
 
开发者ID:OpenMods,项目名称:OpenPeripheral-Integration,代码行数:6,代码来源:AdapterPipe.java

示例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);
}
 
开发者ID:OpenMods,项目名称:OpenPeripheral-Integration,代码行数:6,代码来源:AdapterPipe.java

示例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();
}
 
开发者ID:OpenMods,项目名称:OpenPeripheral-Integration,代码行数:5,代码来源:AdapterPipe.java

示例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);
}
 
开发者ID:OpenMods,项目名称:OpenPeripheral-Integration,代码行数:5,代码来源:AdapterPipe.java


注:本文中的buildcraft.api.transport.IPipeTile类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。