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


Java IEnergyTile类代码示例

本文整理汇总了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;
			}
		}
	}
}
 
开发者ID:Microsoft,项目名称:vsminecraft,代码行数:22,代码来源:TileEntityInductionPort.java

示例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;
	}
	
	
}
 
开发者ID:spacebuilder2020,项目名称:Spacebuilder2020-s-addon-mod-for-ender-io,代码行数:19,代码来源:EUConduit.java

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

示例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");
}
 
开发者ID:Szewek,项目名称:Minecraft-Flux,代码行数:30,代码来源:IC2FluxCompat.java

示例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_);
}
 
开发者ID:Avaja,项目名称:OpenTechnology,代码行数:8,代码来源:BlockEnergyController.java

示例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));
		}
	}
}
 
开发者ID:Microsoft,项目名称:vsminecraft,代码行数:14,代码来源:TileEntityInductionPort.java

示例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;
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:5,代码来源:BlockTrackEntryIC2.java

示例8: EnergyTileUnloadEvent

import ic2.api.energy.tile.IEnergyTile; //导入依赖的package包/类
public EnergyTileUnloadEvent(IEnergyTile energyTile1) {
	super(energyTile1);
}
 
开发者ID:Herobone,项目名称:HeroUtils,代码行数:4,代码来源:EnergyTileUnloadEvent.java

示例9: EnergyTileLoadEvent

import ic2.api.energy.tile.IEnergyTile; //导入依赖的package包/类
public EnergyTileLoadEvent(IEnergyTile energyTile1) {
	super(energyTile1);
}
 
开发者ID:Herobone,项目名称:HeroUtils,代码行数:4,代码来源:EnergyTileLoadEvent.java

示例10: EnergyTileEvent

import ic2.api.energy.tile.IEnergyTile; //导入依赖的package包/类
public EnergyTileEvent(IEnergyTile energyTile1) {
	super(((TileEntity) energyTile1).getWorldObj());

	this.energyTile = energyTile1;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:6,代码来源:EnergyTileEvent.java

示例11: TileSlotCharge

import ic2.api.energy.tile.IEnergyTile; //导入依赖的package包/类
public TileSlotCharge(IEnergyTile tile, SlotMode mode) {
    super((TileContainer) tile, mode);
}
 
开发者ID:GoodTimeStudio,项目名称:Production-Line,代码行数:4,代码来源:TileSlotCharge.java

示例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;
/*     */   }
 
开发者ID:Nathor40000,项目名称:Connection,代码行数:69,代码来源:WorldUtil.java

示例13: EnergyTileEvent

import ic2.api.energy.tile.IEnergyTile; //导入依赖的package包/类
public EnergyTileEvent(IEnergyTile energyTile) {
	super(((TileEntity) energyTile).worldObj);
	
	this.energyTile = energyTile;
}
 
开发者ID:austinv11,项目名称:PeripheralsPlusPlus,代码行数:6,代码来源:EnergyTileEvent.java

示例14: EnergyTileUnloadEvent

import ic2.api.energy.tile.IEnergyTile; //导入依赖的package包/类
public EnergyTileUnloadEvent(IEnergyTile energyTile) {
	super(energyTile);
}
 
开发者ID:austinv11,项目名称:PeripheralsPlusPlus,代码行数:4,代码来源:EnergyTileUnloadEvent.java

示例15: EnergyTileLoadEvent

import ic2.api.energy.tile.IEnergyTile; //导入依赖的package包/类
public EnergyTileLoadEvent(IEnergyTile energyTile) {
	super(energyTile);
}
 
开发者ID:austinv11,项目名称:PeripheralsPlusPlus,代码行数:4,代码来源:EnergyTileLoadEvent.java


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