Restore normal version of chunk handler
This commit is contained in:
parent
2a54938d09
commit
f1b24f3e0d
1 changed files with 0 additions and 28 deletions
|
|
@ -1,6 +1,5 @@
|
||||||
package org.dynmap.forge_1_18_2;
|
package org.dynmap.forge_1_18_2;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import net.minecraft.world.level.biome.Biome;
|
import net.minecraft.world.level.biome.Biome;
|
||||||
|
|
@ -11,7 +10,6 @@ import org.dynmap.common.BiomeMap;
|
||||||
import org.dynmap.common.chunk.GenericChunk;
|
import org.dynmap.common.chunk.GenericChunk;
|
||||||
import org.dynmap.common.chunk.GenericChunkCache;
|
import org.dynmap.common.chunk.GenericChunkCache;
|
||||||
import org.dynmap.common.chunk.GenericMapChunkCache;
|
import org.dynmap.common.chunk.GenericMapChunkCache;
|
||||||
import org.dynmap.utils.TileFlags;
|
|
||||||
|
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
import net.minecraft.server.level.ServerChunkCache;
|
import net.minecraft.server.level.ServerChunkCache;
|
||||||
|
|
@ -67,8 +65,6 @@ public class ForgeMapChunkCache extends GenericMapChunkCache {
|
||||||
super.setChunks(dw, chunks);
|
super.setChunks(dw, chunks);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static HashMap<String, TileFlags> tmap = new HashMap<String, TileFlags>();
|
|
||||||
|
|
||||||
private CompoundTag readChunk(int x, int z) {
|
private CompoundTag readChunk(int x, int z) {
|
||||||
try {
|
try {
|
||||||
CompoundTag rslt = cps.chunkMap.read(new ChunkPos(x, z));
|
CompoundTag rslt = cps.chunkMap.read(new ChunkPos(x, z));
|
||||||
|
|
@ -86,30 +82,6 @@ public class ForgeMapChunkCache extends GenericMapChunkCache {
|
||||||
rslt = null;
|
rslt = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (rslt != null) {
|
|
||||||
int version = rslt.getInt("DataVersion");
|
|
||||||
if (version < 2975) {
|
|
||||||
boolean doIt = false;
|
|
||||||
synchronized(tmap) {
|
|
||||||
TileFlags tf = tmap.get(dw.getName());
|
|
||||||
if (tf == null) {
|
|
||||||
tf = new TileFlags();
|
|
||||||
tmap.put(dw.getName(), tf);
|
|
||||||
}
|
|
||||||
if (!tf.getFlag(x, z)) {
|
|
||||||
tf.setFlag(x, z, true);
|
|
||||||
doIt = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (doIt) {
|
|
||||||
ChunkPos pos = new ChunkPos(x, z);
|
|
||||||
CompoundTag newrec = cps.chunkMap.readChunk(pos);
|
|
||||||
if (rslt != null) {
|
|
||||||
cps.chunkMap.write(pos, newrec.copy());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Log.info(String.format("loadChunk(%d,%d)=%s", x, z, (rslt != null) ?
|
// Log.info(String.format("loadChunk(%d,%d)=%s", x, z, (rslt != null) ?
|
||||||
// rslt.toString() : "null"));
|
// rslt.toString() : "null"));
|
||||||
return rslt;
|
return rslt;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue