mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-28 13:15:30 +01:00
Fix encoding for saved tile flags
This commit is contained in:
parent
e897b5dbef
commit
0d97a93100
@ -261,7 +261,7 @@ public class MapManager {
|
|||||||
czmin = n.getInteger("czmin", 0);
|
czmin = n.getInteger("czmin", 0);
|
||||||
czmax = n.getInteger("czmax", 0);
|
czmax = n.getInteger("czmax", 0);
|
||||||
rendertype = n.getString("rendertype", "");
|
rendertype = n.getString("rendertype", "");
|
||||||
mapname = n.getString("mapname", "");
|
mapname = n.getString("mapname", null);
|
||||||
sender = plug_in.getServer().getConsoleSender();
|
sender = plug_in.getServer().getConsoleSender();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -269,9 +269,9 @@ public class MapManager {
|
|||||||
HashMap<String,Object> v = new HashMap<String,Object>();
|
HashMap<String,Object> v = new HashMap<String,Object>();
|
||||||
|
|
||||||
v.put("world", world.world.getName());
|
v.put("world", world.world.getName());
|
||||||
v.put("locX", loc.getX());
|
v.put("locX", loc.getBlockX());
|
||||||
v.put("locY", loc.getY());
|
v.put("locY", loc.getBlockY());
|
||||||
v.put("locZ", loc.getZ());
|
v.put("locZ", loc.getBlockZ());
|
||||||
v.put("mapindex", map_index);
|
v.put("mapindex", map_index);
|
||||||
v.put("map", map.getName());
|
v.put("map", map.getName());
|
||||||
v.put("found", found.save());
|
v.put("found", found.save());
|
||||||
@ -297,6 +297,7 @@ public class MapManager {
|
|||||||
v.put("czmin", czmin);
|
v.put("czmin", czmin);
|
||||||
v.put("czmax", czmax);
|
v.put("czmax", czmax);
|
||||||
v.put("rendertype", rendertype);
|
v.put("rendertype", rendertype);
|
||||||
|
if(mapname != null)
|
||||||
v.put("mapname", mapname);
|
v.put("mapname", mapname);
|
||||||
|
|
||||||
return v;
|
return v;
|
||||||
|
@ -4,6 +4,8 @@ import java.util.ArrayList;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.dynmap.Log;
|
||||||
/**
|
/**
|
||||||
* scalable flags primitive - used for keeping track of potentially huge number of tiles
|
* scalable flags primitive - used for keeping track of potentially huge number of tiles
|
||||||
*
|
*
|
||||||
@ -24,10 +26,11 @@ public class TileFlags {
|
|||||||
ArrayList<String> v = new ArrayList<String>();
|
ArrayList<String> v = new ArrayList<String>();
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
for(Map.Entry<Long, long[]> ent : chunkmap.entrySet()) {
|
for(Map.Entry<Long, long[]> ent : chunkmap.entrySet()) {
|
||||||
sb.append(String.format("%x", ent.getKey().longValue()));
|
long v1 = ent.getKey().longValue();
|
||||||
|
sb.append(String.format("%x/%x", ((v1>>32)&0xFFFFFFFFL), (v1 & 0xFFFFFFFFL) ));
|
||||||
long[] val = ent.getValue();
|
long[] val = ent.getValue();
|
||||||
for(long vv : val) {
|
for(long vv : val) {
|
||||||
sb.append(String.format(":%x", vv));
|
sb.append(String.format(":%x/%x", ((vv>>32) & 0xFFFFFFFFL), (vv & 0xFFFFFFFFL)));
|
||||||
}
|
}
|
||||||
v.add(sb.toString());
|
v.add(sb.toString());
|
||||||
sb.setLength(0);
|
sb.setLength(0);
|
||||||
@ -41,12 +44,15 @@ public class TileFlags {
|
|||||||
String[] tok = v.split(":");
|
String[] tok = v.split(":");
|
||||||
long[] row = new long[64];
|
long[] row = new long[64];
|
||||||
try {
|
try {
|
||||||
long rowaddr = Long.parseLong(tok[0], 16);
|
String ss[] = tok[0].split("/");
|
||||||
|
long rowaddr = (Long.parseLong(ss[0], 16)<<32) | Long.parseLong(ss[1],16);
|
||||||
for(int i = 0; (i < 64) && (i < (tok.length-1)); i++) {
|
for(int i = 0; (i < 64) && (i < (tok.length-1)); i++) {
|
||||||
row[i] = Long.parseLong(tok[i+1], 16);
|
ss = tok[i+1].split("/");
|
||||||
|
row[i] = (Long.parseLong(ss[0], 16)<<32) | Long.parseLong(ss[1],16);
|
||||||
}
|
}
|
||||||
chunkmap.put(rowaddr, row);
|
chunkmap.put(rowaddr, row);
|
||||||
} catch (NumberFormatException nfx) {
|
} catch (NumberFormatException nfx) {
|
||||||
|
Log.info("parse error - " + nfx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user