Search in sources :

Example 1 with EnergyTileUnloadEvent

use of ic2.api.energy.event.EnergyTileUnloadEvent in project compactsolars by cpw.

the class BasicSink method onInvalidate.

/**
	 * Forward for the TileEntity's invalidate(), used for destroying the energy net link.
	 * Both onInvalidate and onOnChunkUnload have to be used.
	 */
public void onInvalidate() {
    if (addedToEnet) {
        MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this));
        addedToEnet = false;
    }
}
Also used : EnergyTileUnloadEvent(ic2.api.energy.event.EnergyTileUnloadEvent)

Example 2 with EnergyTileUnloadEvent

use of ic2.api.energy.event.EnergyTileUnloadEvent in project compactsolars by cpw.

the class BasicSource method onInvalidate.

/**
	 * Forward for the TileEntity's invalidate(), used for destroying the energy net link.
	 * Both onInvalidate and onOnChunkUnload have to be used.
	 */
public void onInvalidate() {
    if (addedToEnet) {
        MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this));
        addedToEnet = false;
    }
}
Also used : EnergyTileUnloadEvent(ic2.api.energy.event.EnergyTileUnloadEvent)

Example 3 with EnergyTileUnloadEvent

use of ic2.api.energy.event.EnergyTileUnloadEvent in project MineFactoryReloaded by powercrystals.

the class TileEntityFactoryPowered method onBlockBroken.

@Override
public void onBlockBroken() {
    super.onBlockBroken();
    if (_isAddedToIC2EnergyNet) {
        _isAddedToIC2EnergyNet = false;
        MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this));
    }
}
Also used : EnergyTileUnloadEvent(ic2.api.energy.event.EnergyTileUnloadEvent)

Example 4 with EnergyTileUnloadEvent

use of ic2.api.energy.event.EnergyTileUnloadEvent in project MineFactoryReloaded by powercrystals.

the class TileEntityFactoryPowered method invalidate.

@Override
public void invalidate() {
    if (_isAddedToIC2EnergyNet) {
        if (!worldObj.isRemote) {
            MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this));
        }
        _isAddedToIC2EnergyNet = false;
    }
    ElectricityNetworkHelper.invalidate(this);
    super.invalidate();
}
Also used : EnergyTileUnloadEvent(ic2.api.energy.event.EnergyTileUnloadEvent)

Example 5 with EnergyTileUnloadEvent

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

the class TilePowerAcceptor 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)

Aggregations

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