aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/xmod
diff options
context:
space:
mode:
authorJohann Bernhardt <johann.bernhardt@tum.de>2021-12-13 23:39:55 +0100
committerJohann Bernhardt <johann.bernhardt@tum.de>2021-12-13 23:39:55 +0100
commita2a9ad400f23726885020f1a77627f9561487948 (patch)
tree9116c76f46d49d951ac63442af335a0bd6016052 /src/main/java/gtPlusPlus/xmod
parent20b5d2932ef44e1c96104d6ec0528012f5c83d21 (diff)
parent868ddab78797403d58dbc84d357f792926e94f42 (diff)
downloadGT5-Unofficial-a2a9ad400f23726885020f1a77627f9561487948.tar.gz
GT5-Unofficial-a2a9ad400f23726885020f1a77627f9561487948.tar.bz2
GT5-Unofficial-a2a9ad400f23726885020f1a77627f9561487948.zip
Merge tag '1.7.20' into unified-build-script2
# Conflicts: # build.properties # src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluorite.java
Diffstat (limited to 'src/main/java/gtPlusPlus/xmod')
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake.java131
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialArcFurnace.java34
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluorite.java224
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MaterialProcessing.java68
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Ore.java29
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/loaders/misc/AddCustomMachineToPA.java39
6 files changed, 372 insertions, 153 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake.java
index e6fd5dc797..5fb3b11d08 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake.java
@@ -1,30 +1,30 @@
package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations;
-import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.Fluid;
-import net.minecraftforge.fluids.FluidStack;
-import net.minecraft.world.World;
-import net.minecraft.item.ItemStack;
+import java.lang.reflect.Field;
+import gregtech.api.enums.Textures;
+import gregtech.api.interfaces.IIconContainer;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.MetaTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input;
+import gregtech.api.objects.GT_RenderedTexture;
import gtPlusPlus.api.objects.random.XSTR;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
-
-import gregtech.api.metatileentity.MetaTileEntity;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-
-import java.lang.reflect.Field;
-
import net.minecraft.entity.player.EntityPlayer;
-import gregtech.api.interfaces.IIconContainer;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.enums.Textures;
-import gregtech.api.interfaces.ITexture;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.world.World;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.Fluid;
+import net.minecraftforge.fluids.FluidStack;
public class GT_MetaTileEntity_Hatch_AirIntake extends GT_MetaTileEntity_Hatch_Input {
+
private static XSTR floatGen;
+ public int mProgresstime = 0, mMaxProgresstime = 0;
public GT_MetaTileEntity_Hatch_AirIntake(final int aID, final String aName, final String aNameRegional,
final int aTier) {
@@ -127,17 +127,42 @@ public class GT_MetaTileEntity_Hatch_AirIntake extends GT_MetaTileEntity_Hatch_I
public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
super.onPostTick(aBaseMetaTileEntity, aTick);
- if (this.getBaseMetaTileEntity().isActive() && addAirToHatch(aTick)) {
- if (aTick % 8 == 0) {
- if (aBaseMetaTileEntity.isClientSide()) {
- this.pollutionParticles(this.getBaseMetaTileEntity().getWorld(), "cloud");
- }
+
+ if (!aBaseMetaTileEntity.isAllowedToWork()) {
+ aBaseMetaTileEntity.setActive(false);
+ mProgresstime = 0;
+ mMaxProgresstime = 0;
+ }
+ else {
+ aBaseMetaTileEntity.setActive(true);
+ mMaxProgresstime = 4;
+ if (++mProgresstime >= mMaxProgresstime) {
+ addAirToHatch(aTick);
+ mProgresstime = 0;
}
- }
+ }
}
+
+ @Override
+ public int getProgresstime() {
+ return mProgresstime;
+ }
+
+ @Override
+ public int maxProgresstime() {
+ return mMaxProgresstime;
+ }
+
+ @Override
+ public int increaseProgress(int aProgress) {
+ mProgresstime += aProgress;
+ return mMaxProgresstime - mProgresstime;
+ }
public void pollutionParticles(final World aWorld, final String name) {
-
+ if (this.getBaseMetaTileEntity().isServerSide()) {
+ return;
+ }
final float ran1 = GT_MetaTileEntity_Hatch_AirIntake.floatGen.nextFloat();
float ran2 = 0.0f;
float ran3 = 0.0f;
@@ -159,14 +184,13 @@ public class GT_MetaTileEntity_Hatch_AirIntake extends GT_MetaTileEntity_Hatch_I
zSpd = (float) Math.cos(temp) * 0.1f;
ySpd = -ySpd;
yPos = yPos - 0.8f;
- } else {
+ }
+ else {
xSpd = aDir.offsetX * (0.1f + 0.2f * GT_MetaTileEntity_Hatch_AirIntake.floatGen.nextFloat());
zSpd = aDir.offsetZ * (0.1f + 0.2f * GT_MetaTileEntity_Hatch_AirIntake.floatGen.nextFloat());
xSpd = -xSpd;
zSpd = -zSpd;
-
-
}
aWorld.spawnParticle(name, (double) (xPos + ran1 * 0.5f),
@@ -210,49 +234,24 @@ public class GT_MetaTileEntity_Hatch_AirIntake extends GT_MetaTileEntity_Hatch_I
if (AIR == this.mFluid.getFluid()) {
return true;
}
- else return false;
}
- return true;
+ return false;
}
public boolean addAirToHatch(long aTick) {
if (!this.getBaseMetaTileEntity().getAirAtSide(this.getBaseMetaTileEntity().getFrontFacing())) {
return false;
}
- boolean a1 = canTankBeFilled();
- if (aTick % 4 != 0 && a1) {
- return true;
- }
- else if (aTick % 4 != 0 && !a1) {
- return false;
+ boolean didFill = this.fill(FluidUtils.getAir(1000), true) > 0;
+ if (didFill) {
+ this.pollutionParticles(this.getBaseMetaTileEntity().getWorld(), "cloud");
}
- else {
- if (!isAirInHatch()) {
- return false;
- }
- if (this.mFluid != null && a1) {
- this.mFluid.amount += 1000;
- return true;
- }
- else if (this.mFluid != null && !a1) {
- return false;
- }
- else {
- if (this.mFluid == null) {
- this.mFluid = FluidUtils.getFluidStack("air", 1000);
- return true;
- }
- else {
- //Not sure how any other fluid got in here
- return false;
- }
- }
- }
+ return didFill;
}
@Override
public boolean canTankBeFilled() {
- if (this.mFluid == null || (this.mFluid != null && ((this.mFluid.amount+1000) <= this.getCapacity()))) {
+ if (this.mFluid == null || (this.mFluid != null && (this.mFluid.amount <= this.getCapacity()))) {
return true;
}
return false;
@@ -265,12 +264,12 @@ public class GT_MetaTileEntity_Hatch_AirIntake extends GT_MetaTileEntity_Hatch_I
@Override
public boolean doesFillContainers() {
- return false;
+ return true;
}
@Override
public int fill(FluidStack aFluid, boolean doFill) {
- return 0;
+ return super.fill(aFluid, doFill);
}
@Override
@@ -287,4 +286,18 @@ public class GT_MetaTileEntity_Hatch_AirIntake extends GT_MetaTileEntity_Hatch_I
public int fill_default(ForgeDirection aSide, FluidStack aFluid, boolean doFill) {
return 0;
}
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ aNBT.setInteger("mProgresstime", mProgresstime);
+ aNBT.setInteger("mMaxProgresstime", mMaxProgresstime);
+ super.saveNBTData(aNBT);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ mProgresstime = aNBT.getInteger("mProgresstime");
+ mMaxProgresstime = aNBT.getInteger("mMaxProgresstime");
+ super.loadNBTData(aNBT);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialArcFurnace.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialArcFurnace.java
index 35a92d5be3..eae867d11d 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialArcFurnace.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialArcFurnace.java
@@ -1,14 +1,26 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass;
+import static gregtech.api.util.GT_StructureUtility.ofHatchAdder;
+
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
import com.gtnewhorizon.structurelib.structure.StructureDefinition;
+
import gregtech.api.GregTech_API;
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.metatileentity.implementations.*;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maintenance;
+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_Hatch_OutputBus;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import gregtech.api.util.GT_Recipe;
@@ -26,12 +38,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.*;
-import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
-import static gregtech.api.util.GT_StructureUtility.ofHatchAdder;
-
-public class GregtechMetaTileEntity_IndustrialArcFurnace
-extends GregtechMeta_MultiBlockBase {
+public class GregtechMetaTileEntity_IndustrialArcFurnace extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialArcFurnace> {
//862
private static final int mCasingTextureID = TAE.getIndexFromPage(3, 3);
@@ -70,7 +77,7 @@ extends GregtechMeta_MultiBlockBase {
tt.addMachineType(getMachineType())
.addInfo("Controller Block for Industrial Arc Furnace")
.addInfo("250% faster than using single block machines of the same voltage")
- .addInfo("Processes 8 items per voltage tier")
+ .addInfo("Processes 8 items per voltage tier * W/L")
.addInfo("Max Size required to process Plasma recipes")
.addPollutionAmount(getPollutionPerSecond(null))
.addSeparator()
@@ -189,7 +196,7 @@ extends GregtechMeta_MultiBlockBase {
mCasing = 0;
clearHatches();
if (checkPiece(mName + "7", 3, 3, 0)) {
- mSize = 3;
+ mSize = 7;
return mCasing >= 10 && checkHatch();
}
return false;
@@ -226,7 +233,7 @@ extends GregtechMeta_MultiBlockBase {
@Override
public boolean checkRecipe(final ItemStack aStack) {
- return this.checkRecipeGeneric(this.mSize * 8 * GT_Utility.getTier(this.getMaxInputVoltage()), 100, 250);
+ return this.checkRecipeGeneric(getMaxParallelRecipes(), 100, 250);
}
@Override
@@ -288,7 +295,7 @@ extends GregtechMeta_MultiBlockBase {
@Override
public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- if (this.mSize > 3) {
+ if (this.mSize > 5) {
this.mPlasmaMode = Utils.invertBoolean(mPlasmaMode);
if (mPlasmaMode) {
PlayerUtils.messagePlayer(aPlayer, "["+EnumChatFormatting.RED+"MODE"+EnumChatFormatting.RESET+"] "+EnumChatFormatting.LIGHT_PURPLE+"Plasma"+EnumChatFormatting.RESET);
@@ -296,7 +303,10 @@ extends GregtechMeta_MultiBlockBase {
else {
PlayerUtils.messagePlayer(aPlayer, "["+EnumChatFormatting.RED+"MODE"+EnumChatFormatting.RESET+"] "+EnumChatFormatting.YELLOW+"Electric"+EnumChatFormatting.RESET);
}
- }
+ }
+ else {
+ PlayerUtils.messagePlayer(aPlayer, "["+EnumChatFormatting.RED+"MODE"+EnumChatFormatting.RESET+"] "+EnumChatFormatting.GRAY+"Cannot change mode, structure not large enough."+EnumChatFormatting.RESET);
+ }
}
@Override
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluorite.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluorite.java
new file mode 100644
index 0000000000..b285d41652
--- /dev/null
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluorite.java
@@ -0,0 +1,224 @@
+package gtPlusPlus.xmod.gregtech.loaders;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import gregtech.api.enums.GT_Values;
+import gregtech.api.util.GT_ModHandler;
+import gtPlusPlus.api.interfaces.RunnableWithInfo;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.api.objects.data.AutoMap;
+import gtPlusPlus.api.objects.data.Pair;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.material.Material;
+import gtPlusPlus.core.material.MaterialGenerator;
+import gtPlusPlus.core.material.MaterialStack;
+import gtPlusPlus.core.material.nuclear.FLUORIDES;
+import gtPlusPlus.core.material.state.MaterialState;
+import gtPlusPlus.core.recipe.common.CI;
+import gtPlusPlus.core.util.minecraft.FluidUtils;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import gtPlusPlus.core.util.minecraft.MaterialUtils;
+import gtPlusPlus.core.util.minecraft.RecipeUtils;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.FluidStack;
+
+public class RecipeGen_Fluorite extends RecipeGen_Base {
+
+ public final static Set<RunnableWithInfo<Material>> mRecipeGenMap = new HashSet<RunnableWithInfo<Material>>();
+
+ static {
+ MaterialGenerator.mRecipeMapsToGenerate.put(mRecipeGenMap);
+ }
+
+ public RecipeGen_Fluorite(final Material material){
+ this.toGenerate = material;
+ mRecipeGenMap.add(this);
+
+
+ /**
+ * Shaped Crafting
+ */
+ RecipeUtils.addShapedRecipe(
+ CI.craftingToolHammer_Hard, null, null,
+ material.getCrushedPurified(1), null, null,
+ null, null, null,
+ material.getDustPurified(1));
+
+ RecipeUtils.addShapedRecipe(
+ CI.craftingToolHammer_Hard, null, null,
+ material.getCrushed(1), null, null,
+ null, null, null,
+ material.getDustImpure(1));
+
+ RecipeUtils.addShapedRecipe(
+ CI.craftingToolHammer_Hard, null, null,
+ material.getCrushedCentrifuged(1), null, null,
+ null, null, null,
+ material.getDust(1));
+
+
+
+ final ItemStack normalDust = material.getDust(1);
+ final ItemStack smallDust = material.getSmallDust(1);
+ final ItemStack tinyDust = material.getTinyDust(1);
+
+ if (RecipeUtils.addShapedRecipe(
+ tinyDust, tinyDust, tinyDust,
+ tinyDust, tinyDust, tinyDust,
+ tinyDust, tinyDust, tinyDust,
+ normalDust)){
+ Logger.WARNING("9 Tiny dust to 1 Dust Recipe: "+material.getLocalizedName()+" - Success");
+ }
+ else {
+ Logger.WARNING("9 Tiny dust to 1 Dust Recipe: "+material.getLocalizedName()+" - Failed");
+ }
+
+ if (RecipeUtils.addShapedRecipe(
+ normalDust, null, null,
+ null, null, null,
+ null, null, null,
+ material.getTinyDust(9))){
+ Logger.WARNING("9 Tiny dust from 1 Recipe: "+material.getLocalizedName()+" - Success");
+ }
+ else {
+ Logger.WARNING("9 Tiny dust from 1 Recipe: "+material.getLocalizedName()+" - Failed");
+ }
+
+ if (RecipeUtils.addShapedRecipe(
+ smallDust, smallDust, null,
+ smallDust, smallDust, null,
+ null, null, null,
+ normalDust)){
+ Logger.WARNING("4 Small dust to 1 Dust Recipe: "+material.getLocalizedName()+" - Success");
+ }
+ else {
+ Logger.WARNING("4 Small dust to 1 Dust Recipe: "+material.getLocalizedName()+" - Failed");
+ }
+
+ if (RecipeUtils.addShapedRecipe(
+ null, normalDust, null,
+ null, null, null,
+ null, null, null,
+ material.getSmallDust(4))){
+ Logger.WARNING("4 Small dust from 1 Dust Recipe: "+material.getLocalizedName()+" - Success");
+ }
+ else {
+ Logger.WARNING("4 Small dust from 1 Dust Recipe: "+material.getLocalizedName()+" - Failed");
+ }
+ }
+
+ @Override
+ public void run() {
+ generateRecipes(this.toGenerate);
+ }
+
+ public static void generateRecipes(final Material material){
+
+ int tVoltageMultiplier = MaterialUtils.getVoltageForTier(material.vTier);
+
+ final ItemStack dustStone = ItemUtils.getItemStackOfAmountFromOreDict("dustStone", 1);
+
+
+ ItemStack tinyDustA = FLUORIDES.FLUORITE.getTinyDust(1);
+ ItemStack tinyDustB = FLUORIDES.FLUORITE.getTinyDust(1);
+ ItemStack matDust = FLUORIDES.FLUORITE.getDust(1);
+ ItemStack matDustA = FLUORIDES.FLUORITE.getDust(1);
+
+ /**
+ * Package
+ */
+ //Allow ore dusts to be packaged
+ if (ItemUtils.checkForInvalidItems(material.getSmallDust(1)) && ItemUtils.checkForInvalidItems(material.getTinyDust(1))) {
+ RecipeGen_DustGeneration.generatePackagerRecipes(material);
+ }
+
+
+ /**
+ * Macerate
+ */
+ //Macerate ore to Crushed
+ if (GT_Values.RA.addPulveriserRecipe(material.getOre(1), new ItemStack[]{material.getCrushed(2)}, new int[]{10000}, 20*20, tVoltageMultiplier/2)){
+ Logger.MATERIALS("[Macerator] Added Recipe: 'Macerate ore to Crushed ore'");
+ }
+ //Macerate Centrifuged to Pure Dust
+ if (GT_Values.RA.addPulveriserRecipe(material.getCrushedCentrifuged(1), new ItemStack[]{matDust, matDustA}, new int[]{10000, 1000}, 20*20, tVoltageMultiplier/2)){
+ Logger.MATERIALS("[Macerator] Added Recipe: 'Macerate Centrifuged ore to Pure Dust'");
+ }
+ if (GT_ModHandler.addThermalCentrifugeRecipe(material.getCrushedPurified(1), (int) Math.min(5000L, Math.abs(material.getMass() * 20L)), material.getCrushedCentrifuged(1), tinyDustA, dustStone)){
+ Logger.MATERIALS("[ThermalCentrifuge] Added Recipe: 'Washed ore to Centrifuged Ore' | Input: "+material.getCrushedPurified(1).getDisplayName()+" | Outputs: "+material.getCrushedCentrifuged(1).getDisplayName()+", "+tinyDustA.getDisplayName()+", "+dustStone.getDisplayName()+".");
+ }
+
+ GT_Values.RA.addChemicalBathRecipe(
+ FLUORIDES.FLUORITE.getCrushed(2),
+ FluidUtils.getFluidStack("hydrogen", 2000),
+ FLUORIDES.FLUORITE.getCrushedPurified(8),
+ FLUORIDES.FLUORITE.getDustImpure(4),
+ FLUORIDES.FLUORITE.getDustPurified(2),
+ new int[] { 10000, 5000, 1000 },
+ 30 * 20,
+ 240);
+
+ /**
+ * Forge Hammer
+ */
+ if (GT_Values.RA.addForgeHammerRecipe(material.getCrushedCentrifuged(1), matDust, 10, tVoltageMultiplier/4)){
+ Logger.MATERIALS("[ForgeHammer] Added Recipe: 'Crushed Centrifuged to Pure Dust'");
+ }
+
+ /**
+ * Centrifuge
+ */
+ //Purified Dust to Clean
+ if (GT_Values.RA.addCentrifugeRecipe(
+ material.getDustPurified(1), null,
+ null, //In Fluid
+ null, //Out Fluid
+ matDust, tinyDustA,null,
+ null, null,null,
+ new int[]{10000, 10000}, //Chances
+ (int) Math.max(1L, material.getMass() * 8L), //Time
+ tVoltageMultiplier/2)){ //Eu
+ Logger.MATERIALS("[Centrifuge] Added Recipe: Purified Dust to Clean Dust");
+ }
+
+ //Impure Dust to Clean
+ if (GT_Values.RA.addCentrifugeRecipe(
+ material.getDustImpure(1), null,
+ null, //In Fluid
+ null, //Out Fluid
+ matDust, tinyDustB,null,
+ null, null,null,
+ new int[]{10000, 10000}, //Chances
+ (int) Math.max(1L, material.getMass() * 8L), //Time
+ tVoltageMultiplier/2)){ //Eu
+ Logger.MATERIALS("[Centrifuge] Added Recipe: Inpure Dust to Clean Dust");
+ }
+
+ // CaF2 + H2SO4 → CaSO4(solid) + 2 HF
+ FluidStack aGregtechHydro = FluidUtils.getFluidStack("hydrofluoricacid_gt5u", 16000);
+ if (aGregtechHydro == null) {
+ aGregtechHydro = FluidUtils.getFluidStack("hydrofluoricacid", 16000);
+ }
+
+ CORE.RA.addDehydratorRecipe(
+ new ItemStack[] {
+ CI.getNumberedAdvancedCircuit(5),
+ FLUORIDES.FLUORITE.getDust(37),
+ },
+ FluidUtils.getFluidStack("sulfuricacid", 8000),
+ aGregtechHydro, // Fluid output (slot 2)
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDict("dustCalciumSulfate", 15),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustSilver", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustGold", 2),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustTin", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustCopper", 2)
+ },
+ new int[] { 10000, 1000, 1000, 3000, 2000 },
+ 10 * 60 * 20,
+ 240); // EU
+
+ }
+
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MaterialProcessing.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MaterialProcessing.java
index f8108852f4..92d7f73ba4 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MaterialProcessing.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MaterialProcessing.java
@@ -3,12 +3,7 @@ package gtPlusPlus.xmod.gregtech.loaders;
import java.util.HashSet;
import java.util.Set;
-import net.minecraft.item.ItemStack;
-
-import gregtech.api.GregTech_API;
import gregtech.api.enums.GT_Values;
-import gregtech.api.util.GT_Recipe;
-
import gtPlusPlus.api.interfaces.RunnableWithInfo;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
@@ -20,6 +15,7 @@ import gtPlusPlus.core.material.MaterialStack;
import gtPlusPlus.core.material.state.MaterialState;
import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
public class RecipeGen_MaterialProcessing extends RecipeGen_Base {
@@ -30,16 +26,24 @@ public class RecipeGen_MaterialProcessing extends RecipeGen_Base {
}
public RecipeGen_MaterialProcessing(final Material M){
- this.toGenerate = M;
+ this(M, false);
+ }
+
+ public RecipeGen_MaterialProcessing(final Material M, final boolean O){
+ this.toGenerate = M;
+ this.disableOptional = O;
mRecipeGenMap.add(this);
}
@Override
public void run() {
- generateRecipes(this.toGenerate);
+ generateRecipes(this.toGenerate, this.disableOptional);
}
- private void generateRecipes(final Material material){
+ private void generateRecipes(final Material material, final boolean disableOptional){
+ if (disableOptional) {
+ return;
+ }
if (material.getMaterialComposites().length > 1){
Logger.MATERIALS("[Recipe Generator Debug] ["+material.getLocalizedName()+"]");
@@ -65,7 +69,7 @@ public class RecipeGen_MaterialProcessing extends RecipeGen_Base {
/**
- * Electrolyzer
+ * Centrifuge
*/
//Process Dust
@@ -79,14 +83,14 @@ public class RecipeGen_MaterialProcessing extends RecipeGen_Base {
int mCounter = 0;
for (Pair<Integer, Material> f : componentMap){
if (f.getValue().getState() != MaterialState.SOLID){
- Logger.MATERIALS("[Electrolyzer] Found Fluid Component, adding "+f.getKey()+" cells of "+f.getValue().getLocalizedName()+".");
+ Logger.MATERIALS("[Centrifuge] Found Fluid Component, adding "+f.getKey()+" cells of "+f.getValue().getLocalizedName()+".");
mInternalOutputs[mCounter++] = f.getValue().getCell(f.getKey());
mCellCount += f.getKey();
mTotalCount += f.getKey();
- Logger.MATERIALS("[Electrolyzer] In total, adding "+mCellCount+" cells for "+material.getLocalizedName()+" processing.");
+ Logger.MATERIALS("[Centrifuge] In total, adding "+mCellCount+" cells for "+material.getLocalizedName()+" processing.");
}
else {
- Logger.MATERIALS("[Electrolyzer] Found Solid Component, adding "+f.getKey()+" dusts of "+f.getValue().getLocalizedName()+".");
+ Logger.MATERIALS("[Centrifuge] Found Solid Component, adding "+f.getKey()+" dusts of "+f.getValue().getLocalizedName()+".");
mInternalOutputs[mCounter++] = f.getValue().getDust(f.getKey());
mTotalCount += f.getKey();
}
@@ -94,38 +98,38 @@ public class RecipeGen_MaterialProcessing extends RecipeGen_Base {
//Build Output Array
for (int g=0;g<mInternalOutputs.length;g++){
- Logger.MATERIALS("[Electrolyzer] Is output["+g+"] valid with a chance? "+(mInternalOutputs[g] != null ? 10000 : 0));
+ Logger.MATERIALS("[Centrifuge] Is output["+g+"] valid with a chance? "+(mInternalOutputs[g] != null ? 10000 : 0));
mChances[g] = (mInternalOutputs[g] != null ? 10000 : 0);
}
ItemStack emptyCell = null;
if (mCellCount > 0){
emptyCell = ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", mCellCount);
- Logger.MATERIALS("[Electrolyzer] Recipe now requires "+mCellCount+" empty cells as input.");
+ Logger.MATERIALS("[Centrifuge] Recipe now requires "+mCellCount+" empty cells as input.");
}
ItemStack mainDust = material.getDust(material.smallestStackSizeWhenProcessing);
if (mainDust != null){
- Logger.MATERIALS("[Electrolyzer] Recipe now requires "+material.smallestStackSizeWhenProcessing+"x "+mainDust.getDisplayName()+" as input.");
+ Logger.MATERIALS("[Centrifuge] Recipe now requires "+material.smallestStackSizeWhenProcessing+"x "+mainDust.getDisplayName()+" as input.");
}
else {
mainDust = material.getDust(mTotalCount);
- Logger.MATERIALS("[Electrolyzer] Could not find valid input dust, trying alternative.");
+ Logger.MATERIALS("[Centrifuge] Could not find valid input dust, trying alternative.");
if (mainDust != null){
- Logger.MATERIALS("[Electrolyzer] Recipe now requires "+mTotalCount+"x "+mainDust.getDisplayName()+" as input.");
+ Logger.MATERIALS("[Centrifuge] Recipe now requires "+mTotalCount+"x "+mainDust.getDisplayName()+" as input.");
}
else {
- Logger.MATERIALS("[Electrolyzer] Could not find valid input dust, exiting.");
+ Logger.MATERIALS("[Centrifuge] Could not find valid input dust, exiting.");
}
}
for (int j=0;j<mInternalOutputs.length;j++){
if (mInternalOutputs[j] == null){
mInternalOutputs[j] = GT_Values.NI;
- Logger.MATERIALS("[Electrolyzer] Set slot "+j+" to null.");
+ Logger.MATERIALS("[Centrifuge] Set slot "+j+" to null.");
}
else {
- Logger.MATERIALS("[Electrolyzer] Set slot "+j+" to "+mInternalOutputs[j].getDisplayName()+".");
+ Logger.MATERIALS("[Centrifuge] Set slot "+j+" to "+mInternalOutputs[j].getDisplayName()+".");
}
}
@@ -144,10 +148,10 @@ public class RecipeGen_MaterialProcessing extends RecipeGen_Base {
mChances,
20*1*(tVoltageMultiplier/10),
tVoltageMultiplier)){
- Logger.MATERIALS("[Electrolyzer] Generated Electrolyzer recipe for "+material.getDust(1).getDisplayName());
+ Logger.MATERIALS("[Centrifuge] Generated Centrifuge recipe for "+material.getDust(1).getDisplayName());
}
else {
- Logger.MATERIALS("[Electrolyzer] Failed to generate Electrolyzer recipe for "+material.getDust(1).getDisplayName());
+ Logger.MATERIALS("[Centrifuge] Failed to generate Centrifuge recipe for "+material.getDust(1).getDisplayName());
}
}
catch(Throwable t){
@@ -252,23 +256,5 @@ public class RecipeGen_MaterialProcessing extends RecipeGen_Base {
public static boolean addCentrifgeRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int[] aChances, int aDuration, int aEUt) {
return GT_Values.RA.addCentrifugeRecipe(aInput1, aInput2, aFluidInput, aFluidOutput, aOutput1, aOutput2, aOutput3, aOutput4, aOutput5, aOutput6, aChances, aDuration, aEUt);
}
-
- public static boolean addElectrolyzerRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int[] aChances, int aDuration, int aEUt) {
- if (((aInput1 == null) && (aFluidInput == null)) || ((aOutput1 == null) && (aFluidOutput == null))) {
- Logger.MATERIALS("[Electrolyzer] Either both inputs or outputs are null.");
- return false;
- }
- if ((aInput1 != null) && ((aDuration = GregTech_API.sRecipeFile.get("electrolyzer", aInput1, aDuration)) <= 0)) {
- Logger.MATERIALS("[Electrolyzer] Fail 1.");
- return false;
- }
- if ((aFluidInput != null) && ((aDuration = GregTech_API.sRecipeFile.get("electrolyzer", aFluidInput.getFluid().getName(), aDuration)) <= 0)) {
- Logger.MATERIALS("[Electrolyzer] Fail 2.");
- return false;
- }
- GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2}, new ItemStack[]{aOutput1, aOutput2, aOutput3, aOutput4, aOutput5, aOutput6}, null, aChances, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0);
- Logger.MATERIALS("[Electrolyzer] Recipe added.");
- return true;
- }
-
+
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Ore.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Ore.java
index b7043b5983..f3ff935d6e 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Ore.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Ore.java
@@ -33,20 +33,25 @@ public class RecipeGen_Ore extends RecipeGen_Base {
static {
MaterialGenerator.mRecipeMapsToGenerate.put(mRecipeGenMap);
}
-
+
public RecipeGen_Ore(final Material M){
+ this(M, false);
+ }
+
+ public RecipeGen_Ore(final Material M, final boolean O){
this.toGenerate = M;
+ this.disableOptional = O;
mRecipeGenMap.add(this);
}
@Override
public void run() {
- generateRecipes(this.toGenerate);
+ generateRecipes(this.toGenerate, this.disableOptional);
}
private static Material mStone;
- public static void generateRecipes(final Material material){
+ private void generateRecipes(final Material material, final boolean disableOptional){
if (mStone == null) {
mStone = MaterialUtils.generateMaterialFromGtENUM(Materials.Stone);
@@ -225,13 +230,13 @@ public class RecipeGen_Ore extends RecipeGen_Base {
try {
//.08 compat
- if (GT_ModHandler.addThermalCentrifugeRecipe(material.getCrushed(1), 200, material.getCrushedCentrifuged(1), tinyDustB, dustStone)){
+ if (GT_ModHandler.addThermalCentrifugeRecipe(material.getCrushed(1), (int) Math.min(5000L, Math.abs(material.getMass() * 20L)), material.getCrushedCentrifuged(1), tinyDustB, dustStone)){
Logger.MATERIALS("[ThermalCentrifuge] Added Recipe: 'Crushed ore to Centrifuged Ore' | Input: "+material.getCrushed(1).getDisplayName()+" | Outputs: "+material.getCrushedCentrifuged(1).getDisplayName()+", "+tinyDustB.getDisplayName()+", "+dustStone.getDisplayName()+".");
}
}
catch (Throwable t) {}
try {
- if (GT_ModHandler.addThermalCentrifugeRecipe(material.getCrushedPurified(1), 200, material.getCrushedCentrifuged(1), tinyDustA, dustStone)){
+ if (GT_ModHandler.addThermalCentrifugeRecipe(material.getCrushedPurified(1), (int) Math.min(5000L, Math.abs(material.getMass() * 20L)), material.getCrushedCentrifuged(1), tinyDustA, dustStone)){
Logger.MATERIALS("[ThermalCentrifuge] Added Recipe: 'Washed ore to Centrifuged Ore' | Input: "+material.getCrushedPurified(1).getDisplayName()+" | Outputs: "+material.getCrushedCentrifuged(1).getDisplayName()+", "+tinyDustA.getDisplayName()+", "+dustStone.getDisplayName()+".");
}
}
@@ -262,7 +267,7 @@ public class RecipeGen_Ore extends RecipeGen_Base {
matDust, tinyDustA,null,
null, null,null,
new int[]{10000, 10000}, //Chances
- 5*20, //Time
+ (int) Math.max(1L, material.getMass() * 8L), //Time
tVoltageMultiplier/2)){ //Eu
Logger.MATERIALS("[Centrifuge] Added Recipe: Purified Dust to Clean Dust");
}
@@ -275,7 +280,7 @@ public class RecipeGen_Ore extends RecipeGen_Base {
matDust, tinyDustB,null,
null, null,null,
new int[]{10000, 10000}, //Chances
- 5*20, //Time
+ (int) Math.max(1L, material.getMass() * 8L), //Time
tVoltageMultiplier/2)){ //Eu
Logger.MATERIALS("[Centrifuge] Added Recipe: Inpure Dust to Clean Dust");
}
@@ -285,6 +290,7 @@ public class RecipeGen_Ore extends RecipeGen_Base {
* Electrolyzer
*/
+ if (!disableOptional) {
//Process Dust
if (componentMap.size() > 0 && componentMap.size() <= 6){
@@ -434,9 +440,7 @@ public class RecipeGen_Ore extends RecipeGen_Base {
}
}
- try{
-
-
+ try{
if (CORE.RA.addDehydratorRecipe(
new ItemStack[]{mainDust, emptyCell},
null,
@@ -446,6 +450,10 @@ public class RecipeGen_Ore extends RecipeGen_Base {
(int) Math.max(material.getMass() * 4L * 1, 1),
tVoltageMultiplier)){
Logger.MATERIALS("[Dehydrator] Generated Dehydrator recipe for "+matDust.getDisplayName());
+ Logger.MATERIALS("Inputs: "+mainDust.getDisplayName()+" x"+mainDust.stackSize+", "+(emptyCell == null ? "No Cells" : ""+emptyCell.getDisplayName()+" x"+emptyCell.stackSize));
+ Logger.MATERIALS("Outputs "+ItemUtils.getArrayStackNames(mInternalOutputs));
+ Logger.MATERIALS("Time: "+((int) Math.max(material.getMass() * 4L * 1, 1)));
+ Logger.MATERIALS("EU: "+tVoltageMultiplier);
}
else {
Logger.MATERIALS("[Dehydrator] Failed to generate Dehydrator recipe for "+matDust.getDisplayName());
@@ -457,6 +465,7 @@ public class RecipeGen_Ore extends RecipeGen_Base {
}
+ }
/**
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/misc/AddCustomMachineToPA.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/misc/AddCustomMachineToPA.java
index e84ce73a47..2e6de159d0 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/misc/AddCustomMachineToPA.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/misc/AddCustomMachineToPA.java
@@ -1,51 +1,28 @@
package gtPlusPlus.xmod.gregtech.loaders.misc;
-import java.lang.reflect.Method;
-
import gregtech.api.util.GTPP_Recipe;
+import gregtech.api.util.GT_ProcessingArray_Manager;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
-import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import gtPlusPlus.api.objects.Logger;
public class AddCustomMachineToPA {
- private static final boolean sDoesPatchExist;
- private static final Class sManagerPA;
- private static final Method sRegisterRecipeMapForMeta;
-
- static {
- sDoesPatchExist = ReflectionUtils.doesClassExist("gregtech.api.util.GT_ProcessingArray_Manager");
- if (sDoesPatchExist) {
- sManagerPA = ReflectionUtils.getClass("gregtech.api.util.GT_ProcessingArray_Manager");
- sRegisterRecipeMapForMeta = ReflectionUtils.getMethod(sManagerPA, "registerRecipeMapForMeta", int.class, GT_Recipe_Map.class);
- }
- else {
- sManagerPA = null;
- sRegisterRecipeMapForMeta = null;
- }
- }
-
public static final void registerRecipeMapForID(int aID, GT_Recipe_Map aMap) {
- if (sDoesPatchExist) {
- ReflectionUtils.invokeNonBool(null, sRegisterRecipeMapForMeta, new Object[] {aID, aMap});
- }
-
+ Logger.INFO("Attempting to add map "+aMap.mNEIName+" to Processing Array for Meta Tile "+aID+". Success? "+GT_ProcessingArray_Manager.registerRecipeMapForMeta(aID, aMap));
}
public static final void registerRecipeMapBetweenRangeOfIDs(int aMin, int aMax, GT_Recipe_Map aMap) {
- if (sDoesPatchExist) {
- for (int i=aMin; i<=aMax;i++) {
- ReflectionUtils.invokeNonBool(null, sRegisterRecipeMapForMeta, new Object[] {i, aMap});
- //GT_ProcessingArray_Manager.registerRecipeMapForMeta(i, aMap);
- }
- }
+ for (int i=aMin; i<=aMax;i++) {
+ registerRecipeMapForID(i, aMap);
+ }
}
public static void register() {
-
+
// Simple Washers
registerRecipeMapForID(767, GTPP_Recipe.GTPP_Recipe_Map.sSimpleWasherRecipes);
registerRecipeMapBetweenRangeOfIDs(31017, 31020, GTPP_Recipe.GTPP_Recipe_Map.sSimpleWasherRecipes);
-
+
}
}