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


Java EnergyTileLoadEvent类代码示例

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


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

示例1: register

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

import ic2.api.energy.event.EnergyTileLoadEvent; //导入依赖的package包/类
@Override
public void update() {
    if (!this.world.isRemote) {
        MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this));

        if((double)this.maxEnergy - this.energy >= 1.0D) {
            for (TileSlot tileSlot : this.tileSlots) {
                if (tileSlot instanceof TileSlotDischarge) {
                    double amount = ((TileSlotDischarge) tileSlot).discharge((double) this.maxEnergy - this.energy, false);
                    if(amount > 0.0D) {
                        this.energy += amount;
                        this.markDirty();
                    }
                }
            }
        }
    }
}
 
开发者ID:GoodTimeStudio,项目名称:Production-Line,代码行数:19,代码来源:TileElectricContainer.java

示例3: updateEntity

import ic2.api.energy.event.EnergyTileLoadEvent; //导入依赖的package包/类
@Override
public void updateEntity() {
	if (!init) {
		initData();
		markDirty();
	}
	if (!worldObj.isRemote) {
		if (!addedToEnergyNet) {
			EnergyTileLoadEvent event = new EnergyTileLoadEvent(this);
			MinecraftForge.EVENT_BUS.post(event);
			addedToEnergyNet = true;
		}
		if (updateTicker-- == 0) {
			updateTicker = tickRate - 1;
			counter += EnergyNet.instance.getTotalEnergyEmitted(this); //So sue me
			this.setPowerType((byte)EnergyStorageData.TARGET_TYPE_IC2);
		}
	}
}
 
开发者ID:xbony2,项目名称:Nuclear-Control,代码行数:20,代码来源:TileEntityEnergyCounter.java

示例4: onLoaded

import ic2.api.energy.event.EnergyTileLoadEvent; //导入依赖的package包/类
/**
 * Notification that the base TileEntity finished loaded, for advanced uses.
 * Either updateEntity or onLoaded have to be used.
 */
public void onLoaded() {
	if (!addedToEnet &&
			!parent.getWorld().isRemote &&
			Info.isIc2Available()) {
		worldObj = parent.getWorld();
		pos = parent.getPos();

		MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this));

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

示例5: onLoaded

import ic2.api.energy.event.EnergyTileLoadEvent; //导入依赖的package包/类
/**
 * Notification that the base TileEntity finished loading, for advanced uses.
 * Either updateEntity or onLoaded have to be used.
 */
public void onLoaded() {
	if (!addedToEnet &&
			!parent.getWorld().isRemote &&
			Info.isIc2Available()) {
		worldObj = parent.getWorld();
		pos = parent.getPos();

		MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this));

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

示例6: fireLoadEvent

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

示例7: updateEntity

import ic2.api.energy.event.EnergyTileLoadEvent; //导入依赖的package包/类
@Override
public void updateEntity() {
    if(!addToNetwork){
        addToNetwork = true;
        Network.joinOrCreateNetwork(this);
    }

    if(!addToEnergyNetwork && !worldObj.isRemote){
        MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this));
        addToEnergyNetwork = true;
    }

    //if(!worldObj.isRemote)
    //    System.out.println(energyInputBuffer + " " + energyOutputBuffer);
}
 
开发者ID:Avaja,项目名称:OpenTechnology,代码行数:16,代码来源:TileEntityEnergyController.java

示例8: onLoaded

import ic2.api.energy.event.EnergyTileLoadEvent; //导入依赖的package包/类
/**
 * Notification that the base TileEntity finished loaded, for advanced uses.
 * Either updateEntity or onLoaded have to be used.
 */
public void onLoaded() {
	if (!addedToEnet &&
			!FMLCommonHandler.instance().getEffectiveSide().isClient() &&
			Info.isIc2Available()) {
		worldObj = parent.getWorldObj();
		xCoord = parent.xCoord;
		yCoord = parent.yCoord;
		zCoord = parent.zCoord;

		MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this));

		addedToEnet = true;
	}
}
 
开发者ID:nikita488,项目名称:RainbowElectricity,代码行数:19,代码来源:BasicSink.java

示例9: onLoaded

import ic2.api.energy.event.EnergyTileLoadEvent; //导入依赖的package包/类
/**
 * Notification that the base TileEntity finished loading, for advanced uses.
 * Either updateEntity or onLoaded have to be used.
 */
public void onLoaded() {
	if (!addedToEnet &&
			!FMLCommonHandler.instance().getEffectiveSide().isClient() &&
			Info.isIc2Available()) {
		worldObj = parent.getWorldObj();
		xCoord = parent.xCoord;
		yCoord = parent.yCoord;
		zCoord = parent.zCoord;

		MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this));

		addedToEnet = true;
	}
}
 
开发者ID:nikita488,项目名称:RainbowElectricity,代码行数:19,代码来源:BasicSource.java

示例10: updateEntity

import ic2.api.energy.event.EnergyTileLoadEvent; //导入依赖的package包/类
public void updateEntity()
{
	if ((!addedToEnet) && (!FMLCommonHandler.instance().getEffectiveSide().isClient()) && (Info.isIc2Available()))
	{

		MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this));

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

示例11: onFirstTick

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

    // FIXME _super.onFirstTick();

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

示例12: firstTick

import ic2.api.energy.event.EnergyTileLoadEvent; //导入依赖的package包/类
@Override
public void firstTick() {
    super.firstTick();
    MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this));
    this.multiBlockRegist = new ArrayList<Position>();
    this.logic = new ReactorLogic(this);
    this.multiblockIsMultiblock = false;
    ReactorHandler.getWorldInstance(worldObj).registerController(getPosition());
}
 
开发者ID:TeamFRM,项目名称:FusionReactor,代码行数:10,代码来源:ReactorControllerTileEntity.java

示例13: updateEntity

import ic2.api.energy.event.EnergyTileLoadEvent; //导入依赖的package包/类
@Override
public void updateEntity() {
	if (!init) {
		initData();
		markDirty();
	}
	if (FMLCommonHandler.instance().getEffectiveSide().isClient())
		return;
	if (!worldObj.isRemote){
		if (!addedToEnergyNet){
			EnergyTileLoadEvent event = new EnergyTileLoadEvent(this);
			MinecraftForge.EVENT_BUS.post(event);
			addedToEnergyNet = true;
		}
		index = (index + 1) % DATA_POINTS;
		data[index] = 0;
		this.getAverage();
		double total = EnergyNet.instance.getTotalEnergyEmitted(this);

		if(IC2NuclearControl.instance.crossIc2.getType() == IC2Type.SPEIGER){
			double realTotal = total - lastReceivedPower;
			lastReceivedPower = total;
			data[index] = realTotal;
		}else
			data[index] = total;
		
		this.setPowerType((byte)EnergyStorageData.TARGET_TYPE_IC2);
	}
	super.updateEntity();
}
 
开发者ID:xbony2,项目名称:Nuclear-Control,代码行数:31,代码来源:TileEntityAverageCounter.java

示例14: onLoaded

import ic2.api.energy.event.EnergyTileLoadEvent; //导入依赖的package包/类
/**
 * Notification that the base TileEntity finished loaded, for advanced uses.
 * Either updateEntity or onLoaded have to be used.
 */
public void onLoaded() {
    if (!addedToEnet &&
        !FMLCommonHandler.instance().getEffectiveSide().isClient() &&
        Info.isIc2Available()) {
        worldObj = parent.getWorldObj();
        xCoord = parent.xCoord;
        yCoord = parent.yCoord;
        zCoord = parent.zCoord;

        MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this));

        addedToEnet = true;
    }
}
 
开发者ID:AgileMods,项目名称:MateriaMuto,代码行数:19,代码来源:BasicSink.java

示例15: onLoaded

import ic2.api.energy.event.EnergyTileLoadEvent; //导入依赖的package包/类
/**
 * Notification that the base TileEntity finished loading, for advanced uses.
 * Either updateEntity or onLoaded have to be used.
 */
public void onLoaded() {
    if (!addedToEnet &&
        !FMLCommonHandler.instance().getEffectiveSide().isClient() &&
        Info.isIc2Available()) {
        worldObj = parent.getWorldObj();
        xCoord = parent.xCoord;
        yCoord = parent.yCoord;
        zCoord = parent.zCoord;

        MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this));

        addedToEnet = true;
    }
}
 
开发者ID:AgileMods,项目名称:MateriaMuto,代码行数:19,代码来源:BasicSource.java


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