aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/gregtech/common')
-rw-r--r--src/main/java/gregtech/common/GT_Proxy.java1
-rw-r--r--src/main/java/gregtech/common/GT_RecipeAdder.java7
-rw-r--r--src/main/java/gregtech/common/items/ItemComb.java1
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java62
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java19
5 files changed, 80 insertions, 10 deletions
diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java
index bc2d9cd218..65dc9f8f65 100644
--- a/src/main/java/gregtech/common/GT_Proxy.java
+++ b/src/main/java/gregtech/common/GT_Proxy.java
@@ -193,6 +193,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler {
public boolean mForceFreeFace = true;
public boolean mBrickedBlastFurnace = true;
public boolean mEasierEVPlusCables = false;
+ public boolean mMixedOreOnlyYieldsTwoThirdsOfPureOre = false;
public GT_Proxy() {
GameRegistry.registerFuelHandler(this);
diff --git a/src/main/java/gregtech/common/GT_RecipeAdder.java b/src/main/java/gregtech/common/GT_RecipeAdder.java
index 1e1848705b..8d8b27c07e 100644
--- a/src/main/java/gregtech/common/GT_RecipeAdder.java
+++ b/src/main/java/gregtech/common/GT_RecipeAdder.java
@@ -194,7 +194,8 @@ public class GT_RecipeAdder implements IGT_RecipeAdder {
if ((aDuration = GregTech_API.sRecipeFile.get("blastfurnace", aInput1, aDuration)) <= 0) {
return false;
}
- GT_Recipe.GT_Recipe_Map.sBlastRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2}, new ItemStack[]{aOutput1, aOutput2}, null, null, new FluidStack[]{aFluidInput}, null, aDuration, aEUt, aLevel);
+ GT_Recipe.GT_Recipe_Map.sBlastRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2}, new ItemStack[]{aOutput1, aOutput2}, null, null,
+ new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUt, aLevel);
return true;
}
@@ -612,6 +613,10 @@ public class GT_RecipeAdder implements IGT_RecipeAdder {
return addBrewingRecipe(aIngredient, aInput, aOutput, 128, 4, aHidden);
}
+ public boolean addBrewingRecipeCustom(ItemStack aIngredient, Fluid aInput, Fluid aOutput, int aDuration, int aEUt, boolean aHidden) {
+ return addBrewingRecipe(aIngredient, aInput, aOutput, aDuration, aEUt, aHidden);
+ }
+
public boolean addFermentingRecipe(FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt, boolean aHidden) {
if ((aInput == null) || (aOutput == null)) {
return false;
diff --git a/src/main/java/gregtech/common/items/ItemComb.java b/src/main/java/gregtech/common/items/ItemComb.java
index 7776ccf465..579b7d07bd 100644
--- a/src/main/java/gregtech/common/items/ItemComb.java
+++ b/src/main/java/gregtech/common/items/ItemComb.java
@@ -175,7 +175,6 @@ public class ItemComb extends Item {
tComb = getStackForType(CombType.LEAD);
addSpecialCent(tComb, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Lead, 1), 45);
addProcess(tComb, Materials.Lead, 100);
- addProcess(tComb, Materials.Galena, 100);
tComb = getStackForType(CombType.IRON);
addProcess(tComb, Materials.Iron, 100);
addProcess(tComb, Materials.Magnetite, 100);
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java
index bd63350319..3913d8a0f3 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java
@@ -1,6 +1,7 @@
package gregtech.common.tileentities.machines.multi;
import gregtech.api.GregTech_API;
+import gregtech.api.enums.Materials;
import gregtech.api.enums.Textures;
import gregtech.api.gui.GT_GUIContainer_MultiMachine;
import gregtech.api.interfaces.ITexture;
@@ -8,8 +9,10 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
import net.minecraft.entity.player.InventoryPlayer;
@@ -23,6 +26,9 @@ import java.util.ArrayList;
public class GT_MetaTileEntity_ElectricBlastFurnace
extends GT_MetaTileEntity_MultiBlockBase {
private int mHeatingCapacity = 0;
+ private int controllerY;
+ private FluidStack[] pollutionFluidStacks = new FluidStack[]{Materials.CarbonDioxide.getGas(1000),
+ Materials.CarbonMonoxide.getGas(1000), Materials.SulfurDioxide.getGas(1000)};
public GT_MetaTileEntity_ElectricBlastFurnace(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
@@ -46,6 +52,8 @@ public class GT_MetaTileEntity_ElectricBlastFurnace
"1x Energy Hatch (Any bottom layer casing)",
"1x Maintenance Hatch (Any bottom layer casing)",
"1x Muffler Hatch (Top middle)",
+ "1x Output Hatch to recover CO2/CO/SO2 (optional, any top layer casing),",
+ " Recovery scales with Muffler Hatch tier",
"Heat Proof Machine Casings for the rest",
"Each 900K over the min. Heat Capacity grants 5% speedup (multiplicatively)",
"Each 1800K over the min. Heat Capacity allows for one upgraded overclock",
@@ -133,6 +141,7 @@ public class GT_MetaTileEntity_ElectricBlastFurnace
}
this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0), tRecipe.getOutput(1)};
+ this.mOutputFluids = new FluidStack[]{tRecipe.getFluidOutput(0)};
updateSlots();
return true;
}
@@ -141,6 +150,7 @@ public class GT_MetaTileEntity_ElectricBlastFurnace
}
private boolean checkMachineFunction(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ controllerY = aBaseMetaTileEntity.getYCoord();
int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
@@ -196,11 +206,13 @@ public class GT_MetaTileEntity_ElectricBlastFurnace
if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 1, zDir + j) != tUsedMeta) {
return false;
}
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 3, zDir + j) != GregTech_API.sBlockCasings1) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 3, zDir + j) != 11) {
- return false;
+ if (!addOutputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 3, zDir + j), 11)) {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 3, zDir + j) != GregTech_API.sBlockCasings1) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 3, zDir + j) != 11) {
+ return false;
+ }
}
}
}
@@ -267,7 +279,45 @@ public class GT_MetaTileEntity_ElectricBlastFurnace
}
}
}
-
+ @Override
+ public boolean addOutput(FluidStack aLiquid) {
+ if (aLiquid == null) return false;
+ int targetHeight;
+ FluidStack tLiquid = aLiquid.copy();
+ boolean isOutputPollution = false;
+ for (FluidStack pollutionFluidStack : pollutionFluidStacks) {
+ if (tLiquid.isFluidEqual(pollutionFluidStack)) {
+ isOutputPollution = true;
+ break;
+ }
+ }
+ if (isOutputPollution) {
+ targetHeight = this.controllerY + 3;
+ int pollutionReduction = 0;
+ for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) {
+ if (isValidMetaTileEntity(tHatch)) {
+ pollutionReduction = 100 - tHatch.calculatePollutionReduction(100);
+ break;
+ }
+ }
+ tLiquid.amount = tLiquid.amount * (pollutionReduction + 5) / 100;
+ } else {
+ targetHeight = this.controllerY;
+ }
+ for (GT_MetaTileEntity_Hatch_Output tHatch : mOutputHatches) {
+ if (isValidMetaTileEntity(tHatch) && GT_ModHandler.isSteam(aLiquid) ? tHatch.outputsSteam() : tHatch.outputsLiquids()) {
+ if (tHatch.getBaseMetaTileEntity().getYCoord() == targetHeight) {
+ int tAmount = tHatch.fill(tLiquid, false);
+ if (tAmount >= tLiquid.amount) {
+ return tHatch.fill(tLiquid, true) >= tLiquid.amount;
+ } else if (tAmount > 0) {
+ tLiquid.amount = tLiquid.amount - tHatch.fill(tLiquid, true);
+ }
+ }
+ }
+ }
+ return false;
+ }
@Override
public String[] getInfoData() {
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java
index 88c03bca9b..894242bbce 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java
@@ -24,6 +24,8 @@ import java.util.ArrayList;
import java.util.Arrays;
public class GT_MetaTileEntity_PyrolyseOven extends GT_MetaTileEntity_MultiBlockBase {
+
+ private int coilMetaID;
public GT_MetaTileEntity_PyrolyseOven(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
@@ -38,13 +40,16 @@ public class GT_MetaTileEntity_PyrolyseOven extends GT_MetaTileEntity_MultiBlock
"Controller Block for the Pyrolyse Oven",
"Industrial Charcoal producer and Oil from Plants",
"Size(WxHxD): 5x4x5, Controller (Bottom center)",
- "3x1x3 Cupronickel or Kanthal Heating Coils (At the center of the bottom layer)",
+ "3x1x3 of Heating Coils (At the center of the bottom layer)",
"1x Input Hatch/Bus (Centered 3x1x3 area in Top layer)",
"1x Output Hatch/Bus (Any bottom layer casing)",
"1x Maintenance Hatch (Any bottom layer casing)",
"1x Muffler Hatch (Centered 3x1x3 area in Top layer)",
"1x Energy Hatch (Any bottom layer casing)",
"Pyrolyse Oven Casings for the rest (60 at least!)",
+ "Processing speed scales linearly with Coil tier:",
+ "CuNi: 50%, FeAlCr: 100%, Ni4Cr: 150%, Fe50CW: 200%, etc.",
+ "EU/t is not affected by Coil tier",
"Causes " + 20 * getPollutionPerTick(null) + " Pollution per second"};
}
@@ -120,6 +125,7 @@ public class GT_MetaTileEntity_PyrolyseOven extends GT_MetaTileEntity_MultiBlock
if (this.mEUt > 0) {
this.mEUt = (-this.mEUt);
}
+ this.mMaxProgresstime = Math.max(mMaxProgresstime * 2 / (1 + coilMetaID), 1);
if (tRecipe.mOutputs.length > 0) this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0)};
if (tRecipe.mFluidOutputs.length > 0)
this.mOutputFluids = new FluidStack[]{tRecipe.getFluidOutput(0)};
@@ -139,6 +145,7 @@ public class GT_MetaTileEntity_PyrolyseOven extends GT_MetaTileEntity_MultiBlock
int CasingMeta= Loader.isModLoaded("dreamcraft")?2:0;
replaceDeprecatedCoils(aBaseMetaTileEntity);
+ boolean firstCoil = true;
for (int i = -2; i < 3; i++) {
for (int j = -2; j < 3; j++) {
for (int h = 0; h < 4; h++) {
@@ -148,8 +155,16 @@ public class GT_MetaTileEntity_PyrolyseOven extends GT_MetaTileEntity_MultiBlock
if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != GregTech_API.sBlockCasings5) {
return false;
}
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 0 && aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 1) {
+ int metaID = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j);
+ if (metaID > 6) {
return false;
+ } else {
+ if (firstCoil) {
+ this.coilMetaID = metaID;
+ firstCoil = false;
+ } else if (metaID != this.coilMetaID) {
+ return false;
+ }
}
} else if (h == 3) {// innen decke (ulv casings + input + muffler)
if ((!addInputToMachineList(tTileEntity, 111)) && (!addMufflerToMachineList(tTileEntity, 111))) {