Switch default center point for maps to spawn point

This commit is contained in:
Mike Primm 2011-09-29 10:44:20 +08:00 committed by mikeprimm
parent dd4d448fc5
commit 560fe3c539
11 changed files with 45 additions and 42 deletions

View File

@ -3,6 +3,7 @@ package org.dynmap;
import static org.dynmap.JSONUtils.a;
import static org.dynmap.JSONUtils.s;
import org.bukkit.Location;
import org.dynmap.Event.Listener;
import org.json.simple.JSONObject;
@ -31,9 +32,10 @@ public class ClientConfigurationComponent extends Component {
JSONObject wo = new JSONObject();
s(wo, "name", wn.getString("name"));
s(wo, "title", wn.getString("title"));
s(wo, "center/x", wn.getFloat("center/x", 0.0f));
s(wo, "center/y", wn.getFloat("center/y", 64.0f));
s(wo, "center/z", wn.getFloat("center/z", 0.0f));
Location spawn = world.world.getSpawnLocation();
s(wo, "center/x", wn.getDouble("center/x", spawn.getX()));
s(wo, "center/y", wn.getDouble("center/y", spawn.getY()));
s(wo, "center/z", wn.getDouble("center/z", spawn.getZ()));
s(wo, "bigworld", world.bigworld);
s(wo, "extrazoomout", world.getExtraZoomOutLevels());
a(t, "worlds", wo);

View File

@ -787,7 +787,8 @@ public class DynmapPlugin extends JavaPlugin {
}
w = mapManager.getWorld(wname);
if(w != null) {
Location loc = new Location(w.world, w.configuration.getFloat("center/x", 0.0f), w.configuration.getFloat("center/y", 64f), w.configuration.getFloat("center/z", 0.0f));
Location spawn = w.world.getSpawnLocation();
Location loc = new Location(w.world, w.configuration.getDouble("center/x", spawn.getX()), w.configuration.getDouble("center/y", spawn.getY()), w.configuration.getDouble("center/z", spawn.getZ()));
mapManager.renderFullWorld(loc,sender, map);
}
else

View File

@ -11,10 +11,10 @@ templates:
enabled: true
# Number of extra zoom-out levels for world (each level is twice as big as the previous one)
extrazoomout: 2
center:
x: 0
y: 64
z: 0
#center:
# x: 0
# y: 64
# z: 0
maps:
- class: org.dynmap.hdmap.HDMap
name: flat

View File

@ -9,12 +9,12 @@ templates:
# Nether world template (HDMap lowres)
nether-lowres:
enabled: true
# # Number of extra zoom-out levels for world (each level is twice as big as the previous one)
# extrazoomout: 3
center:
x: 0
y: 64
z: 0
# Number of extra zoom-out levels for world (each level is twice as big as the previous one)
extrazoomout: 2
#center:
# x: 0
# y: 64
# z: 0
maps:
- class: org.dynmap.hdmap.HDMap
name: flat

View File

@ -12,10 +12,10 @@ templates:
# bigworld: true
# # Number of extra zoom-out levels for world (each level is twice as big as the previous one)
# extrazoomout: 3
center:
x: 0
y: 64
z: 0
#center:
# x: 0
# y: 64
# z: 0
maps:
- class: org.dynmap.flat.FlatMap
name: flat

View File

@ -11,10 +11,10 @@ templates:
enabled: true
# Number of extra zoom-out levels for world (each level is twice as big as the previous one)
extrazoomout: 2
center:
x: 0
y: 64
z: 0
#center:
# x: 0
# y: 64
# z: 0
maps:
- class: org.dynmap.hdmap.HDMap
name: flat

View File

@ -11,10 +11,10 @@ templates:
enabled: true
# Number of extra zoom-out levels for world (each level is twice as big as the previous one)
extrazoomout: 2
center:
x: 0
y: 64
z: 0
#center:
# x: 0
# y: 64
# z: 0
maps:
- class: org.dynmap.hdmap.HDMap
name: flat

View File

@ -12,10 +12,10 @@ templates:
# bigworld: true
# # Number of extra zoom-out levels for world (each level is twice as big as the previous one)
# extrazoomout: 3
center:
x: 0
y: 64
z: 0
#center:
# x: 0
# y: 64
# z: 0
maps:
- class: org.dynmap.flat.FlatMap
name: flat

View File

@ -11,10 +11,10 @@ templates:
enabled: true
# Number of extra zoom-out levels for world (each level is twice as big as the previous one)
extrazoomout: 2
center:
x: 0
y: 64
z: 0
#center:
# x: 0
# y: 64
# z: 0
maps:
- class: org.dynmap.hdmap.HDMap
name: flat

View File

@ -11,10 +11,10 @@ templates:
enabled: true
# Number of extra zoom-out levels for world (each level is twice as big as the previous one)
extrazoomout: 2
center:
x: 0
y: 64
z: 0
#center:
# x: 0
# y: 64
# z: 0
maps:
- class: org.dynmap.hdmap.HDMap
name: flat

View File

@ -12,10 +12,10 @@ templates:
# bigworld: true
# # Number of extra zoom-out levels for world (each level is twice as big as the previous one)
# extrazoomout: 3
center:
x: 0
y: 64
z: 0
#center:
# x: 0
# y: 64
# z: 0
maps:
- class: org.dynmap.flat.FlatMap
name: flat