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;
}
}
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;
}
}
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));
}
}
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();
}
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;
}
}
}
Aggregations