Add support for saving/restoring of pending tile updates on server stops/start

This commit is contained in:
Mike Primm 2011-09-21 23:18:23 -05:00
parent 0627e2675f
commit 1548ae72d6
9 changed files with 173 additions and 0 deletions

View file

@ -7,6 +7,8 @@ import org.dynmap.MapType;
import java.util.List;
import org.dynmap.MapTile;
import org.dynmap.kzedmap.KzedMap;
import org.dynmap.kzedmap.MapTileRenderer;
import org.dynmap.utils.MapChunkCache;
public class HDMapTile extends MapTile {
@ -20,6 +22,22 @@ public class HDMapTile extends MapTile {
this.ty = ty;
}
public HDMapTile(DynmapWorld world, String parm) throws Exception {
super(world);
String[] parms = parm.split(",");
if(parms.length < 3) throw new Exception("wrong parameter count");
this.tx = Integer.parseInt(parms[0]);
this.ty = Integer.parseInt(parms[1]);
this.perspective = MapManager.mapman.hdmapman.perspectives.get(parms[2]);
if(this.perspective == null) throw new Exception("invalid perspective");
}
@Override
protected String saveTileData() {
return String.format("%d,%d,%s", tx, ty, perspective.getName());
}
@Override
public String getFilename() {
return getFilename("hdmap", MapType.ImageFormat.FORMAT_PNG);