本文整理汇总了Java中ic2.api.energy.tile.IEnergyTile类的典型用法代码示例。如果您正苦于以下问题:Java IEnergyTile类的具体用法?Java IEnergyTile怎么用?Java IEnergyTile使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IEnergyTile类属于ic2.api.energy.tile包,在下文中一共展示了IEnergyTile类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: register
import ic2.api.energy.tile.IEnergyTile; //导入依赖的package包/类
@Method(modid = "IC2")
public void register()
{
if(!worldObj.isRemote)
{
TileEntity registered = EnergyNet.instance.getTileEntity(worldObj, xCoord, yCoord, zCoord);
if(registered != this)
{
if(registered instanceof IEnergyTile)
{
MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent((IEnergyTile)registered));
}
else if(registered == null)
{
MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this));
ic2Registered = true;
}
}
}
}
示例2: canConnectToExternal
import ic2.api.energy.tile.IEnergyTile; //导入依赖的package包/类
@Override
public boolean canConnectToExternal(ForgeDirection direction, boolean ignoreDisabled) {
if (ignoreDisabled)
return false;
else
{
if (w != null)
{
int x = direction.offsetX + xCoord, y = direction.offsetY + yCoord, z = direction.offsetZ + zCoord;
TileEntity te = w.getTileEntity(x, y, z);
if (te != null && te instanceof IEnergyTile)
return true;
}
return false;
}
}
示例3: fireLoadEvent
import ic2.api.energy.tile.IEnergyTile; //导入依赖的package包/类
public static void fireLoadEvent(World world, IEnergyTile tileEnergyInputHatch) {
MinecraftServer ms = FMLCommonHandler.instance().getMinecraftServerInstance();
if(ms != null) {
ms.addScheduledTask(() -> {
if(!world.isRemote) {
MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(tileEnergyInputHatch));
}
});
}
}
示例4: tileFactorize
import ic2.api.energy.tile.IEnergyTile; //导入依赖的package包/类
private void tileFactorize(LazyEnergyCapProvider lecp) {
if (broken) return;
final ICapabilityProvider cp = lecp.getObject();
if (cp == null || !(cp instanceof TileEntity)) return;
final TileEntity te = (TileEntity) cp;
final IEnergyTile et = EnergyNet.instance.getTile(te.getWorld(), te.getPos());
final IEnergySource esrc = et instanceof IEnergySource ? (IEnergySource) et : null;
final IEnergySink esnk = et instanceof IEnergySink ? (IEnergySink) et : null;
DoubleSupplier cfunc = et instanceof BasicSource ? ((BasicSource) et)::getCapacity : et instanceof BasicSink ? ((BasicSink) et)::getCapacity : null;
DoubleSupplier efunc = et instanceof BasicSource ? ((BasicSource) et)::getEnergyStored : et instanceof BasicSink ? ((BasicSink) et)::getEnergyStored : null;
if (IC2_TEB.isInstance(cp)) {
Object o = null;
try {
o = COMPONENT.invoke(cp, IC2_ENERGY);
} catch (Exception e) {
MCFluxReport.sendException(e, "[IC2] FluxCompat factorize");
}
cfunc = doubleFunc(CAPACITY, o);
efunc = doubleFunc(ENERGY, o);
}
final EUDelegate eud = new EUDelegate(cfunc, efunc, esnk, esrc);
final EnergyTile[] es = new EnergyTile[7];
for (int i = 0; i < U.FANCY_FACING.length; i++) {
EnumFacing f = U.FANCY_FACING[i];
es[i] = new EnergyTile(eud, f);
}
lecp.update(es, new int[0], null, true);
CloudUtils.reportEnergy(cp.getClass(), et.getClass(), "ic2");
}
示例5: breakBlock
import ic2.api.energy.tile.IEnergyTile; //导入依赖的package包/类
@Override
public void breakBlock(World world, int x, int y, int z, Block block, int p_149749_6_) {
if(!world.isRemote)
MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent((IEnergyTile) world.getTileEntity(x, y, z)));
super.breakBlock(world, x, y, z, block, p_149749_6_);
}
示例6: deregister
import ic2.api.energy.tile.IEnergyTile; //导入依赖的package包/类
@Method(modid = "IC2")
public void deregister()
{
if(!worldObj.isRemote)
{
TileEntity registered = EnergyNet.instance.getTileEntity(worldObj, xCoord, yCoord, zCoord);
if(registered instanceof IEnergyTile)
{
MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent((IEnergyTile)registered));
}
}
}
示例7: shouldTrackWithThisEntry
import ic2.api.energy.tile.IEnergyTile; //导入依赖的package包/类
@Override
public boolean shouldTrackWithThisEntry(IBlockAccess world, BlockPos pos, IBlockState state, TileEntity te) {
return te instanceof IEnergyTile;
}
示例8: EnergyTileUnloadEvent
import ic2.api.energy.tile.IEnergyTile; //导入依赖的package包/类
public EnergyTileUnloadEvent(IEnergyTile energyTile1) {
super(energyTile1);
}
示例9: EnergyTileLoadEvent
import ic2.api.energy.tile.IEnergyTile; //导入依赖的package包/类
public EnergyTileLoadEvent(IEnergyTile energyTile1) {
super(energyTile1);
}
示例10: EnergyTileEvent
import ic2.api.energy.tile.IEnergyTile; //导入依赖的package包/类
public EnergyTileEvent(IEnergyTile energyTile1) {
super(((TileEntity) energyTile1).getWorldObj());
this.energyTile = energyTile1;
}
示例11: TileSlotCharge
import ic2.api.energy.tile.IEnergyTile; //导入依赖的package包/类
public TileSlotCharge(IEnergyTile tile, SlotMode mode) {
super((TileContainer) tile, mode);
}
示例12: getAdjacentPowerConnections
import ic2.api.energy.tile.IEnergyTile; //导入依赖的package包/类
public static TileEntity[] getAdjacentPowerConnections(TileEntity tile)
/* */ {
/* 891 */ TileEntity[] adjacentConnections = new TileEntity[6];
/* */
/* 893 */ boolean isMekLoaded = NetworkConfigHandler.isMekanismLoaded();
/* 894 */ boolean isTELoaded = NetworkConfigHandler.isThermalExpansionLoaded();
/* 895 */ boolean isIC2Loaded = NetworkConfigHandler.isIndustrialCraft2Loaded();
/* 896 */ boolean isBCLoaded = NetworkConfigHandler.isBuildcraftLoaded();
/* */
/* 898 */ BlockVec3 thisVec = new BlockVec3(tile);
/* 899 */ for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS)
/* */ {
/* 901 */ TileEntity tileEntity = thisVec.getTileEntityOnSide(tile.field_70331_k, direction);
/* */
/* 903 */ if ((tileEntity instanceof IConnector))
/* */ {
/* 905 */ if (((IConnector)tileEntity).canConnect(direction.getOpposite(), NetworkType.POWER))
/* */ {
/* 907 */ adjacentConnections[direction.ordinal()] = tileEntity;
/* */ }
/* */ }
/* 910 */ else if ((isMekLoaded) && ((tileEntity instanceof IStrictEnergyAcceptor)))
/* */ {
/* 912 */ if (((IStrictEnergyAcceptor)tileEntity).canReceiveEnergy(direction.getOpposite()))
/* */ {
/* 914 */ adjacentConnections[direction.ordinal()] = tileEntity;
/* */ }
/* */ }
/* 917 */ else if ((isTELoaded) && ((tileEntity instanceof IEnergyHandler)))
/* */ {
/* 919 */ if (((IEnergyHandler)tileEntity).canInterface(direction.getOpposite()))
/* */ {
/* 921 */ adjacentConnections[direction.ordinal()] = tileEntity;
/* */ }
/* */ }
/* 924 */ else if ((isIC2Loaded) && ((tileEntity instanceof IEnergyTile)))
/* */ {
/* 926 */ if ((tileEntity instanceof IEnergyAcceptor))
/* */ {
/* 928 */ if (((IEnergyAcceptor)tileEntity).acceptsEnergyFrom(tile, direction.getOpposite()))
/* */ {
/* 930 */ adjacentConnections[direction.ordinal()] = tileEntity;
/* 931 */ continue;
/* */ }
/* */ }
/* */
/* 935 */ if ((tileEntity instanceof IEnergyEmitter))
/* */ {
/* 937 */ if (((IEnergyEmitter)tileEntity).emitsEnergyTo(tileEntity, direction.getOpposite()))
/* */ {
/* 939 */ adjacentConnections[direction.ordinal()] = tileEntity;
/* 940 */ continue;
/* */ }
/* */ }
/* */
/* 944 */ adjacentConnections[direction.ordinal()] = tileEntity;
/* */ }
/* 946 */ else if ((isBCLoaded) && ((tileEntity instanceof IPowerReceptor)))
/* */ {
/* 948 */ if (((IPowerReceptor)tileEntity).getPowerReceiver(direction.getOpposite()) != null)
/* */ {
/* 950 */ adjacentConnections[direction.ordinal()] = tileEntity;
/* */ }
/* */ }
/* */ }
/* */
/* 955 */ return adjacentConnections;
/* */ }
示例13: EnergyTileEvent
import ic2.api.energy.tile.IEnergyTile; //导入依赖的package包/类
public EnergyTileEvent(IEnergyTile energyTile) {
super(((TileEntity) energyTile).worldObj);
this.energyTile = energyTile;
}
示例14: EnergyTileUnloadEvent
import ic2.api.energy.tile.IEnergyTile; //导入依赖的package包/类
public EnergyTileUnloadEvent(IEnergyTile energyTile) {
super(energyTile);
}
示例15: EnergyTileLoadEvent
import ic2.api.energy.tile.IEnergyTile; //导入依赖的package包/类
public EnergyTileLoadEvent(IEnergyTile energyTile) {
super(energyTile);
}