本文整理汇总了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;
}
}
}
}
示例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();
}
}
}
}
}
}
示例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);
}
}
}
示例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;
}
}
示例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;
}
}
示例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));
}
});
}
}
示例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);
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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));
}
示例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());
}
示例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();
}
示例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;
}
}
示例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;
}
}