mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-13 05:54:40 +01:00
Use read API (avoid fixers running)
This commit is contained in:
parent
d1b95c9ae0
commit
4e61fa6b22
@ -67,7 +67,7 @@ public class ForgeMapChunkCache extends GenericMapChunkCache {
|
||||
|
||||
private CompoundTag readChunk(int x, int z) {
|
||||
try {
|
||||
return cps.chunkMap.readChunk(new ChunkPos(x, z));
|
||||
return cps.chunkMap.read(new ChunkPos(x, z));
|
||||
} catch (Exception exc) {
|
||||
Log.severe(String.format("Error reading chunk: %s,%d,%d", dw.getName(), x, z), exc);
|
||||
return null;
|
||||
|
@ -67,13 +67,14 @@ public class ForgeMapChunkCache extends GenericMapChunkCache {
|
||||
|
||||
private CompoundTag readChunk(int x, int z) {
|
||||
try {
|
||||
CompoundTag rslt = cps.chunkMap.readChunk(new ChunkPos(x, z));
|
||||
CompoundTag rslt = cps.chunkMap.read(new ChunkPos(x, z));
|
||||
if (rslt != null) {
|
||||
if (rslt.contains("Level")) {
|
||||
rslt = rslt.getCompound("Level");
|
||||
CompoundTag lev = rslt;
|
||||
if (lev.contains("Level")) {
|
||||
lev = lev.getCompound("Level");
|
||||
}
|
||||
// Don't load uncooked chunks
|
||||
String stat = rslt.getString("Status");
|
||||
String stat = lev.getString("Status");
|
||||
ChunkStatus cs = ChunkStatus.byName(stat);
|
||||
if ((stat == null) ||
|
||||
// Needs to be at least lighted
|
||||
|
@ -68,17 +68,20 @@ public class ForgeMapChunkCache extends GenericMapChunkCache {
|
||||
|
||||
private CompoundTag readChunk(int x, int z) {
|
||||
try {
|
||||
CompoundTag rslt = cps.chunkMap.readChunk(new ChunkPos(x, z)).join().get();
|
||||
if (rslt.contains("Level")) {
|
||||
rslt = rslt.getCompound("Level");
|
||||
}
|
||||
// Don't load uncooked chunks
|
||||
String stat = rslt.getString("Status");
|
||||
ChunkStatus cs = ChunkStatus.byName(stat);
|
||||
if ((stat == null) ||
|
||||
// Needs to be at least lighted
|
||||
(!cs.isOrAfter(ChunkStatus.LIGHT))) {
|
||||
rslt = null;
|
||||
CompoundTag rslt = cps.chunkMap.read(new ChunkPos(x, z)).join().get();
|
||||
if (rslt != null) {
|
||||
CompoundTag lev = rslt;
|
||||
if (lev.contains("Level")) {
|
||||
lev = lev.getCompound("Level");
|
||||
}
|
||||
// Don't load uncooked chunks
|
||||
String stat = lev.getString("Status");
|
||||
ChunkStatus cs = ChunkStatus.byName(stat);
|
||||
if ((stat == null) ||
|
||||
// Needs to be at least lighted
|
||||
(!cs.isOrAfter(ChunkStatus.LIGHT))) {
|
||||
rslt = null;
|
||||
}
|
||||
}
|
||||
// Log.info(String.format("loadChunk(%d,%d)=%s", x, z, (rslt != null) ?
|
||||
// rslt.toString() : "null"));
|
||||
|
@ -68,17 +68,20 @@ public class ForgeMapChunkCache extends GenericMapChunkCache {
|
||||
|
||||
private CompoundTag readChunk(int x, int z) {
|
||||
try {
|
||||
CompoundTag rslt = cps.chunkMap.readChunk(new ChunkPos(x, z)).join().get();
|
||||
if (rslt.contains("Level")) {
|
||||
rslt = rslt.getCompound("Level");
|
||||
}
|
||||
// Don't load uncooked chunks
|
||||
String stat = rslt.getString("Status");
|
||||
ChunkStatus cs = ChunkStatus.byName(stat);
|
||||
if ((stat == null) ||
|
||||
// Needs to be at least lighted
|
||||
(!cs.isOrAfter(ChunkStatus.LIGHT))) {
|
||||
rslt = null;
|
||||
CompoundTag rslt = cps.chunkMap.read(new ChunkPos(x, z)).join().get();
|
||||
if (rslt != null) {
|
||||
CompoundTag lev = rslt;
|
||||
if (lev.contains("Level")) {
|
||||
lev = lev.getCompound("Level");
|
||||
}
|
||||
// Don't load uncooked chunks
|
||||
String stat = lev.getString("Status");
|
||||
ChunkStatus cs = ChunkStatus.byName(stat);
|
||||
if ((stat == null) ||
|
||||
// Needs to be at least lighted
|
||||
(!cs.isOrAfter(ChunkStatus.LIGHT))) {
|
||||
rslt = null;
|
||||
}
|
||||
}
|
||||
// Log.info(String.format("loadChunk(%d,%d)=%s", x, z, (rslt != null) ?
|
||||
// rslt.toString() : "null"));
|
||||
|
@ -68,17 +68,20 @@ public class ForgeMapChunkCache extends GenericMapChunkCache {
|
||||
|
||||
private CompoundTag readChunk(int x, int z) {
|
||||
try {
|
||||
CompoundTag rslt = cps.chunkMap.readChunk(new ChunkPos(x, z)).join().get();
|
||||
if (rslt.contains("Level")) {
|
||||
rslt = rslt.getCompound("Level");
|
||||
}
|
||||
// Don't load uncooked chunks
|
||||
String stat = rslt.getString("Status");
|
||||
ChunkStatus cs = ChunkStatus.byName(stat);
|
||||
if ((stat == null) ||
|
||||
// Needs to be at least lighted
|
||||
(!cs.isOrAfter(ChunkStatus.LIGHT))) {
|
||||
rslt = null;
|
||||
CompoundTag rslt = cps.chunkMap.read(new ChunkPos(x, z)).join().get();
|
||||
if (rslt != null) {
|
||||
CompoundTag lev = rslt;
|
||||
if (lev.contains("Level")) {
|
||||
lev = lev.getCompound("Level");
|
||||
}
|
||||
// Don't load uncooked chunks
|
||||
String stat = lev.getString("Status");
|
||||
ChunkStatus cs = ChunkStatus.byName(stat);
|
||||
if ((stat == null) ||
|
||||
// Needs to be at least lighted
|
||||
(!cs.isOrAfter(ChunkStatus.LIGHT))) {
|
||||
rslt = null;
|
||||
}
|
||||
}
|
||||
// Log.info(String.format("loadChunk(%d,%d)=%s", x, z, (rslt != null) ?
|
||||
// rslt.toString() : "null"));
|
||||
|
Loading…
Reference in New Issue
Block a user