mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-12-26 10:37:44 +01:00
Add well known 1.7.x biomes only when version is appropriate
This commit is contained in:
parent
8085221087
commit
3702918a6f
@ -730,13 +730,15 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void loadExtraBiomes() {
|
public void loadExtraBiomes(String mcver) {
|
||||||
int cnt = 0;
|
int cnt = 0;
|
||||||
|
|
||||||
|
BiomeMap.loadWellKnownByVersion(mcver);
|
||||||
/* Find array of biomes in biomebase */
|
/* Find array of biomes in biomebase */
|
||||||
Object[] biomelist = helper.getBiomeBaseList();
|
Object[] biomelist = helper.getBiomeBaseList();
|
||||||
/* Loop through list, starting afer well known biomes */
|
/* Loop through list, skipping well known biomes */
|
||||||
for(int i = BiomeMap.LAST_WELL_KNOWN+1; i < biomelist.length; i++) {
|
for(int i = 0; i < biomelist.length; i++) {
|
||||||
|
if (BiomeMap.byBiomeID(i) != null) continue;
|
||||||
Object bb = biomelist[i];
|
Object bb = biomelist[i];
|
||||||
if(bb != null) {
|
if(bb != null) {
|
||||||
String id = helper.getBiomeBaseIDString(bb);
|
String id = helper.getBiomeBaseIDString(bb);
|
||||||
@ -775,8 +777,18 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI {
|
|||||||
PluginDescriptionFile pdfFile = this.getDescription();
|
PluginDescriptionFile pdfFile = this.getDescription();
|
||||||
version = pdfFile.getVersion();
|
version = pdfFile.getVersion();
|
||||||
|
|
||||||
|
/* Get MC version */
|
||||||
|
String bukkitver = getServer().getVersion();
|
||||||
|
String mcver = "1.0.0";
|
||||||
|
int idx = bukkitver.indexOf("(MC: ");
|
||||||
|
if(idx > 0) {
|
||||||
|
mcver = bukkitver.substring(idx+5);
|
||||||
|
idx = mcver.indexOf(")");
|
||||||
|
if(idx > 0) mcver = mcver.substring(0, idx);
|
||||||
|
}
|
||||||
|
|
||||||
/* Load extra biomes, if any */
|
/* Load extra biomes, if any */
|
||||||
loadExtraBiomes();
|
loadExtraBiomes(mcver);
|
||||||
|
|
||||||
/* Set up player login/quit event handler */
|
/* Set up player login/quit event handler */
|
||||||
registerPlayerLoginListener();
|
registerPlayerLoginListener();
|
||||||
@ -806,16 +818,6 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI {
|
|||||||
if(dataDirectory.exists() == false)
|
if(dataDirectory.exists() == false)
|
||||||
dataDirectory.mkdirs();
|
dataDirectory.mkdirs();
|
||||||
|
|
||||||
/* Get MC version */
|
|
||||||
String bukkitver = getServer().getVersion();
|
|
||||||
String mcver = "1.0.0";
|
|
||||||
int idx = bukkitver.indexOf("(MC: ");
|
|
||||||
if(idx > 0) {
|
|
||||||
mcver = bukkitver.substring(idx+5);
|
|
||||||
idx = mcver.indexOf(")");
|
|
||||||
if(idx > 0) mcver = mcver.substring(0, idx);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Instantiate core */
|
/* Instantiate core */
|
||||||
if(core == null)
|
if(core == null)
|
||||||
core = new DynmapCore();
|
core = new DynmapCore();
|
||||||
|
Loading…
Reference in New Issue
Block a user