aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/xmod/gregtech/common
diff options
context:
space:
mode:
authorAlkalus <3060479+draknyte1@users.noreply.github.com>2019-05-13 19:30:18 +1000
committerAlkalus <3060479+draknyte1@users.noreply.github.com>2019-05-13 19:30:18 +1000
commitafbdec041ed8696392076e24fc87511f9b54909e (patch)
tree7323523fc0de3453a70f499ed006d136139cbe39 /src/Java/gtPlusPlus/xmod/gregtech/common
parentff47ff098d524402639b3593a0eb58dbbcbeb538 (diff)
downloadGT5-Unofficial-afbdec041ed8696392076e24fc87511f9b54909e.tar.gz
GT5-Unofficial-afbdec041ed8696392076e24fc87511f9b54909e.tar.bz2
GT5-Unofficial-afbdec041ed8696392076e24fc87511f9b54909e.zip
+ Added the Industrial Vacuum Furnace. This Multiblock also doubles as a Dehydrator for higher tiers.
+ Added recipe for the Industrial Vacuum Furnace. % Cleaned up heating coil code, now it's in one location for easier updating in future.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/common')
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java51
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java6
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaGarbageCollector.java2
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCentrifuge.java1
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialDehydrator.java378
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java64
6 files changed, 436 insertions, 66 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java b/src/Java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java
index 99563b60ef..9c552db3ad 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java
@@ -219,6 +219,57 @@ public class StaticFields59 {
}
return null;
}
+
+ public static int getHeatingCapacityForCoil(Block aBlock, int aMeta) {
+ if (aBlock == GregTech_API.sBlockCasings1 && (aMeta >= 12 && aMeta <= 14)) {
+ return getHeatingCapacityForCoilTier(aMeta == 12 ? 1 : aMeta == 13 ? 2 : 3);
+ }
+ else if (aBlock == getBlockCasings5() && (aMeta >= 0 && aMeta <= 8)) {
+ return getHeatingCapacityForCoilTier(aMeta);
+ }
+ return 0;
+ }
+
+ public static int getHeatingCapacityForCoilTier(int aCoilTier) {
+ int mHeatingCapacity = 0;
+ switch (aCoilTier) {
+ case 0:
+ mHeatingCapacity = 1800;
+ break;
+ case 1:
+ mHeatingCapacity = 2700;
+ break;
+ case 2:
+ mHeatingCapacity = 3600;
+ break;
+ case 3:
+ mHeatingCapacity = 4500;
+ break;
+ case 4:
+ mHeatingCapacity = 5400;
+ break;
+ case 5:
+ mHeatingCapacity = 7200;
+ break;
+ case 6:
+ mHeatingCapacity = 9000;
+ break;
+ case 7:
+ mHeatingCapacity = 9900;
+ break;
+ case 8:
+ mHeatingCapacity = 10800;
+ break;
+ default:
+ Logger.INFO("Heating Coils are bad.");
+ mHeatingCapacity = 0;
+ }
+ if (CORE.GTNH && aCoilTier <= 6) {
+ mHeatingCapacity += 1;
+ }
+
+ return mHeatingCapacity;
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java
index 54323d8c2e..97babc587e 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java
@@ -34,7 +34,7 @@ extends GregtechMetaCasingBlocksAbstract {
GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", "Turbine Shaft");
GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", "Low Pressure Turbine Casing");
GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", "High Pressure Turbine Casing");
- GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", "");
+ GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", "Vacuum Casing");
GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", "");
GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".12.name", "");
GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", "");
@@ -50,8 +50,8 @@ extends GregtechMetaCasingBlocksAbstract {
GregtechItemList.Casing_Turbine_Shaft.set(new ItemStack(this, 1, 7));
GregtechItemList.Casing_Turbine_LP.set(new ItemStack(this, 1, 8));
GregtechItemList.Casing_Turbine_HP.set(new ItemStack(this, 1, 9));
- /*GregtechItemList.Casing_Cyclotron_External.set(new ItemStack(this, 1, 10));
- GregtechItemList.Casing_ThermalContainment.set(new ItemStack(this, 1, 11));
+ GregtechItemList.Casing_Vacuum_Furnace.set(new ItemStack(this, 1, 10));
+ /*GregtechItemList.Casing_ThermalContainment.set(new ItemStack(this, 1, 11));
GregtechItemList.Casing_Autocrafter.set(new ItemStack(this, 1, 12));
GregtechItemList.Casing_CuttingFactoryFrame.set(new ItemStack(this, 1, 13));
GregtechItemList.Casing_TeslaTower.set(new ItemStack(this, 1, 14));
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaGarbageCollector.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaGarbageCollector.java
index c09302fb3e..0a65db7be4 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaGarbageCollector.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaGarbageCollector.java
@@ -23,7 +23,7 @@ public class GregtechMetaGarbageCollector extends GregtechMetaTileEntity {
int mFrequency = 5;
public GregtechMetaGarbageCollector(final String aName, final String aNameRegional, final String aDescription) {
- super(28750, aName, aNameRegional, 5, 0, aDescription);
+ super(991, aName, aNameRegional, 5, 0, aDescription);
}
public GregtechMetaGarbageCollector(final String aName, final String aDescription, final ITexture[][][] aTextures) {
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCentrifuge.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCentrifuge.java
index 3f3a276f0c..9490fc678b 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCentrifuge.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCentrifuge.java
@@ -11,7 +11,6 @@ import gregtech.api.util.GT_Utility;
import gregtech.api.util.Recipe_GT;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.block.ModBlocks;
-import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.minecraft.PlayerUtils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.CustomIcon;
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialDehydrator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialDehydrator.java
new file mode 100644
index 0000000000..2c17629d8f
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialDehydrator.java
@@ -0,0 +1,378 @@
+package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing;
+
+import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.commons.lang3.ArrayUtils;
+
+import gregtech.api.enums.TAE;
+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.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.GT_Utility;
+import gregtech.api.util.Recipe_GT;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.block.ModBlocks;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import gtPlusPlus.core.util.minecraft.PlayerUtils;
+import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
+import gtPlusPlus.xmod.gregtech.common.StaticFields59;
+import net.minecraft.block.Block;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.FluidStack;
+
+public class GregtechMetaTileEntity_IndustrialDehydrator extends GregtechMeta_MultiBlockBase {
+
+ private static int CASING_TEXTURE_ID;
+ private static String mCasingName = "Vacuum Casing";
+ private int mHeatingCapacity = 0;
+ private boolean mDehydratorMode = false;
+
+ public GregtechMetaTileEntity_IndustrialDehydrator(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ CASING_TEXTURE_ID = TAE.getIndexFromPage(3, 10);
+ mCasingName = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings4Misc, 10);
+ }
+
+ public GregtechMetaTileEntity_IndustrialDehydrator(String aName) {
+ super(aName);
+ CASING_TEXTURE_ID = TAE.getIndexFromPage(3, 10);
+ mCasingName = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings4Misc, 10);
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_IndustrialDehydrator(mName);
+ }
+
+ public String[] getTooltip() {
+ if (mCasingName.toLowerCase().contains(".name")) {
+ mCasingName = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings4Misc, 10);
+ }
+ return new String[] {
+ "Factory Grade Vacuum Furnace",
+ "Can toggle the operation temperature with a Screwdriver",
+ "All Dehydrator recipes are Low Temp recipes",
+ "Speed: 120% | Eu Usage: 50% | Parallel: 4",
+ "Constructed exactly the same as a normal EBF",
+ "Has three layers of coils instead (24)",
+ "Use "+mCasingName+"s (10 at least!)",
+ "Each 900K over the min. Heat Capacity grants 5% speedup (multiplicatively)",
+ "Each 1800K over the min. Heat Capacity allows for one upgraded overclock",
+ "Upgraded overclocks reduce recipe time to 25% and increase EU/t to 400%",
+ };
+ }
+
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
+ boolean aActive, boolean aRedstone) {
+ if (aSide == aFacing) {
+ return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[CASING_TEXTURE_ID],
+ new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE
+ : Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE) };
+ }
+ return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[CASING_TEXTURE_ID] };
+ }
+
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return mDehydratorMode ? Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes : Recipe_GT.Gregtech_Recipe_Map.sVacuumFurnaceRecipes;
+ }
+
+ public boolean isCorrectMachinePart(ItemStack aStack) {
+ return true;
+ }
+
+ public boolean isFacingValid(byte aFacing) {
+ return aFacing > 1;
+ }
+
+
+ public boolean checkMultiblock(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
+ int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
+
+ this.mHeatingCapacity = 0;
+ if (!aBaseMetaTileEntity.getAirOffset(xDir, 1, zDir)) {
+ return false;
+ }
+ if (!aBaseMetaTileEntity.getAirOffset(xDir, 2, zDir)) {
+ return false;
+ }
+ if (!aBaseMetaTileEntity.getAirOffset(xDir, 3, zDir)) {
+ return false;
+ }
+ Block tUsedBlock = aBaseMetaTileEntity.getBlockOffset(xDir + 1, 2, zDir);
+ byte tUsedMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + 1, 2, zDir);
+ this.mHeatingCapacity = StaticFields59.getHeatingCapacityForCoil(tUsedBlock, tUsedMeta);
+
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+ if ((i != 0) || (j != 0)) {
+ //Coils 1
+ if (!isValidBlockForStructure(null, CASING_TEXTURE_ID, false, aBaseMetaTileEntity.getBlockOffset(xDir + i, 1, zDir + j), (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 1, zDir + j), StaticFields59.getBlockCasings5(), tUsedMeta)) {
+ Logger.INFO("Heating Coils missing.");
+ return false;
+ }
+
+ //Coils 2
+ if (!isValidBlockForStructure(null, CASING_TEXTURE_ID, false, aBaseMetaTileEntity.getBlockOffset(xDir + i, 2, zDir + j), (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 2, zDir + j), StaticFields59.getBlockCasings5(), tUsedMeta)) {
+ Logger.INFO("Heating Coils missing.");
+ return false;
+ }
+
+ //Coils 3
+ if (!isValidBlockForStructure(null, CASING_TEXTURE_ID, false, aBaseMetaTileEntity.getBlockOffset(xDir + i, 3, zDir + j), (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 2, zDir + j), StaticFields59.getBlockCasings5(), tUsedMeta)) {
+ Logger.INFO("Heating Coils missing.");
+ return false;
+ }
+ }
+
+ //Top Layer
+ final IGregTechTileEntity tTileEntity2 = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 4, zDir + j);
+ if (!isValidBlockForStructure(tTileEntity2, CASING_TEXTURE_ID, true, aBaseMetaTileEntity.getBlockOffset(xDir + i, 4, zDir + j), (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 4, zDir + j), ModBlocks.blockCasings4Misc, 10)) {
+ Logger.INFO("Top Layer missing.");
+ return false;
+ }
+ }
+ }
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+ if ((xDir + i != 0) || (zDir + j != 0)) {
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 0,zDir + j);
+ if (!isValidBlockForStructure(tTileEntity, CASING_TEXTURE_ID, true, aBaseMetaTileEntity.getBlockOffset(xDir + i, 0, zDir + j), (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 0, zDir + j), ModBlocks.blockCasings4Misc, 10)) {
+ Logger.INFO("Bottom Layer missing.");
+ return false;
+ }
+ }
+ }
+ }
+ return true;
+ }
+
+ public int getMaxEfficiency(ItemStack aStack) {
+ return 10000;
+ }
+
+ public int getPollutionPerTick(ItemStack aStack) {
+ return 25;
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return true;
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Vacuum Furnace / Dehydrator";
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return 4;
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 50;
+ }
+
+ @Override
+ public boolean requiresVanillaGtGUI() {
+ return true;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return "ElectricBlastFurnace";
+ }
+
+ public boolean checkRecipe(ItemStack aStack) {
+ return checkRecipeGeneric(getMaxParallelRecipes(), getEuDiscountForParallelism(), 120);
+ }
+
+ @Override
+ public boolean checkRecipeGeneric(ItemStack[] aItemInputs, FluidStack[] aFluidInputs, int aMaxParallelRecipes,
+ int aEUPercent, int aSpeedBonusPercent, int aOutputChanceRoll) {
+ // Based on the Processing Array. A bit overkill, but very flexible.
+
+ // Reset outputs and progress stats
+ this.mEUt = 0;
+ this.mMaxProgresstime = 0;
+ this.mOutputItems = new ItemStack[] {};
+ this.mOutputFluids = new FluidStack[] {};
+
+ long tVoltage = getMaxInputVoltage();
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+ Logger.WARNING("Running checkRecipeGeneric(0)");
+
+ GT_Recipe tRecipe = this.getRecipeMap().findRecipe(getBaseMetaTileEntity(), mLastRecipe, false,
+ gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs);
+
+ Logger.WARNING("Running checkRecipeGeneric(1)");
+ // Remember last recipe - an optimization for findRecipe()
+ this.mLastRecipe = tRecipe;
+
+ if (tRecipe == null || this.mHeatingCapacity < tRecipe.mSpecialValue) {
+ Logger.WARNING("BAD RETURN - 1");
+ return false;
+ }
+
+ if (!this.canBufferOutputs(tRecipe, aMaxParallelRecipes)) {
+ Logger.WARNING("BAD RETURN - 2");
+ return false;
+ }
+
+ // EU discount
+ float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f;
+ int tHeatCapacityDivTiers = (mHeatingCapacity - tRecipe.mSpecialValue) / 900;
+ float tTotalEUt = 0.0f;
+
+ int parallelRecipes = 0;
+ // Count recipes to do in parallel, consuming input items and fluids and
+ // considering input voltage limits
+ for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tVoltage - tRecipeEUt); parallelRecipes++) {
+ if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) {
+ Logger.WARNING("Broke at " + parallelRecipes + ".");
+ break;
+ }
+ Logger.WARNING("Bumped EU from " + tTotalEUt + " to " + (tTotalEUt + tRecipeEUt) + ".");
+ tTotalEUt += tRecipeEUt;
+ }
+
+ if (parallelRecipes == 0) {
+ Logger.WARNING("BAD RETURN - 3");
+ return false;
+ }
+
+ // -- Try not to fail after this point - inputs have already been consumed! --
+
+ // Convert speed bonus to duration multiplier
+ // e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration.
+ aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent);
+ float tTimeFactor = 100.0f / (100.0f + aSpeedBonusPercent);
+ this.mMaxProgresstime = (int) (tRecipe.mDuration * tTimeFactor);
+ int rInt = 2;
+
+ this.mEUt = (int) Math.ceil(tTotalEUt);
+
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+
+ // Overclock
+ if (this.mEUt <= 16) {
+ this.mEUt = (this.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
+ this.mMaxProgresstime = (this.mMaxProgresstime / (1 << tTier - 1));
+ } else {
+ while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
+ this.mEUt *= 4;
+ this.mMaxProgresstime /= (tHeatCapacityDivTiers >= rInt ? 4 : 2);
+ }
+ }
+
+ if (tHeatCapacityDivTiers > 0) {
+ this.mEUt = (int) (this.mEUt * (Math.pow(0.95, tHeatCapacityDivTiers)));
+ }
+ if (this.mEUt > 0) {
+ this.mEUt = (-this.mEUt);
+ }
+
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+
+ // Collect fluid outputs
+ FluidStack[] tOutputFluids = new FluidStack[tRecipe.mFluidOutputs.length];
+ for (int h = 0; h < tRecipe.mFluidOutputs.length; h++) {
+ if (tRecipe.getFluidOutput(h) != null) {
+ tOutputFluids[h] = tRecipe.getFluidOutput(h).copy();
+ tOutputFluids[h].amount *= parallelRecipes;
+ }
+ }
+
+ // Collect output item types
+ ItemStack[] tOutputItems = new ItemStack[tRecipe.mOutputs.length];
+ for (int h = 0; h < tRecipe.mOutputs.length; h++) {
+ if (tRecipe.getOutput(h) != null) {
+ tOutputItems[h] = tRecipe.getOutput(h).copy();
+ tOutputItems[h].stackSize = 0;
+ }
+ }
+
+ // Set output item stack sizes (taking output chance into account)
+ for (int f = 0; f < tOutputItems.length; f++) {
+ if (tRecipe.mOutputs[f] != null && tOutputItems[f] != null) {
+ for (int g = 0; g < parallelRecipes; g++) {
+ if (getBaseMetaTileEntity().getRandomNumber(aOutputChanceRoll) < tRecipe.getOutputChance(f))
+ tOutputItems[f].stackSize += tRecipe.mOutputs[f].stackSize;
+ }
+ }
+ }
+
+ tOutputItems = removeNulls(tOutputItems);
+
+ // Sanitize item stack size, splitting any stacks greater than max stack size
+ List<ItemStack> splitStacks = new ArrayList<ItemStack>();
+ for (ItemStack tItem : tOutputItems) {
+ while (tItem.getMaxStackSize() < tItem.stackSize) {
+ ItemStack tmp = tItem.copy();
+ tmp.stackSize = tmp.getMaxStackSize();
+ tItem.stackSize = tItem.stackSize - tItem.getMaxStackSize();
+ splitStacks.add(tmp);
+ }
+ }
+
+ if (splitStacks.size() > 0) {
+ ItemStack[] tmp = new ItemStack[splitStacks.size()];
+ tmp = splitStacks.toArray(tmp);
+ tOutputItems = ArrayUtils.addAll(tOutputItems, tmp);
+ }
+
+ // Strip empty stacks
+ List<ItemStack> tSList = new ArrayList<ItemStack>();
+ for (ItemStack tS : tOutputItems) {
+ if (tS.stackSize > 0)
+ tSList.add(tS);
+ }
+ tOutputItems = tSList.toArray(new ItemStack[tSList.size()]);
+
+ // Commit outputs
+ this.mOutputItems = tOutputItems;
+ this.mOutputFluids = tOutputFluids;
+ updateSlots();
+
+ // Play sounds (GT++ addition - GT multiblocks play no sounds)
+ startProcess();
+
+ Logger.WARNING("GOOD RETURN - 1");
+ return true;
+
+ }
+
+ @Override
+ public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ mDehydratorMode = Utils.invertBoolean(mDehydratorMode);
+ String aMode = mDehydratorMode ? "Dehydrator" : "Vacuum Furnace";
+ PlayerUtils.messagePlayer(aPlayer, "Mode: "+aMode);
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ super.saveNBTData(aNBT);
+ aNBT.setBoolean("mDehydratorMode", mDehydratorMode);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+ mDehydratorMode = aNBT.getBoolean("mDehydratorMode");
+ }
+
+}
+
+
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java
index ac362e2c40..dd00c9731d 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java
@@ -28,6 +28,7 @@ import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import gtPlusPlus.xmod.gregtech.common.StaticFields59;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
@@ -171,68 +172,9 @@ public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase
CASING_TEXTURE_ID)) {
return false;
}*/
+ Block tUsedBlock = aBaseMetaTileEntity.getBlockOffset(xDir + 1, 2, zDir);
byte tUsedMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + 1, 2, zDir);
-
- if (!CORE.GTNH) {
- switch (tUsedMeta) {
- case 0:
- this.mHeatingCapacity = 1800;
- break;
- case 1:
- this.mHeatingCapacity = 2700;
- break;
- case 2:
- this.mHeatingCapacity = 3600;
- break;
- case 3:
- this.mHeatingCapacity = 4500;
- break;
- case 4:
- this.mHeatingCapacity = 5400;
- break;
- case 5:
- this.mHeatingCapacity = 7200;
- break;
- case 6:
- this.mHeatingCapacity = 9001;
- break;
- default:Logger.INFO("Heating Coils are bad.");
- return false;
- }
- } else {
- switch (tUsedMeta) {
- case 0:
- this.mHeatingCapacity = 1801;
- break;
- case 1:
- this.mHeatingCapacity = 2701;
- break;
- case 2:
- this.mHeatingCapacity = 3601;
- break;
- case 3:
- this.mHeatingCapacity = 4501;
- break;
- case 4:
- this.mHeatingCapacity = 5401;
- break;
- case 5:
- this.mHeatingCapacity = 7201;
- break;
- case 6:
- this.mHeatingCapacity = 9001;
- break;
- case 7:
- this.mHeatingCapacity = 9901;
- break;
- case 8:
- this.mHeatingCapacity = 10801;
- break;
- default:
- Logger.INFO("Heating Coils are bad.");
- return false;
- }
- }
+ this.mHeatingCapacity = StaticFields59.getHeatingCapacityForCoil(tUsedBlock, tUsedMeta);
for (int i = -1; i < 2; i++) {
for (int j = -1; j < 2; j++) {