mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-24 19:25:15 +01:00
Add some extra array bounds protection
This commit is contained in:
parent
1ef9bdd861
commit
0053d89d2b
@ -160,14 +160,23 @@ public class NewMapChunkCache implements MapChunkCache {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public final BiomeMap getBiome() {
|
public final BiomeMap getBiome() {
|
||||||
|
try {
|
||||||
return biomemap[x - x_base][z - z_base];
|
return biomemap[x - x_base][z - z_base];
|
||||||
|
} catch (Exception ex) {
|
||||||
|
return BiomeMap.NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public final int countSmoothedSwampBiomes() {
|
public final int countSmoothedSwampBiomes() {
|
||||||
|
try {
|
||||||
return swampcnt[x - x_base][z - z_base];
|
return swampcnt[x - x_base][z - z_base];
|
||||||
|
} catch (Exception ex) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public final int countSmoothedSwampBiomes(int sx, int sz, int scale) {
|
public final int countSmoothedSwampBiomes(int sx, int sz, int scale) {
|
||||||
|
try {
|
||||||
int xx = x - x_base;
|
int xx = x - x_base;
|
||||||
int zz = z - z_base;
|
int zz = z - z_base;
|
||||||
sx <<= 1;
|
sx <<= 1;
|
||||||
@ -198,6 +207,9 @@ public class NewMapChunkCache implements MapChunkCache {
|
|||||||
tot += scale * s0;
|
tot += scale * s0;
|
||||||
}
|
}
|
||||||
return tot;
|
return tot;
|
||||||
|
} catch (Exception ex) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public final double getRawBiomeTemperature() {
|
public final double getRawBiomeTemperature() {
|
||||||
|
Loading…
Reference in New Issue
Block a user