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


Java EnergyTileUnloadEvent类代码示例

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


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

示例1: register

import ic2.api.energy.event.EnergyTileUnloadEvent; //导入依赖的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: changeOrientation

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

示例3: invalidate

import ic2.api.energy.event.EnergyTileUnloadEvent; //导入依赖的package包/类
@Override
public void invalidate() {
    if (getWorld() != null && !getWorld().isRemote) {
        MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this));
    }
    super.invalidate();
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:8,代码来源:TileEntityPneumaticGenerator.java

示例4: onChunkUnload

import ic2.api.energy.event.EnergyTileUnloadEvent; //导入依赖的package包/类
@Override
public void onChunkUnload() {
    if (getWorld() != null && !getWorld().isRemote) {
        MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this));
    }
    super.onChunkUnload();
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:8,代码来源:TileEntityPneumaticGenerator.java

示例5: onChunkUnload

import ic2.api.energy.event.EnergyTileUnloadEvent; //导入依赖的package包/类
/**
 * Forward for the base TileEntity's onChunkUnload(), used for destroying the energy net link.
 * Both invalidate and onChunkUnload have to be used.
 */
@Override
public void onChunkUnload() {
	if (addedToEnet &&
			Info.isIc2Available()) {
		MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this));

		addedToEnet = false;
	}
}
 
开发者ID:Herobone,项目名称:HeroUtils,代码行数:14,代码来源:BasicSink.java

示例6: invalidate

import ic2.api.energy.event.EnergyTileUnloadEvent; //导入依赖的package包/类
@Override
@Optional.Method(modid = "ic2")
public void invalidate() {
    super.invalidate();
    if(!world.isRemote) {
        MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this));
    }
}
 
开发者ID:HellFirePvP,项目名称:ModularMachinery,代码行数:9,代码来源:TileEnergyOutputHatch.java

示例7: breakBlock

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

示例8: deregister

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

示例9: onChunkUnload

import ic2.api.energy.event.EnergyTileUnloadEvent; //导入依赖的package包/类
/**
 * Called when the chunk this TileEntity is on is Unloaded.
 */
@Override
public void onChunkUnload() {
    super.onChunkUnload();
    if (!this.world.isRemote) {
        MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this));
    }
}
 
开发者ID:GoodTimeStudio,项目名称:Production-Line,代码行数:11,代码来源:TileElectricGenerator.java

示例10: invalidate

import ic2.api.energy.event.EnergyTileUnloadEvent; //导入依赖的package包/类
/**
 * invalidates a tile entity
 */
@Override
public void invalidate() {
    super.invalidate();
    if (!this.world.isRemote) {
        MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this));
    }
}
 
开发者ID:GoodTimeStudio,项目名称:Production-Line,代码行数:11,代码来源:TileElectricGenerator.java

示例11: onChunkUnload

import ic2.api.energy.event.EnergyTileUnloadEvent; //导入依赖的package包/类
public void onChunkUnload()
{
	if ((addedToEnet) && (Info.isIc2Available()))
	{
		MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this));

		addedToEnet = false;
	}
}
 
开发者ID:UnderMybrella,项目名称:Minegate,代码行数:10,代码来源:TileEntityEUProvider.java

示例12: onUnload

import ic2.api.energy.event.EnergyTileUnloadEvent; //导入依赖的package包/类
@Override
public void onUnload() {

    // FIXME _super.onUnload();

    if (!((IWorldLocation) this).getWorld().isRemote)
        MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this));
}
 
开发者ID:amadornes,项目名称:Framez,代码行数:9,代码来源:MotorModifierEU.java

示例13: invalidate

import ic2.api.energy.event.EnergyTileUnloadEvent; //导入依赖的package包/类
@Override
@SideOnly(Side.SERVER)
public void invalidate() {
    if (!FMLCommonHandler.instance().getEffectiveSide().isClient())
        MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this));
    super.invalidate();
}
 
开发者ID:TeamFRM,项目名称:FusionReactor,代码行数:8,代码来源:SuperConductingCableTileEntity.java

示例14: invalidate

import ic2.api.energy.event.EnergyTileUnloadEvent; //导入依赖的package包/类
@Override
public void invalidate() {
    super.invalidate();
    if (worldObj != null && !worldObj.isRemote) {
        MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this));
    }
}
 
开发者ID:TeamFRM,项目名称:FusionReactor,代码行数:8,代码来源:ReactorControllerTileEntity.java

示例15: onChunkUnload

import ic2.api.energy.event.EnergyTileUnloadEvent; //导入依赖的package包/类
@Override
public void onChunkUnload() {
    if (worldObj != null && !worldObj.isRemote) {
        MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this));
    }
    super.onChunkUnload();
}
 
开发者ID:TeamFRM,项目名称:FusionReactor,代码行数:8,代码来源:ReactorControllerTileEntity.java


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