Add some extra array bounds protection
This commit is contained in:
parent
ab436f9e1c
commit
e5a336bbe2
1 changed files with 43 additions and 31 deletions
|
|
@ -160,14 +160,23 @@ public class NewMapChunkCache implements MapChunkCache {
|
|||
}
|
||||
|
||||
public final BiomeMap getBiome() {
|
||||
try {
|
||||
return biomemap[x - x_base][z - z_base];
|
||||
} catch (Exception ex) {
|
||||
return BiomeMap.NULL;
|
||||
}
|
||||
}
|
||||
|
||||
public final int countSmoothedSwampBiomes() {
|
||||
try {
|
||||
return swampcnt[x - x_base][z - z_base];
|
||||
} catch (Exception ex) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public final int countSmoothedSwampBiomes(int sx, int sz, int scale) {
|
||||
try {
|
||||
int xx = x - x_base;
|
||||
int zz = z - z_base;
|
||||
sx <<= 1;
|
||||
|
|
@ -198,6 +207,9 @@ public class NewMapChunkCache implements MapChunkCache {
|
|||
tot += scale * s0;
|
||||
}
|
||||
return tot;
|
||||
} catch (Exception ex) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public final double getRawBiomeTemperature() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue