aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlkalus <3060479+draknyte1@users.noreply.github.com>2021-12-07 17:54:21 +0000
committerAlkalus <3060479+draknyte1@users.noreply.github.com>2021-12-07 17:54:21 +0000
commit680fef1a0f49d8706fd58093da63a2d9438d0641 (patch)
tree22f1da8e3cb9177e399ef68842c1e6ca7f1298e9 /src
parenta4779df4755d9312936529aca3de1297fed7a904 (diff)
downloadGT5-Unofficial-680fef1a0f49d8706fd58093da63a2d9438d0641.tar.gz
GT5-Unofficial-680fef1a0f49d8706fd58093da63a2d9438d0641.tar.bz2
GT5-Unofficial-680fef1a0f49d8706fd58093da63a2d9438d0641.zip
More minor fixes.
Diffstat (limited to 'src')
-rw-r--r--src/Java/gtPlusPlus/australia/biome/type/Biome_AustralianDesert.java12
-rw-r--r--src/Java/gtPlusPlus/australia/biome/type/Biome_AustralianDesert2.java14
-rw-r--r--src/Java/gtPlusPlus/core/material/MaterialGenerator.java19
-rw-r--r--src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java12
-rw-r--r--src/Java/gtPlusPlus/everglades/biome/Biome_Everglades.java18
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_Nuclear.java88
6 files changed, 119 insertions, 44 deletions
diff --git a/src/Java/gtPlusPlus/australia/biome/type/Biome_AustralianDesert.java b/src/Java/gtPlusPlus/australia/biome/type/Biome_AustralianDesert.java
index 6986c9931d..666360f058 100644
--- a/src/Java/gtPlusPlus/australia/biome/type/Biome_AustralianDesert.java
+++ b/src/Java/gtPlusPlus/australia/biome/type/Biome_AustralianDesert.java
@@ -80,7 +80,7 @@ public class Biome_AustralianDesert {
public BiomeGenAustralianDesert() {
super(CORE.AUSTRALIA_BIOME_DESERT_1_ID);
this.setBiomeName("Australian Desert");
- this.setBiomeID();
+ //this.setBiomeID();
this.enableRain = true;
this.enableSnow = false;
this.topBlock = blockTopLayer;
@@ -123,16 +123,19 @@ public class Biome_AustralianDesert {
}
private synchronized boolean setBiomeID() {
- BiomeGenBase[] mTempList;
try {
Field mInternalBiomeList = ReflectionUtils.getField(BiomeGenBase.class, "biomeList");
Field mClone = mInternalBiomeList;
- mTempList = (BiomeGenBase[]) mInternalBiomeList.get(null);
+ BiomeGenBase[] mOriginalList = (BiomeGenBase[]) mInternalBiomeList.get(null);
+ BiomeGenBase[] mTempList = new BiomeGenBase[mOriginalList.length];
+ for (int index=0;index<mTempList.length;index++) {
+ mTempList[index] = mOriginalList[index];
+ }
if (mTempList != null){
mTempList[CORE.AUSTRALIA_BIOME_DESERT_1_ID] = this;
mInternalBiomeList.set(null, mTempList);
if (mTempList != mInternalBiomeList.get(null)){
- ReflectionUtils.setFinalStatic(mInternalBiomeList, mTempList);
+ ReflectionUtils.setFinalFieldValue(BiomeGenBase.class, mInternalBiomeList, mTempList);
Logger.REFLECTION("Set Biome ID for "+this.biomeName+" Biome internally in 'biomeList' field from "+BiomeGenBase.class.getCanonicalName()+".");
return true;
}
@@ -144,6 +147,7 @@ public class Biome_AustralianDesert {
}
catch (Exception e) {
Logger.REFLECTION("Could not access 'biomeList' field in "+BiomeGenBase.class.getCanonicalName()+".");
+ e.printStackTrace();
return false;
}
}
diff --git a/src/Java/gtPlusPlus/australia/biome/type/Biome_AustralianDesert2.java b/src/Java/gtPlusPlus/australia/biome/type/Biome_AustralianDesert2.java
index 003c6cbd93..2ac11bb412 100644
--- a/src/Java/gtPlusPlus/australia/biome/type/Biome_AustralianDesert2.java
+++ b/src/Java/gtPlusPlus/australia/biome/type/Biome_AustralianDesert2.java
@@ -80,7 +80,7 @@ public class Biome_AustralianDesert2 {
public BiomeGenAustralianDesert2() {
super(CORE.AUSTRALIA_BIOME_DESERT_2_ID);
this.setBiomeName("Australian Desert II");
- this.setBiomeID();
+ //this.setBiomeID();
this.enableRain = true;
this.enableSnow = false;
this.topBlock = blockTopLayer;
@@ -123,16 +123,19 @@ public class Biome_AustralianDesert2 {
}
private synchronized boolean setBiomeID() {
- BiomeGenBase[] mTempList;
try {
Field mInternalBiomeList = ReflectionUtils.getField(BiomeGenBase.class, "biomeList");
Field mClone = mInternalBiomeList;
- mTempList = (BiomeGenBase[]) mInternalBiomeList.get(null);
+ BiomeGenBase[] mOriginalList = (BiomeGenBase[]) mInternalBiomeList.get(null);
+ BiomeGenBase[] mTempList = new BiomeGenBase[mOriginalList.length];
+ for (int index=0;index<mTempList.length;index++) {
+ mTempList[index] = mOriginalList[index];
+ }
if (mTempList != null){
- mTempList[CORE.AUSTRALIA_BIOME_DESERT_2_ID] = this;
+ mTempList[CORE.AUSTRALIA_BIOME_DESERT_1_ID] = this;
mInternalBiomeList.set(null, mTempList);
if (mTempList != mInternalBiomeList.get(null)){
- ReflectionUtils.setFinalStatic(mInternalBiomeList, mTempList);
+ ReflectionUtils.setFinalFieldValue(BiomeGenBase.class, mInternalBiomeList, mTempList);
Logger.REFLECTION("Set Biome ID for "+this.biomeName+" Biome internally in 'biomeList' field from "+BiomeGenBase.class.getCanonicalName()+".");
return true;
}
@@ -144,6 +147,7 @@ public class Biome_AustralianDesert2 {
}
catch (Exception e) {
Logger.REFLECTION("Could not access 'biomeList' field in "+BiomeGenBase.class.getCanonicalName()+".");
+ e.printStackTrace();
return false;
}
}
diff --git a/src/Java/gtPlusPlus/core/material/MaterialGenerator.java b/src/Java/gtPlusPlus/core/material/MaterialGenerator.java
index 85562c78b1..a8dcb37f02 100644
--- a/src/Java/gtPlusPlus/core/material/MaterialGenerator.java
+++ b/src/Java/gtPlusPlus/core/material/MaterialGenerator.java
@@ -277,7 +277,7 @@ public class MaterialGenerator {
}
public static void generateNuclearDusts(final Material matInfo, boolean generateDehydratorRecipe){
- generateNuclearMaterial(matInfo, false, true, false, false);
+ generateNuclearMaterial(matInfo, false, true, false, false, false);
if (generateDehydratorRecipe && matInfo.getFluid() != null && matInfo.getDust(0) != null) {
CORE.RA.addDehydratorRecipe(
new ItemStack[] {
@@ -298,11 +298,11 @@ public class MaterialGenerator {
}
public static void generateNuclearMaterial(final Material matInfo, final boolean generatePlates){
- generateNuclearMaterial(matInfo, true, true, true, generatePlates);
+ generateNuclearMaterial(matInfo, true, true, true, generatePlates, true);
}
public static void generateNuclearMaterial(final Material matInfo, final boolean generateBlock,
- final boolean generateDusts, final boolean generateIngot, final boolean generatePlates){
+ final boolean generateDusts, final boolean generateIngot, final boolean generatePlates, final boolean generateMiscRecipes){
try {
if (generateBlock) {
@@ -324,11 +324,14 @@ public class MaterialGenerator {
new RecipeGen_Assembler(matInfo);
}
- new RecipeGen_ShapedCrafting(matInfo);
- new RecipeGen_Fluids(matInfo);
- new RecipeGen_MaterialProcessing(matInfo);
- new RecipeGen_DustGeneration(matInfo, true);
- new RecipeGen_Recycling(matInfo);
+ if (generateMiscRecipes) {
+ new RecipeGen_ShapedCrafting(matInfo);
+ new RecipeGen_Fluids(matInfo);
+ new RecipeGen_MaterialProcessing(matInfo);
+ new RecipeGen_Recycling(matInfo);
+ }
+
+ new RecipeGen_DustGeneration(matInfo, generateMiscRecipes);
new RecipeGen_Plasma(matInfo);
} catch (final Throwable t){
diff --git a/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java b/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java
index e0634dfb14..1ef925f793 100644
--- a/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java
+++ b/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java
@@ -432,6 +432,18 @@ public class ReflectionUtils {
t.printStackTrace();
}
}
+
+ /**
+ * Allows to change the state of an immutable instance. Huh?!?
+ */
+ public static void setFinalFieldValue(Class<?> clazz, Field field, Object newValue) {
+ try {
+ setFieldValue_Internal(clazz, field, newValue);
+ }
+ catch (Throwable t) {
+ t.printStackTrace();
+ }
+ }
@Deprecated
public static void setFinalStatic(Field field, Object newValue) throws Exception {
diff --git a/src/Java/gtPlusPlus/everglades/biome/Biome_Everglades.java b/src/Java/gtPlusPlus/everglades/biome/Biome_Everglades.java
index aadbfeb495..b31f6d034e 100644
--- a/src/Java/gtPlusPlus/everglades/biome/Biome_Everglades.java
+++ b/src/Java/gtPlusPlus/everglades/biome/Biome_Everglades.java
@@ -61,7 +61,7 @@ public class Biome_Everglades {
@SuppressWarnings("unchecked")
public BiomeGenEverglades() {
super(CORE.EVERGLADESBIOME_ID);
- this.setBiomeID();
+ //this.setBiomeID();
this.theBiomeDecorator = new BiomeGenerator_Custom();
this.theBiomeDecorator.treesPerChunk = 10;
//Logger.INFO("Dark World Temperature Category: "+getTempCategory());
@@ -93,27 +93,31 @@ public class Biome_Everglades {
}
private synchronized boolean setBiomeID() {
- BiomeGenBase[] mTempList;
try {
Field mInternalBiomeList = ReflectionUtils.getField(BiomeGenBase.class, "biomeList");
Field mClone = mInternalBiomeList;
- mTempList = (BiomeGenBase[]) mInternalBiomeList.get(null);
+ BiomeGenBase[] mOriginalList = (BiomeGenBase[]) mInternalBiomeList.get(null);
+ BiomeGenBase[] mTempList = new BiomeGenBase[mOriginalList.length];
+ for (int index=0;index<mTempList.length;index++) {
+ mTempList[index] = mOriginalList[index];
+ }
if (mTempList != null){
- mTempList[CORE.EVERGLADESBIOME_ID] = this;
+ mTempList[CORE.AUSTRALIA_BIOME_DESERT_1_ID] = this;
mInternalBiomeList.set(null, mTempList);
if (mTempList != mInternalBiomeList.get(null)){
- ReflectionUtils.setFinalStatic(mInternalBiomeList, mTempList);
- Logger.REFLECTION("Set Biome ID for Dark World Biome internally in 'biomeList' field from "+BiomeGenBase.class.getCanonicalName()+".");
+ ReflectionUtils.setFinalFieldValue(BiomeGenBase.class, mInternalBiomeList, mTempList);
+ Logger.REFLECTION("Set Biome ID for "+this.biomeName+" Biome internally in 'biomeList' field from "+BiomeGenBase.class.getCanonicalName()+".");
return true;
}
else {
- Logger.REFLECTION("Failed to set Biome ID for Dark World Biome internally in 'biomeList' field from "+BiomeGenBase.class.getCanonicalName()+".");
+ Logger.REFLECTION("Failed to set Biome ID for "+this.biomeName+" Biome internally in 'biomeList' field from "+BiomeGenBase.class.getCanonicalName()+".");
}
}
return false;
}
catch (Exception e) {
Logger.REFLECTION("Could not access 'biomeList' field in "+BiomeGenBase.class.getCanonicalName()+".");
+ e.printStackTrace();
return false;
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_Nuclear.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_Nuclear.java
index ba8241d804..4611382977 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_Nuclear.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_Nuclear.java
@@ -168,6 +168,8 @@ public class RecipeLoader_Nuclear {
private static void chemicalReactorRecipes() {
+ ItemStack aGtHydrofluoricAcid = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cellHydrofluoricAcid_GT5U", 2);
+
GT_Values.RA.addChemicalRecipe(
ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumCarbonate", 5), // Input
ItemUtils.getItemStackOfAmountFromOreDict("dustCalciumHydroxide", 5), // Input
@@ -229,6 +231,17 @@ public class RecipeLoader_Nuclear {
CI.emptyCells(1),
20 * 20,
30);
+ if (aGtHydrofluoricAcid != null) {
+ // Ammonium Bifluoride
+ GT_Values.RA.addChemicalRecipe(
+ ItemUtils.getGregtechCircuit(3),
+ aGtHydrofluoricAcid,
+ MISC_MATERIALS.AMMONIUM.getFluidStack(1000),
+ FLUORIDES.AMMONIUM_BIFLUORIDE.getFluidStack(2000),
+ CI.emptyCells(2),
+ 40 * 20,
+ 30);
+ }
// Ammonium
GT_Values.RA.addChemicalRecipe(
ItemUtils.getGregtechCircuit(3),
@@ -243,29 +256,64 @@ public class RecipeLoader_Nuclear {
if (!GTNH) {
// Hydroxide
- GT_Values.RA.addChemicalRecipe(ItemUtils.getItemStackOfAmountFromOreDict("cellOxygen", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogen", 1), GT_Values.NF,
- FluidUtils.getFluidStack("hydroxide", 2000),
- CI.emptyCells(2), 8 * 20);
- // Ammonia (moved to GTNH core mod)
- GT_Values.RA.addChemicalRecipe(ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogen", 3),
- ItemUtils.getItemStackOfAmountFromOreDict("dustMagnetite", 0),
- FluidUtils.getFluidStack("nitrogen", 1000), FluidUtils.getFluidStack("ammonia", 1000),
- CI.emptyCells(3), 14 * 20);
+ GT_Values.RA.addChemicalRecipe(
+ ItemUtils.getGregtechCircuit(3),
+ ELEMENT.getInstance().OXYGEN.getCell(1),
+ ELEMENT.getInstance().HYDROGEN.getFluidStack(1000),
+ MISC_MATERIALS.HYDROXIDE.getFluidStack(2000),
+ CI.emptyCells(2),
+ GT_Values.NI,
+ 8 * 20,
+ 30);
// Beryllium Hydroxide
- GT_Values.RA.addChemicalRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustBeryllium", 7), GT_Values.NI,
- FluidUtils.getFluidStack("hydroxide", 1000), FluidUtils.getFluidStack("berylliumhydroxide", 2000),
- GT_Values.NI, 8 * 20);
+ GT_Values.RA.addChemicalRecipe(
+ ItemUtils.getGregtechCircuit(3),
+ ELEMENT.getInstance().BERYLLIUM.getDust(7),
+ MISC_MATERIALS.HYDROXIDE.getFluidStack(1000),
+ FLUORIDES.BERYLLIUM_HYDROXIDE.getFluidStack(2000),
+ GT_Values.NI,
+ 8 * 20,
+ 30);
// Ammonium Bifluoride
- GT_Values.RA.addChemicalRecipe(ItemUtils.getItemStackOfAmountFromOreDict("cellHydrofluoricAcid", 1),
- GT_Values.NI, FluidUtils.getFluidStack("ammonium", 1000),
- FluidUtils.getFluidStack("ammoniumbifluoride", 2000),
- CI.emptyCells(1), 26 * 20);
+ GT_Values.RA.addChemicalRecipe(
+ ItemUtils.getGregtechCircuit(3),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellHydrofluoricAcid", 1),
+ MISC_MATERIALS.AMMONIUM.getFluidStack(1000),
+ FLUORIDES.AMMONIUM_BIFLUORIDE.getFluidStack(3000),
+ CI.emptyCells(1),
+ 20 * 20,
+ 30);
+
+ if (aGtHydrofluoricAcid != null) {
+ // Ammonium Bifluoride
+ GT_Values.RA.addChemicalRecipe(
+ ItemUtils.getGregtechCircuit(3),
+ aGtHydrofluoricAcid,
+ MISC_MATERIALS.AMMONIUM.getFluidStack(1000),
+ FLUORIDES.AMMONIUM_BIFLUORIDE.getFluidStack(2000),
+ CI.emptyCells(2),
+ 40 * 20,
+ 30);
+ }
+
// Ammonium
- GT_Values.RA.addChemicalRecipe(ItemUtils.getItemStackOfAmountFromOreDict("cellAmmonia", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogen", 1), GT_Values.NF,
- FluidUtils.getFluidStack("ammonium", 2000),
- CI.emptyCells(2), 20 * 20);
+ GT_Values.RA.addChemicalRecipe(
+ ItemUtils.getGregtechCircuit(3),
+ ELEMENT.getInstance().HYDROGEN.getCell(1),
+ MISC_MATERIALS.AMMONIA.getFluidStack(1000),
+ MISC_MATERIALS.AMMONIUM.getFluidStack(2000),
+ CI.emptyCells(1),
+ GT_Values.NI,
+ 20 * 20,
+ 30);
+ // Ammonia
+ GT_Values.RA.addChemicalRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogen", 3),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustMagnetite", 0),
+ FluidUtils.getFluidStack("nitrogen", 1000),
+ FluidUtils.getFluidStack("ammonia", 1000),
+ CI.emptyCells(3),
+ 14 * 20);
}