aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/everglades/world/WorldChunkManagerCustom.java
diff options
context:
space:
mode:
authorAlexdoru <57050655+Alexdoru@users.noreply.github.com>2024-10-02 07:31:08 +0200
committerGitHub <noreply@github.com>2024-10-02 05:31:08 +0000
commit3b9bd1188e932e6bb8041f7bb9afbf3ce75e26d3 (patch)
tree107d9d2442891990ef1cdef1d8bb2df6bb96952a /src/main/java/gtPlusPlus/everglades/world/WorldChunkManagerCustom.java
parentbfc7b2b07f72d0903a70791ff96f9c837ddd5ff0 (diff)
downloadGT5-Unofficial-3b9bd1188e932e6bb8041f7bb9afbf3ce75e26d3.tar.gz
GT5-Unofficial-3b9bd1188e932e6bb8041f7bb9afbf3ce75e26d3.tar.bz2
GT5-Unofficial-3b9bd1188e932e6bb8041f7bb9afbf3ce75e26d3.zip
Cleanup the codebase (#3311)
Co-authored-by: boubou19 <miisterunknown@gmail.com>
Diffstat (limited to 'src/main/java/gtPlusPlus/everglades/world/WorldChunkManagerCustom.java')
-rw-r--r--src/main/java/gtPlusPlus/everglades/world/WorldChunkManagerCustom.java35
1 files changed, 17 insertions, 18 deletions
diff --git a/src/main/java/gtPlusPlus/everglades/world/WorldChunkManagerCustom.java b/src/main/java/gtPlusPlus/everglades/world/WorldChunkManagerCustom.java
index d1a621addf..4e1db08533 100644
--- a/src/main/java/gtPlusPlus/everglades/world/WorldChunkManagerCustom.java
+++ b/src/main/java/gtPlusPlus/everglades/world/WorldChunkManagerCustom.java
@@ -25,9 +25,9 @@ public class WorldChunkManagerCustom extends WorldChunkManager {
/** A GenLayer containing the indices into BiomeGenBase.biomeList[] */
private GenLayer biomeIndexLayer;
/** The BiomeCache object for this world. */
- private BiomeCache biomeCache;
+ private final BiomeCache biomeCache;
/** A list of biomes that the player can spawn in. */
- private List<BiomeGenBase> biomesToSpawnIn;
+ private final List<BiomeGenBase> biomesToSpawnIn;
@SuppressWarnings({ "rawtypes" })
public WorldChunkManagerCustom() {
@@ -80,12 +80,12 @@ public class WorldChunkManagerCustom extends WorldChunkManager {
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Invalid Biome id");
CrashReportCategory crashreportcategory = crashreport.makeCategory("DownfallBlock");
- crashreportcategory.addCrashSection("biome id", Integer.valueOf(i1));
- crashreportcategory.addCrashSection("downfalls[] size", Integer.valueOf(listToReuse.length));
- crashreportcategory.addCrashSection("x", Integer.valueOf(x));
- crashreportcategory.addCrashSection("z", Integer.valueOf(z));
- crashreportcategory.addCrashSection("w", Integer.valueOf(width));
- crashreportcategory.addCrashSection("h", Integer.valueOf(length));
+ crashreportcategory.addCrashSection("biome id", i1);
+ crashreportcategory.addCrashSection("downfalls[] size", listToReuse.length);
+ crashreportcategory.addCrashSection("x", x);
+ crashreportcategory.addCrashSection("z", z);
+ crashreportcategory.addCrashSection("w", width);
+ crashreportcategory.addCrashSection("h", length);
throw new ReportedException(crashreport);
}
}
@@ -125,11 +125,11 @@ public class WorldChunkManagerCustom extends WorldChunkManager {
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Invalid Biome id");
CrashReportCategory crashreportcategory = crashreport.makeCategory("RawBiomeBlock");
- crashreportcategory.addCrashSection("biomes[] size", Integer.valueOf(par1ArrayOfBiomeGenBase.length));
- crashreportcategory.addCrashSection("x", Integer.valueOf(par2));
- crashreportcategory.addCrashSection("z", Integer.valueOf(par3));
- crashreportcategory.addCrashSection("w", Integer.valueOf(par4));
- crashreportcategory.addCrashSection("h", Integer.valueOf(par5));
+ crashreportcategory.addCrashSection("biomes[] size", par1ArrayOfBiomeGenBase.length);
+ crashreportcategory.addCrashSection("x", par2);
+ crashreportcategory.addCrashSection("z", par3);
+ crashreportcategory.addCrashSection("w", par4);
+ crashreportcategory.addCrashSection("h", par5);
throw new ReportedException(crashreport);
}
}
@@ -159,15 +159,14 @@ public class WorldChunkManagerCustom extends WorldChunkManager {
if (cacheFlag && width == 16 && length == 16 && (x & 15) == 0 && (y & 15) == 0) {
BiomeGenBase[] abiomegenbase1 = this.biomeCache.getCachedBiomes(x, y);
System.arraycopy(abiomegenbase1, 0, listToReuse, 0, width * length);
- return listToReuse;
} else {
int[] aint = this.biomeIndexLayer.getInts(x, y, width, length);
for (int i = 0; i < width * length; ++i) {
listToReuse[i] = BiomeGenBase.getBiome(aint[i]);
}
- return listToReuse;
}
+ return listToReuse;
}
/**
@@ -199,9 +198,9 @@ public class WorldChunkManagerCustom extends WorldChunkManager {
CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Invalid Biome id");
CrashReportCategory crashreportcategory = crashreport.makeCategory("Layer");
crashreportcategory.addCrashSection("Layer", this.genBiomes.toString());
- crashreportcategory.addCrashSection("x", Integer.valueOf(x));
- crashreportcategory.addCrashSection("z", Integer.valueOf(y));
- crashreportcategory.addCrashSection("radius", Integer.valueOf(z));
+ crashreportcategory.addCrashSection("x", x);
+ crashreportcategory.addCrashSection("z", y);
+ crashreportcategory.addCrashSection("radius", z);
crashreportcategory.addCrashSection("allowed", par4List);
throw new ReportedException(crashreport);
}