aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/GoodGenerator/Blocks
diff options
context:
space:
mode:
authorGlodBlock <1356392126@qq.com>2021-12-03 20:38:57 +0800
committerGlodBlock <1356392126@qq.com>2021-12-03 20:38:57 +0800
commit06cac63657f40c489477abe923ea3f144fe6749c (patch)
treed76dc9c1b6d94eeec08c26f7b517933e70e33b3e /src/main/java/GoodGenerator/Blocks
parent938884d89ca45e1ad851fa817fc4d2432b3f0f00 (diff)
downloadGT5-Unofficial-06cac63657f40c489477abe923ea3f144fe6749c.tar.gz
GT5-Unofficial-06cac63657f40c489477abe923ea3f144fe6749c.tar.bz2
GT5-Unofficial-06cac63657f40c489477abe923ea3f144fe6749c.zip
rework LEG
Diffstat (limited to 'src/main/java/GoodGenerator/Blocks')
-rw-r--r--src/main/java/GoodGenerator/Blocks/RegularBlock/TEBlock.java15
-rw-r--r--src/main/java/GoodGenerator/Blocks/TEs/EssentiaHatch.java15
-rw-r--r--src/main/java/GoodGenerator/Blocks/TEs/FuelRefineFactory.java2
-rw-r--r--src/main/java/GoodGenerator/Blocks/TEs/LargeEssentiaGenerator.java303
4 files changed, 273 insertions, 62 deletions
diff --git a/src/main/java/GoodGenerator/Blocks/RegularBlock/TEBlock.java b/src/main/java/GoodGenerator/Blocks/RegularBlock/TEBlock.java
index ffea651383..d549a82a4c 100644
--- a/src/main/java/GoodGenerator/Blocks/RegularBlock/TEBlock.java
+++ b/src/main/java/GoodGenerator/Blocks/RegularBlock/TEBlock.java
@@ -5,6 +5,7 @@ import GoodGenerator.Main.GoodGenerator;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.GregTech_API;
+import gregtech.api.util.GT_Utility;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
@@ -17,8 +18,10 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
+import net.minecraft.util.StatCollector;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
+import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.IEssentiaContainerItem;
import java.util.List;
@@ -151,10 +154,16 @@ public class TEBlock extends BlockContainer {
ItemStack tItemStack = player.getHeldItem();
if (tItemStack != null) {
Item tItem = tItemStack.getItem();
- if (tItem instanceof IEssentiaContainerItem)
- ((EssentiaHatch) tile).setLockedAspect(((IEssentiaContainerItem) tItem).getAspects(player.getHeldItem()).getAspects()[0]);
+ if (tItem instanceof IEssentiaContainerItem && ((IEssentiaContainerItem) tItem).getAspects(player.getHeldItem()) != null && ((IEssentiaContainerItem) tItem).getAspects(player.getHeldItem()).size() > 0) {
+ Aspect tLocked = ((IEssentiaContainerItem) tItem).getAspects(player.getHeldItem()).getAspects()[0];
+ ((EssentiaHatch) tile).setLockedAspect(tLocked);
+ GT_Utility.sendChatToPlayer(player, String.format(StatCollector.translateToLocal("essentiahatch.chat.0"), tLocked.getLocalizedDescription()));
+ }
+ }
+ else {
+ ((EssentiaHatch) tile).setLockedAspect(null);
+ GT_Utility.sendChatToPlayer(player, StatCollector.translateToLocal("essentiahatch.chat.1"));
}
- else ((EssentiaHatch) tile).setLockedAspect(null);
world.markBlockForUpdate(x, y, z);
return true;
}
diff --git a/src/main/java/GoodGenerator/Blocks/TEs/EssentiaHatch.java b/src/main/java/GoodGenerator/Blocks/TEs/EssentiaHatch.java
index 13843ecb77..c173cb7982 100644
--- a/src/main/java/GoodGenerator/Blocks/TEs/EssentiaHatch.java
+++ b/src/main/java/GoodGenerator/Blocks/TEs/EssentiaHatch.java
@@ -1,5 +1,7 @@
package GoodGenerator.Blocks.TEs;
+import GoodGenerator.CrossMod.Thaumcraft.LargeEssentiaEnergyData;
+import gregtech.api.util.GT_Log;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.network.NetworkManager;
@@ -18,8 +20,8 @@ import java.util.ArrayList;
public class EssentiaHatch extends TileEntity implements IAspectContainer, IEssentiaTransport {
private Aspect mLocked;
-
private AspectList current = new AspectList();
+ public int mState = 0;
public void setLockedAspect(Aspect aAspect) {
this.mLocked = aAspect;
@@ -30,7 +32,7 @@ public class EssentiaHatch extends TileEntity implements IAspectContainer, IEsse
super.readFromNBT(tagCompound);
this.mLocked = Aspect.getAspect(tagCompound.getString("mLocked"));
-
+ this.mState = tagCompound.getInteger("mState");
current = new AspectList();
NBTTagList tlist = tagCompound.getTagList("Aspects", 10);
for (int j = 0; j < tlist.tagCount(); ++j) {
@@ -46,7 +48,7 @@ public class EssentiaHatch extends TileEntity implements IAspectContainer, IEsse
super.writeToNBT(tagCompound);
tagCompound.setString("mLocked", this.mLocked == null ? "" : this.mLocked.getTag());
-
+ tagCompound.setInteger("mState", mState);
NBTTagList tlist = new NBTTagList();
Aspect[] aspectA = current.getAspects();
for (Aspect aspect : aspectA) {
@@ -85,6 +87,8 @@ public class EssentiaHatch extends TileEntity implements IAspectContainer, IEsse
}
public void fillfrompipe() {
+ if (getEssentiaAmount(null) > 1000)
+ return;
TileEntity[] te = new TileEntity[ForgeDirection.VALID_DIRECTIONS.length];
for (int i = 0; i < ForgeDirection.VALID_DIRECTIONS.length; i++) {
te[i] = ThaumcraftApiHelper.getConnectableTile(this.worldObj, this.xCoord, this.yCoord, this.zCoord, ForgeDirection.VALID_DIRECTIONS[i]);
@@ -94,7 +98,10 @@ public class EssentiaHatch extends TileEntity implements IAspectContainer, IEsse
return;
}
if ((pipe.getEssentiaType(ForgeDirection.VALID_DIRECTIONS[i].getOpposite()) != null) && (pipe.getSuctionAmount(ForgeDirection.VALID_DIRECTIONS[i]) < getSuctionAmount(ForgeDirection.VALID_DIRECTIONS[i]))) {
- if (mLocked != null && pipe.getEssentiaType(ForgeDirection.VALID_DIRECTIONS[i].getOpposite()) == mLocked) {
+ Aspect readyInput = pipe.getEssentiaType(ForgeDirection.VALID_DIRECTIONS[i].getOpposite());
+ int type = LargeEssentiaEnergyData.getAspectTypeIndex(readyInput);
+ if (type != -1 && (mState & (1 << type)) == 0) continue;
+ if (readyInput.equals(mLocked)) {
addToContainer(mLocked, pipe.takeEssentia(mLocked, 1, ForgeDirection.VALID_DIRECTIONS[i]));
}
if (mLocked == null)
diff --git a/src/main/java/GoodGenerator/Blocks/TEs/FuelRefineFactory.java b/src/main/java/GoodGenerator/Blocks/TEs/FuelRefineFactory.java
index a4f448af35..69d6990153 100644
--- a/src/main/java/GoodGenerator/Blocks/TEs/FuelRefineFactory.java
+++ b/src/main/java/GoodGenerator/Blocks/TEs/FuelRefineFactory.java
@@ -69,7 +69,7 @@ public class FuelRefineFactory extends GT_MetaTileEntity_MultiblockBase_EM imple
@Override
public void construct(ItemStack itemStack, boolean hintsOnly) {
- structureBuild_EM(mName, 7,12,1, hintsOnly, itemStack);
+ structureBuild_EM(mName, 7, 12, 1, hintsOnly, itemStack);
}
@Override
diff --git a/src/main/java/GoodGenerator/Blocks/TEs/LargeEssentiaGenerator.java b/src/main/java/GoodGenerator/Blocks/TEs/LargeEssentiaGenerator.java
index 084d56b32a..c887496e6b 100644
--- a/src/main/java/GoodGenerator/Blocks/TEs/LargeEssentiaGenerator.java
+++ b/src/main/java/GoodGenerator/Blocks/TEs/LargeEssentiaGenerator.java
@@ -1,7 +1,11 @@
package GoodGenerator.Blocks.TEs;
+import GoodGenerator.CrossMod.Thaumcraft.LargeEssentiaEnergyData;
+import GoodGenerator.Items.MyMaterial;
import GoodGenerator.Loader.Loaders;
import GoodGenerator.util.DescTextLocalization;
+import GoodGenerator.util.ItemRefer;
+import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader;
import com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti;
import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti;
import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti;
@@ -10,20 +14,24 @@ import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEnt
import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
import com.gtnewhorizon.structurelib.structure.StructureDefinition;
-import gregtech.api.enums.TC_Aspects;
+import gregtech.api.enums.Materials;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.*;
import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.objects.XSTR;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
+import gregtech.api.util.GT_Utility;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.StatCollector;
+import net.minecraft.world.World;
+import net.minecraftforge.fluids.FluidRegistry;
import org.lwjgl.input.Keyboard;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
@@ -36,12 +44,14 @@ import static GoodGenerator.util.DescTextLocalization.BLUE_PRINT_INFO;
import static com.gtnewhorizon.structurelib.structure.StructureUtility.*;
import static gregtech.api.util.GT_StructureUtility.ofHatchAdder;
-public class LargeEssentiaGenerator extends GT_MetaTileEntity_MultiblockBase_EM implements TecTechEnabledMulti, IConstructable {
+public class LargeEssentiaGenerator extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable {
private IStructureDefinition<LargeEssentiaGenerator> multiDefinition = null;
- protected final int ENERGY_PER_ESSENTIA_DEFAULT = 8192;
protected int mStableValue = 0;
+ protected int mTierLimit = -1;
protected long mLeftEnergy;
+ private int mUpgrade = 1;
+ final XSTR R = new XSTR();
protected ArrayList<EssentiaHatch> mEssentiaHatch = new ArrayList<>();
public LargeEssentiaGenerator(String name){
@@ -53,21 +63,6 @@ public class LargeEssentiaGenerator extends GT_MetaTileEntity_MultiblockBase_EM
}
@Override
- public List<GT_MetaTileEntity_Hatch_Energy> getVanillaEnergyHatches() {
- return this.mEnergyHatches;
- }
-
- @Override
- public List<GT_MetaTileEntity_Hatch_EnergyTunnel> getTecTechEnergyTunnels() {
- return new ArrayList<>();
- }
-
- @Override
- public List<GT_MetaTileEntity_Hatch_EnergyMulti> getTecTechEnergyMultis() {
- return new ArrayList<>();
- }
-
- @Override
public void construct(ItemStack itemStack, boolean b) {
structureBuild_EM(mName, 4, 0, 4, b, itemStack);
}
@@ -75,7 +70,22 @@ public class LargeEssentiaGenerator extends GT_MetaTileEntity_MultiblockBase_EM
@Override
public boolean checkMachine_EM(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
mStableValue = 0;
- return structureCheck_EM(mName, 4, 0, 4) && (mDynamoHatches.size() + eDynamoMulti.size()) == 1;
+ mEssentiaHatch.clear();
+ return structureCheck_EM(mName, 4, 0, 4) && (mDynamoHatches.size() + eDynamoMulti.size()) == 1
+ && checkHatchTier() && updateEssentiaHatchState();
+ }
+
+ public boolean checkHatchTier() {
+ for (GT_MetaTileEntity_Hatch_Input tHatch : mInputHatches) {
+ if (tHatch.mTier > mTierLimit) return false;
+ }
+ for (GT_MetaTileEntity_Hatch_Dynamo tHatch : mDynamoHatches) {
+ if (tHatch.mTier > mTierLimit) return false;
+ }
+ for (GT_MetaTileEntity_Hatch_DynamoMulti tHatch : eDynamoMulti) {
+ if (tHatch.mTier > mTierLimit) return false;
+ }
+ return true;
}
@Override
@@ -83,6 +93,7 @@ public class LargeEssentiaGenerator extends GT_MetaTileEntity_MultiblockBase_EM
super.loadNBTData(aNBT);
this.mStableValue = aNBT.getInteger("mStableValue");
this.mLeftEnergy = aNBT.getLong("mLeftEnergy");
+ this.mUpgrade = aNBT.getInteger("mUpgrade");
}
@Override
@@ -90,26 +101,14 @@ public class LargeEssentiaGenerator extends GT_MetaTileEntity_MultiblockBase_EM
super.saveNBTData(aNBT);
aNBT.setInteger("mStableValue", this.mStableValue);
aNBT.setLong("mLeftEnergy", this.mLeftEnergy);
+ aNBT.setInteger("mUpgrade", this.mUpgrade);
}
- public void getEssentiaHatch() {
- IGregTechTileEntity aTileEntity = getBaseMetaTileEntity();
- if (aTileEntity == null) return;
- mEssentiaHatch.clear();
- TileEntity hatch = aTileEntity.getTileEntityOffset(4,-2, 0);
- addEssentiaHatch(hatch);
- hatch = aTileEntity.getTileEntityOffset(-4,-2, 0);
- addEssentiaHatch(hatch);
- hatch = aTileEntity.getTileEntityOffset(0,-2, 4);
- addEssentiaHatch(hatch);
- hatch = aTileEntity.getTileEntityOffset(0,-2, -4);
- addEssentiaHatch(hatch);
- }
-
- public void addEssentiaHatch(TileEntity aHatch) {
- if (aHatch instanceof EssentiaHatch) {
- mEssentiaHatch.add((EssentiaHatch) aHatch);
+ public boolean updateEssentiaHatchState() {
+ for (EssentiaHatch hatch : mEssentiaHatch) {
+ hatch.mState = mUpgrade;
}
+ return true;
}
@Override
@@ -123,6 +122,25 @@ public class LargeEssentiaGenerator extends GT_MetaTileEntity_MultiblockBase_EM
}
@Override
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
+ if (this.getBaseMetaTileEntity().isServerSide()) {
+ ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem();
+ if (tCurrentItem != null && tCurrentItem.getItem().equals(ItemRefer.Essentia_Upgrade_Empty.get(1).getItem())) {
+ int tMeta = tCurrentItem.getItemDamage();
+ if ((mUpgrade & (1 << tMeta)) == 0 && tMeta != 0) {
+ tCurrentItem.stackSize --;
+ mUpgrade = mUpgrade | (1 << tMeta);
+ GT_Utility.sendChatToPlayer(aPlayer, tCurrentItem.getDisplayName() + StatCollector.translateToLocal("largeessentiagenerator.chat"));
+ }
+ updateEssentiaHatchState();
+ return true;
+ }
+ }
+ super.onRightclick(aBaseMetaTileEntity, aPlayer);
+ return true;
+ }
+
+ @Override
public IStructureDefinition<LargeEssentiaGenerator> getStructure_EM() {
if(multiDefinition == null) {
multiDefinition = StructureDefinition
@@ -152,22 +170,28 @@ public class LargeEssentiaGenerator extends GT_MetaTileEntity_MultiblockBase_EM
'E',
ofChain(
onElementPass(
- x -> ++x.mStableValue,
+ x -> {++x.mStableValue; x.mTierLimit = Math.max(x.mTierLimit, 3);},
ofBlock(
Loaders.essentiaCell, 0
)
),
onElementPass(
- x -> x.mStableValue += 2,
+ x -> {x.mStableValue += 2; x.mTierLimit = Math.max(x.mTierLimit, 4);},
ofBlock(
Loaders.essentiaCell, 1
)
),
onElementPass(
- x -> x.mStableValue += 5,
+ x -> {x.mStableValue += 5; x.mTierLimit = Math.max(x.mTierLimit, 5);},
ofBlock(
Loaders.essentiaCell, 2
)
+ ),
+ onElementPass(
+ x -> {x.mStableValue += 10; x.mTierLimit = Math.max(x.mTierLimit, 6);},
+ ofBlock(
+ Loaders.essentiaCell, 3
+ )
)
)
).addElement(
@@ -180,8 +204,8 @@ public class LargeEssentiaGenerator extends GT_MetaTileEntity_MultiblockBase_EM
ofBlock(
Loaders.magicCasing, 0
),
- ofBlock(
- Loaders.essentiaHatch, 0
+ ofTileAdder(
+ LargeEssentiaGenerator::addEssentiaHatch, Loaders.magicCasing, 0
)
)
)
@@ -190,6 +214,13 @@ public class LargeEssentiaGenerator extends GT_MetaTileEntity_MultiblockBase_EM
return multiDefinition;
}
+ public final boolean addEssentiaHatch(TileEntity aTileEntity) {
+ if (aTileEntity instanceof EssentiaHatch) {
+ return this.mEssentiaHatch.add((EssentiaHatch) aTileEntity);
+ }
+ return false;
+ }
+
public final boolean addLargeEssentiaGeneratorList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
if (aTileEntity == null) {
return false;
@@ -216,7 +247,6 @@ public class LargeEssentiaGenerator extends GT_MetaTileEntity_MultiblockBase_EM
public boolean checkRecipe_EM(ItemStack aStack) {
this.mEfficiency = 10000;
this.mMaxProgresstime = 1;
- getEssentiaHatch();
setEssentiaToEUVoltageAndAmp(getVoltageLimit(), getAmpLimit());
return true;
}
@@ -246,18 +276,175 @@ public class LargeEssentiaGenerator extends GT_MetaTileEntity_MultiblockBase_EM
}
public long getPerAspectEnergy(Aspect aspect) {
- if (aspect.equals(Aspect.ENERGY)) return 45000 * mStableValue / 25;
- if (aspect.equals(Aspect.FIRE)) return 30000 * mStableValue / 25;
- if (aspect.equals(Aspect.GREED)) return 130000 * mStableValue / 25;
- if (aspect.equals(Aspect.AURA)) return 120000 * mStableValue / 25;
- if (aspect.equals(Aspect.TREE)) return 25000 * mStableValue / 25;
- if (aspect.equals(Aspect.AIR)) return 13000 * mStableValue / 25;
- if (aspect.equals(Aspect.MAGIC)) return 92000 * mStableValue / 25;
- if (aspect.equals(Aspect.MECHANISM)) return 40000 * mStableValue / 25;
- if (aspect.equals(TC_Aspects.ELECTRUM.mAspect)) return 131072 * mStableValue / 25;
- if (aspect.equals(TC_Aspects.RADIO.mAspect)) return 524288 * mStableValue / 25;
+ int type = LargeEssentiaEnergyData.getAspectTypeIndex(aspect);
+ if (!isValidEssentia(aspect)) return 0;
+ switch (type) {
+ case 0: return normalEssentia(aspect);
+ case 1: return airEssentia(aspect);
+ case 2: return thermalEssentia(aspect);
+ case 3: return unstableEssentia(aspect);
+ case 4: return victusEssentia(aspect);
+ case 5: return taintedEssentia(aspect);
+ case 6: return mechanicEssentia(aspect);
+ case 7: return spiritEssentia(aspect);
+ case 8: return radiationEssentia(aspect);
+ case 9: return electricEssentia(aspect);
+ default: return 0;
+ }
+ }
- return ENERGY_PER_ESSENTIA_DEFAULT * mStableValue / 25;
+ public long normalEssentia(Aspect aspect) {
+ return LargeEssentiaEnergyData.getAspectFuelValue(aspect);
+ }
+
+ public long airEssentia(Aspect aspect) {
+ long baseValue = LargeEssentiaEnergyData.getAspectFuelValue(aspect);
+ double ceoOutput = 0;
+ int ceoInput = (int) LargeEssentiaEnergyData.getAspectCeo(aspect) * 8;
+ if (depleteInput(Materials.LiquidAir.getFluid(ceoInput))) {
+ ceoOutput = 1.5D;
+ }
+ else if (depleteInput(Materials.Air.getGas(ceoInput))){
+ ceoOutput = 1.0D;
+ }
+ return (long) (baseValue * ceoOutput);
+ }
+
+ public long thermalEssentia(Aspect aspect) {
+ long baseValue = LargeEssentiaEnergyData.getAspectFuelValue(aspect);
+ double ceoOutput = 0;
+ int ceoInput = (int) LargeEssentiaEnergyData.getAspectCeo(aspect) * 2;
+ if (depleteInput(FluidRegistry.getFluidStack("cryotheum", ceoInput))) {
+ ceoOutput = 9.0D;
+ }
+ else if (depleteInput(Materials.SuperCoolant.getFluid(ceoInput))) {
+ ceoOutput = 5.0D;
+ }
+ else if (depleteInput(FluidRegistry.getFluidStack("ic2coolant", ceoInput))) {
+ ceoOutput = 1.5D;
+ }
+ else if (depleteInput(Materials.Ice.getSolid(ceoInput))) {
+ ceoOutput = 1.2D;
+ }
+ else if (depleteInput(FluidRegistry.getFluidStack("ic2distilledwater", ceoInput))){
+ ceoOutput = 1.0D;
+ }
+ else if (depleteInput(Materials.Water.getFluid(ceoInput))) {
+ ceoOutput = 0.5D;
+ }
+
+ return (long) (baseValue * ceoOutput);
+ }
+
+ public long unstableEssentia(Aspect aspect) {
+ long baseValue = LargeEssentiaEnergyData.getAspectFuelValue(aspect);
+ double ceoOutput = 0;
+ int ceoInput = (int) LargeEssentiaEnergyData.getAspectCeo(aspect) * 4;
+ if (depleteInput(WerkstoffLoader.Xenon.getFluidOrGas(ceoInput))){
+ ceoOutput = 4.0D;
+ }
+ else if (depleteInput(WerkstoffLoader.Krypton.getFluidOrGas(ceoInput))){
+ ceoOutput = 3.0D;
+ }
+ else if (depleteInput(Materials.Argon.getFluid(ceoInput))){
+ ceoOutput = 2.5D;
+ }
+ else if (depleteInput(WerkstoffLoader.Neon.getFluidOrGas(ceoInput))){
+ ceoOutput = 2.2D;
+ }
+ else if (depleteInput(Materials.Helium.getFluid(ceoInput))){
+ ceoOutput = 2.0D;
+ }
+ else if (depleteInput(Materials.Nitrogen.getFluid(ceoInput))){
+ ceoOutput = 1.0D;
+ }
+ return (long) (baseValue * ceoOutput);
+ }
+
+ public long victusEssentia(Aspect aspect) {
+ long baseValue = LargeEssentiaEnergyData.getAspectFuelValue(aspect);
+ double ceoOutput = 1.0D;
+ int ceoInput = (int) LargeEssentiaEnergyData.getAspectCeo(aspect) * 18;
+ if (depleteInput(FluidRegistry.getFluidStack("xpjuice", ceoInput))) {
+ ceoOutput = 2.0D;
+ }
+ else if (depleteInput(FluidRegistry.getFluidStack("lifeessence", ceoInput))){
+ ceoOutput = 6.0D;
+ }
+ return (long) (baseValue * ceoOutput);
+ }
+
+ public long taintedEssentia(Aspect aspect) {
+ long baseValue = LargeEssentiaEnergyData.getAspectFuelValue(aspect);
+ double ceoOutput = 1.0D;
+ int ceoInput = (int) LargeEssentiaEnergyData.getAspectCeo(aspect) * 3;
+ int chance = 2000;
+ if (depleteInput(FluidRegistry.getFluidStack("fluidpure", ceoInput))) {
+ ceoOutput = 60.0D;
+ chance = 0;
+ }
+ else if (depleteInput(FluidRegistry.getFluidStack("fluiddeath", ceoInput))){
+ ceoOutput = Math.pow(25000D / baseValue, 4);
+ chance = 4000;
+ }
+
+ if (R.nextInt(10000) < chance) {
+ World world = getBaseMetaTileEntity().getWorld();
+ int tX = R.nextInt(4);
+ int tZ = R.nextInt(4);
+ if (world.isAirBlock(tX, 0, tZ))
+ world.setBlock(tX, 0, tZ, ConfigBlocks.blockFluxGas, R.nextInt(8), 3);
+ }
+
+ return (long) (baseValue * ceoOutput);
+ }
+
+ public long mechanicEssentia(Aspect aspect) {
+ long baseValue = LargeEssentiaEnergyData.getAspectFuelValue(aspect);
+ double ceoOutput = 0;
+ int ceoInput = (int) LargeEssentiaEnergyData.getAspectCeo(aspect) * 20;
+ if (depleteInput(Materials.Lubricant.getFluid(ceoInput))) {
+ ceoOutput = 1.0D;
+ }
+ return (long) (baseValue * ceoOutput);
+ }
+
+ public long spiritEssentia(Aspect aspect) {
+ long baseValue = LargeEssentiaEnergyData.getAspectFuelValue(aspect);
+ double ceoOutput = 1.0D;
+ int ceoInput = (int) LargeEssentiaEnergyData.getAspectCeo(aspect) * 2;
+ if (depleteInput(FluidRegistry.getFluidStack("witchery:fluidspirit", ceoInput))) {
+ ceoOutput = 10D * (1 + mStableValue / 100D);
+ }
+ else if (depleteInput(FluidRegistry.getFluidStack("witchery:hollowtears", ceoInput))) {
+ ceoOutput = 15D * (1 + 100D / mStableValue);
+ }
+ return (long) (baseValue * ceoOutput);
+ }
+
+ public long radiationEssentia(Aspect aspect) {
+ long baseValue = LargeEssentiaEnergyData.getAspectFuelValue(aspect);
+ double ceoOutput = 1.0D;
+ int ceoInput = (int) LargeEssentiaEnergyData.getAspectCeo(aspect) * 6;
+ if (depleteInput(Materials.Caesium.getMolten(ceoInput))) {
+ ceoOutput = 2.0D;
+ }
+ else if (depleteInput(Materials.Uranium235.getMolten(ceoInput))) {
+ ceoOutput = 3.0D;
+ }
+ else if (depleteInput(Materials.Naquadah.getMolten(ceoInput))) {
+ ceoOutput = 4.0D;
+ }
+ else if (depleteInput(MyMaterial.atomicSeparationCatalyst.getMolten(ceoInput))) {
+ ceoOutput = 16.0D;
+ }
+ return (long) (baseValue * ceoOutput);
+ }
+
+ public long electricEssentia(Aspect aspect) {
+ long baseValue = LargeEssentiaEnergyData.getAspectFuelValue(aspect);
+ double ceoOutput = Math.pow(3.0, GT_Utility.getTier(getVoltageLimit()));
+ return (long) (baseValue * ceoOutput);
}
public void setEssentiaToEUVoltageAndAmp(long voltageLimit, long ampLimit) {
@@ -267,6 +454,7 @@ public class LargeEssentiaGenerator extends GT_MetaTileEntity_MultiblockBase_EM
for (EssentiaHatch hatch: this.mEssentiaHatch){
AspectList aspects = hatch.getAspects();
for (Aspect aspect: aspects.aspects.keySet()) {
+ if (!isValidEssentia(aspect) || getPerAspectEnergy(aspect) == 0) continue;
while (EUt <= (voltageLimit * ampLimit) && aspects.getAmount(aspect) > 0) {
EUt += getPerAspectEnergy(aspect);
aspects.reduce(aspect, 1);
@@ -275,6 +463,7 @@ public class LargeEssentiaGenerator extends GT_MetaTileEntity_MultiblockBase_EM
}
}
if (EUt == 0 && aspects.size() != 0) {
+ if (!isValidEssentia(aspects.getAspects()[0]) || getPerAspectEnergy(aspects.getAspects()[0]) == 0) continue;
EUt += getPerAspectEnergy(aspects.getAspects()[0]);
aspects.reduce(aspects.getAspects()[0], 1);
if (aspects.getAmount(aspects.getAspects()[0]) == 0)
@@ -320,6 +509,7 @@ public class LargeEssentiaGenerator extends GT_MetaTileEntity_MultiblockBase_EM
.addInfo("Controller block for the Large Essentia Generator")
.addInfo("Maybe some thaumaturages are upset by it. . .")
.addInfo("Transform essentia into energy!")
+ .addInfo("The the Diffusion Cell determines the highest hatch tier that LEG can accept.")
.addInfo("You can find more information about this generator in Thaumonomicon.")
.addInfo("The structure is too complex!")
.addInfo(BLUE_PRINT_INFO)
@@ -345,4 +535,9 @@ public class LargeEssentiaGenerator extends GT_MetaTileEntity_MultiblockBase_EM
}
return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(1536)};
}
+
+ public boolean isValidEssentia(Aspect aspect) {
+ int type = LargeEssentiaEnergyData.getAspectTypeIndex(aspect);
+ return type != -1 && (mUpgrade & (1 << type)) != 0;
+ }
}