aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/australia/biome
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/Java/gtPlusPlus/australia/biome
parenta4779df4755d9312936529aca3de1297fed7a904 (diff)
downloadGT5-Unofficial-680fef1a0f49d8706fd58093da63a2d9438d0641.tar.gz
GT5-Unofficial-680fef1a0f49d8706fd58093da63a2d9438d0641.tar.bz2
GT5-Unofficial-680fef1a0f49d8706fd58093da63a2d9438d0641.zip
More minor fixes.
Diffstat (limited to 'src/Java/gtPlusPlus/australia/biome')
-rw-r--r--src/Java/gtPlusPlus/australia/biome/type/Biome_AustralianDesert.java12
-rw-r--r--src/Java/gtPlusPlus/australia/biome/type/Biome_AustralianDesert2.java14
2 files changed, 17 insertions, 9 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;
}
}