Search in sources :

Example 6 with EnergyTileUnloadEvent

use of ic2.api.energy.event.EnergyTileUnloadEvent in project Flux-Networks by SonarSonic.

the class TileFluxIC2 method onChunkUnload.

@Override
@Optional.Method(modid = "ic2")
public void onChunkUnload() {
    super.onChunkUnload();
    if (!this.getWorld().isRemote && IC2Connected) {
        MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this));
        IC2Connected = false;
    }
}
Also used : EnergyTileUnloadEvent(ic2.api.energy.event.EnergyTileUnloadEvent)

Example 7 with EnergyTileUnloadEvent

use of ic2.api.energy.event.EnergyTileUnloadEvent in project Galacticraft by micdoodle8.

the class BasicSink method onChunkUnload.

/**
 * 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;
    }
}
Also used : EnergyTileUnloadEvent(ic2.api.energy.event.EnergyTileUnloadEvent)

Example 8 with EnergyTileUnloadEvent

use of ic2.api.energy.event.EnergyTileUnloadEvent in project Galacticraft by micdoodle8.

the class BasicSource method onChunkUnload.

/**
 * 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;
    }
}
Also used : EnergyTileUnloadEvent(ic2.api.energy.event.EnergyTileUnloadEvent)

Example 9 with EnergyTileUnloadEvent

use of ic2.api.energy.event.EnergyTileUnloadEvent in project RebornCore by TechReborn.

the class TileEnergyBase method onChunkUnload.

@Override
@Optional.Method(modid = "ic2")
public void onChunkUnload() {
    super.onChunkUnload();
    if (getPowerConfig().eu()) {
        if (addedToEnet && Info.isIc2Available()) {
            MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this));
            addedToEnet = false;
        }
    }
}
Also used : EnergyTileUnloadEvent(ic2.api.energy.event.EnergyTileUnloadEvent)

Example 10 with EnergyTileUnloadEvent

use of ic2.api.energy.event.EnergyTileUnloadEvent in project Binnie by ForestryMC.

the class ComponentPowerReceptor method do_removeFromEnergyNet.

@Optional.Method(modid = "ic2")
private void do_removeFromEnergyNet() {
    MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent((IEnergyTile) this.getMachine().getTileEntity()));
    this.registeredToIC2EnergyNet = false;
}
Also used : EnergyTileUnloadEvent(ic2.api.energy.event.EnergyTileUnloadEvent) IEnergyTile(ic2.api.energy.tile.IEnergyTile)

Aggregations

EnergyTileUnloadEvent (ic2.api.energy.event.EnergyTileUnloadEvent)11 IEnergyTile (ic2.api.energy.tile.IEnergyTile)1