Package thaumic.tinkerer.common.compat

Source Code of thaumic.tinkerer.common.compat.IndustrialcraftUnloadHelper

package thaumic.tinkerer.common.compat;

import ic2.api.energy.event.EnergyTileLoadEvent;
import ic2.api.energy.event.EnergyTileUnloadEvent;
import ic2.api.energy.tile.IEnergySink;
import net.minecraftforge.common.MinecraftForge;
import thaumic.tinkerer.common.block.tile.transvector.TileTransvectorInterface;

/**
* Created by pixlepix on 8/26/14.
*/
public class IndustrialcraftUnloadHelper {

    public static void removeFromIC2EnergyNet(TileTransvectorInterface tileEntity) {
        if ((tileEntity.addedToICEnergyNet && !tileEntity.getWorldObj().isRemote)) {
            MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent((IEnergySink) tileEntity));
            tileEntity.addedToICEnergyNet = false;
        }
    }

    public static void addToIC2EnergyNet(TileTransvectorInterface tileTransvectorInterface) {
        MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(tileTransvectorInterface));
    }
}
TOP

Related Classes of thaumic.tinkerer.common.compat.IndustrialcraftUnloadHelper

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.