diff options
| author | Martin Robertz <dream-master@gmx.net> | 2021-12-12 19:09:46 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-12 19:09:46 +0100 |
| commit | 896143b96132f5ac54aa8d8f7386f27487e5e530 (patch) | |
| tree | d61c1bced93b36545873414562b1dfd80718f496 /src/Java/gtPlusPlus/australia | |
| parent | 9cbfc7a1bacdbe908632e0fff9ec5ad7f119e563 (diff) | |
| parent | 35585d4556d85a1a9cda33cdd39b5b257e3e5215 (diff) | |
| download | GT5-Unofficial-896143b96132f5ac54aa8d8f7386f27487e5e530.tar.gz GT5-Unofficial-896143b96132f5ac54aa8d8f7386f27487e5e530.tar.bz2 GT5-Unofficial-896143b96132f5ac54aa8d8f7386f27487e5e530.zip | |
Merge pull request #50 from GTNewHorizons/gtnh-milling
Milling/Nuclear Sciences revamp + Lots of minor fixes
Diffstat (limited to 'src/Java/gtPlusPlus/australia')
| -rw-r--r-- | src/Java/gtPlusPlus/australia/biome/type/Biome_AustralianDesert.java | 12 | ||||
| -rw-r--r-- | src/Java/gtPlusPlus/australia/biome/type/Biome_AustralianDesert2.java | 14 |
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; } } |
