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


Java IEnergyAcceptor类代码示例

本文整理汇总了Java中ic2.api.energy.tile.IEnergyAcceptor的典型用法代码示例。如果您正苦于以下问题:Java IEnergyAcceptor类的具体用法?Java IEnergyAcceptor怎么用?Java IEnergyAcceptor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IEnergyAcceptor类属于ic2.api.energy.tile包,在下文中一共展示了IEnergyAcceptor类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: isConnectable

import ic2.api.energy.tile.IEnergyAcceptor; //导入依赖的package包/类
public static boolean isConnectable(TileEntity orig, TileEntity tileEntity, ForgeDirection side)
{
	if(tileEntity instanceof ITransmitterTile)
	{
		return false;
	}

	if(tileEntity instanceof IStrictEnergyAcceptor)
	{
		if(((IStrictEnergyAcceptor)tileEntity).canReceiveEnergy(side.getOpposite()))
		{
			return true;
		}
	}
	else if(MekanismUtils.useIC2() && tileEntity instanceof IEnergyAcceptor)
	{
		if(((IEnergyAcceptor)tileEntity).acceptsEnergyFrom(orig, side.getOpposite()))
		{
			return true;
		}
	}
	else if(tileEntity instanceof ICableOutputter)
	{
		if(((ICableOutputter)tileEntity).canOutputTo(side.getOpposite()))
		{
			return true;
		}
	}
	else if(MekanismUtils.useRF() && tileEntity instanceof IEnergyConnection)
	{
		if(((IEnergyConnection)tileEntity).canConnectEnergy(side.getOpposite()))
		{
			return true;
		}
	}

	return false;
}
 
开发者ID:Microsoft,项目名称:vsminecraft,代码行数:39,代码来源:CableUtils.java

示例2: emitsEnergyTo

import ic2.api.energy.tile.IEnergyAcceptor; //导入依赖的package包/类
@Override
public boolean emitsEnergyTo(IEnergyAcceptor iEnergyAcceptor, EnumFacing enumFacing) {
    return enumFacing == getRotation();
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:5,代码来源:TileEntityPneumaticGenerator.java

示例3: emitsEnergyTo

import ic2.api.energy.tile.IEnergyAcceptor; //导入依赖的package包/类
@Override
public boolean emitsEnergyTo(IEnergyAcceptor receiver, EnumFacing direction) {
	return true;
}
 
开发者ID:Herobone,项目名称:HeroUtils,代码行数:5,代码来源:BasicSource.java

示例4: emitsEnergyTo

import ic2.api.energy.tile.IEnergyAcceptor; //导入依赖的package包/类
@Override
@Optional.Method(modid = "ic2")
public boolean emitsEnergyTo(IEnergyAcceptor receiver, EnumFacing side) {
    return true;
}
 
开发者ID:HellFirePvP,项目名称:ModularMachinery,代码行数:6,代码来源:TileEnergyOutputHatch.java

示例5: emitsEnergyTo

import ic2.api.energy.tile.IEnergyAcceptor; //导入依赖的package包/类
@Optional.Method(modid = "IC2API")
@Override
public boolean emitsEnergyTo(IEnergyAcceptor receiver, EnumFacing side) {
	return MetaphaserEU.INSTANCE.emitsEnergyTo(this, receiver, side);
}
 
开发者ID:Lordmau5,项目名称:FFS,代码行数:6,代码来源:TileEntityMetaphaser.java

示例6: emitsEnergyTo

import ic2.api.energy.tile.IEnergyAcceptor; //导入依赖的package包/类
@Override
public boolean emitsEnergyTo(IEnergyAcceptor iEnergyAcceptor, EnumFacing enumFacing) {
    return true;
}
 
开发者ID:GoodTimeStudio,项目名称:Production-Line,代码行数:5,代码来源:TileElectricGenerator.java

示例7: emitsEnergyTo

import ic2.api.energy.tile.IEnergyAcceptor; //导入依赖的package包/类
@Override
public boolean emitsEnergyTo(IEnergyAcceptor iEnergyAcceptor, EnumFacing enumFacing) {
    return enumFacing == this.facing;
}
 
开发者ID:GoodTimeStudio,项目名称:Production-Line,代码行数:5,代码来源:TileEUStorage.java

示例8: getAdjacentPowerConnections

import ic2.api.energy.tile.IEnergyAcceptor; //导入依赖的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

示例9: refresh

import ic2.api.energy.tile.IEnergyAcceptor; //导入依赖的package包/类
@Override
public void refresh()
{
	this.electricalTiles.clear();

	try
	{
		Iterator<IConductor> it = this.getTransmitters().iterator();

		while (it.hasNext())
		{
			IConductor conductor = it.next();

			if (conductor == null)
			{
				it.remove();
				continue;
			}

			conductor.onNetworkChanged();

			if (((TileEntity) conductor).isInvalid() || ((TileEntity) conductor).getWorldObj() == null)
			{
				it.remove();
				continue;
			}
			else if (((TileEntity) conductor).getWorldObj().getBlockTileEntity(((TileEntity) conductor).xCoord, ((TileEntity) conductor).yCoord, ((TileEntity) conductor).zCoord) != conductor)
			{
				it.remove();
				continue;
			}
			else
			{
				conductor.setNetwork(this);
			}

			for (int i = 0; i < conductor.getAdjacentConnections().length; i++)
			{
				TileEntity acceptor = conductor.getAdjacentConnections()[i];
				// The direction is from the perspective of the conductor.
				ForgeDirection direction = ForgeDirection.getOrientation(i);

				if (!(acceptor instanceof IConductor))
				{
					if (acceptor instanceof IElectrical || (NetworkConfigHandler.isThermalExpansionLoaded() && acceptor instanceof IEnergyHandler) || (NetworkConfigHandler.isIndustrialCraft2Loaded() && acceptor instanceof IEnergyAcceptor) || (NetworkConfigHandler.isBuildcraftLoaded() && acceptor instanceof IPowerReceptor))
					{
						boolean canConnect = false;

						if (acceptor instanceof IElectrical && ((IElectrical) acceptor).canConnect(direction.getOpposite(), NetworkType.POWER))
						{
							canConnect = true;
						}
						else if (NetworkConfigHandler.isThermalExpansionLoaded() && acceptor instanceof IEnergyHandler && ((IEnergyHandler) acceptor).canInterface(direction))
						{
							canConnect = true;
						}
						else if (NetworkConfigHandler.isIndustrialCraft2Loaded() && acceptor instanceof IEnergyAcceptor && ((IEnergyAcceptor) acceptor).acceptsEnergyFrom((TileEntity) conductor, direction))
						{
							canConnect = true;
						}
						else if (NetworkConfigHandler.isBuildcraftLoaded() && acceptor instanceof IPowerReceptor && ((IPowerReceptor) acceptor).getPowerReceiver(direction) != null)
						{
							canConnect = true;
						}

						if (canConnect)
						{
							this.electricalTiles.put(acceptor, direction);
						}
					}
				}
			}
		}
	}
	catch (Exception e)
	{
		FMLLog.severe("Universal Electricity: Failed to refresh conductor.");
		e.printStackTrace();
	}
}
 
开发者ID:4Space,项目名称:4-Space-Legacy,代码行数:81,代码来源:UniversalNetwork.java

示例10: getAdjacentConnections

import ic2.api.energy.tile.IEnergyAcceptor; //导入依赖的package包/类
@Override
public TileEntity[] getAdjacentConnections()
{
	if (this.adjacentConnections == null)
	{
		this.adjacentConnections = new TileEntity[6];

		for (byte i = 0; i < 6; i++)
		{
			ForgeDirection side = ForgeDirection.getOrientation(i);
			TileEntity tileEntity = VectorHelper.getTileEntityFromSide(this.worldObj, new Vector3(this), side);

			if (tileEntity instanceof IConnector)
			{
				if (((IConnector) tileEntity).canConnect(side.getOpposite()))
				{
					this.adjacentConnections[i] = tileEntity;
				}
			}
			else if (Compatibility.isIndustrialCraft2Loaded() && tileEntity instanceof IEnergyTile)
			{
				if (tileEntity instanceof IEnergyAcceptor)
				{
					if (((IEnergyAcceptor) tileEntity).acceptsEnergyFrom(this, side.getOpposite()))
					{
						this.adjacentConnections[i] = tileEntity;
						continue;
					}
				}

				if (tileEntity instanceof IEnergyEmitter)
				{
					if (((IEnergyEmitter) tileEntity).emitsEnergyTo(tileEntity, side.getOpposite()))
					{
						this.adjacentConnections[i] = tileEntity;
						continue;
					}
				}

				this.adjacentConnections[i] = tileEntity;
			}
			else if (Compatibility.isBuildcraftLoaded() && tileEntity instanceof IPowerReceptor)
			{
				if (((IPowerReceptor) tileEntity).getPowerReceiver(side.getOpposite()) != null)
				{
					this.adjacentConnections[i] = tileEntity;
				}
			}
		}
	}

	return this.adjacentConnections;
}
 
开发者ID:tterrag1098,项目名称:SimpleTransmutations,代码行数:54,代码来源:TileEntityUniversalConductor.java

示例11: emitsEnergyTo

import ic2.api.energy.tile.IEnergyAcceptor; //导入依赖的package包/类
/**
 * Determine if this emitter can emit energy to an adjacent receiver.
 * <p/>
 * The TileEntity in the receiver parameter is what was originally added to the energy net,
 * which may be normal in-world TileEntity, a delegate or an IMetaDelegate.
 *
 * @param receiver  receiver, may also be null or an IMetaDelegate
 * @param direction direction the receiver is from the emitter
 * @return Whether energy should be emitted
 */
@Override
public boolean emitsEnergyTo(IEnergyAcceptor receiver, EnumFacing direction) {
    return direction != EnumFacing.UP;
}
 
开发者ID:GoodTimeStudio,项目名称:Production-Line,代码行数:15,代码来源:TileAdvSolar.java


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