|
31 | 31 |
|
32 | 32 | import com.flowpowered.math.vector.Vector2i; |
33 | 33 |
|
| 34 | +import de.bluecolored.bluemap.core.config.MainConfig.MapConfig; |
34 | 35 | import de.bluecolored.bluemap.core.render.TileRenderer; |
| 36 | +import de.bluecolored.bluemap.core.world.World; |
35 | 37 | import ninja.leaping.configurate.ConfigurationNode; |
36 | 38 | import ninja.leaping.configurate.gson.GsonConfigurationLoader; |
37 | 39 | import ninja.leaping.configurate.loader.ConfigurationLoader; |
@@ -128,13 +130,23 @@ public void setFrom(TileRenderer tileRenderer, String mapId) { |
128 | 130 | set(pointSize.getX() / 2, mapId, "lowres", "translate", "x"); |
129 | 131 | set(pointSize.getY() / 2, mapId, "lowres", "translate", "z"); |
130 | 132 | } |
131 | | - |
132 | | - public void setHiresViewDistance(float hiresViewDistance, String mapId) { |
133 | | - set(hiresViewDistance, mapId, "hires", "viewDistance"); |
| 133 | + |
| 134 | + public void setFrom(World world, String mapId) { |
| 135 | + set(world.getSpawnPoint().getX(), mapId, "startPos", "x"); |
| 136 | + set(world.getSpawnPoint().getZ(), mapId, "startPos", "z"); |
134 | 137 | } |
135 | 138 |
|
136 | | - public void setLowresViewDistance(float lowresViewDistance, String mapId) { |
137 | | - set(lowresViewDistance, mapId, "lowres", "viewDistance"); |
| 139 | + public void setFrom(MapConfig mapConfig, String mapId) { |
| 140 | + Vector2i startPos = mapConfig.getStartPos(); |
| 141 | + if (startPos != null) { |
| 142 | + set(startPos.getX(), mapId, "startPos", "x"); |
| 143 | + set(startPos.getY(), mapId, "startPos", "z"); |
| 144 | + } |
| 145 | + |
| 146 | + set(mapConfig.getLowresViewDistance(), mapId, "lowres", "viewDistance"); |
| 147 | + set(mapConfig.getHiresViewDistance(), mapId, "hires", "viewDistance"); |
| 148 | + |
| 149 | + setName(mapConfig.getName(), mapId); |
138 | 150 | } |
139 | 151 |
|
140 | 152 | public void setOrdinal(int ordinal, String mapId) { |
|
0 commit comments