Add support of reactor chambers in GT transformers
This commit is contained in:
parent
3b8f58dff7
commit
5309d3960b
1 changed files with 4 additions and 0 deletions
|
@ -12,6 +12,7 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
|
|||
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
|
||||
import gregtech.api.util.GT_Utility;
|
||||
import ic2.api.energy.tile.IEnergySource;
|
||||
import ic2.api.reactor.IReactorChamber;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
@ -142,6 +143,9 @@ public class GT_MetaTileEntity_Transformer extends GT_MetaTileEntity_TieredMachi
|
|||
for (byte i = 0; i < 6 && aBaseMetaTileEntity.getStoredEU() < aBaseMetaTileEntity.getEUCapacity(); i++)
|
||||
if (aBaseMetaTileEntity.inputEnergyFrom(i)) {
|
||||
TileEntity tTileEntity = aBaseMetaTileEntity.getTileEntityAtSide(i);
|
||||
if (tTileEntity instanceof IReactorChamber) {
|
||||
tTileEntity = (TileEntity) ((IReactorChamber) tTileEntity).getReactor();
|
||||
}
|
||||
if (tTileEntity instanceof IEnergySource && ((IEnergySource) tTileEntity).emitsEnergyTo((TileEntity) aBaseMetaTileEntity, ForgeDirection.getOrientation(GT_Utility.getOppositeSide(i)))) {
|
||||
long tEU = Math.min(maxEUInput(), (long) ((IEnergySource) tTileEntity).getOfferedEnergy());
|
||||
((IEnergySource) tTileEntity).drawEnergy(tEU);
|
||||
|
|
Loading…
Reference in a new issue