Improve forge chunk generate handling

This commit is contained in:
Mike Primm 2021-12-25 21:46:28 -06:00
parent 21e8663e0b
commit 450921569c
8 changed files with 14092 additions and 14073 deletions

View File

@ -17,7 +17,7 @@
<script type="text/javascript" src="js/jquery-3.5.1.js?_=${version}-${buildnumber}"></script>
<link rel="stylesheet" type="text/css" href="css/leaflet.css?_=${version}-${buildnumber}" />
<script type="text/javascript" src="js/leaflet.js?_=${version}-${buildnumber}"></script>
<!-- FOr source debug on leaflet <script type="text/javascript" src="js/leaflet-src.js?_=${version}-${buildnumber}"></script> -->
<script type="text/javascript" src="js/custommarker.js?_=${version}-${buildnumber}"></script>
<script type="text/javascript" src="js/dynmaputils.js?_=${version}-${buildnumber}"></script>

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1732,7 +1732,7 @@ public class DynmapPlugin
IWorld w = event.getWorld();
if(!(w instanceof ServerWorld)) return;
IChunk c = event.getChunk();
if ((c != null) && (c.getStatus() == ChunkStatus.FULL)) {
if ((c != null) && (c.getStatus() == ChunkStatus.FULL) && (c instanceof Chunk)) {
ForgeWorld fw = getWorld((IServerWorld)w, false);
if (fw != null) {
addKnownChunk(fw, c.getPos());
@ -1746,7 +1746,7 @@ public class DynmapPlugin
IWorld w = event.getWorld();
if(!(w instanceof ServerWorld)) return;
IChunk c = event.getChunk();
if ((c != null) && (c.getStatus() == ChunkStatus.FULL)) {
if (c != null) {
ForgeWorld fw = getWorld((IServerWorld)w, false);
ChunkPos cp = c.getPos();
if (fw != null) {
@ -1780,7 +1780,7 @@ public class DynmapPlugin
IWorld w = event.getWorld();
if(!(w instanceof ServerWorld)) return;
IChunk c = event.getChunk();
if ((c != null) && (c.getStatus() == ChunkStatus.FULL)) {
if (c != null) {
ForgeWorld fw = getWorld((IServerWorld)w, false);
ChunkPos cp = c.getPos();
if (fw != null) {
@ -1801,7 +1801,10 @@ public class DynmapPlugin
if (ymax != Integer.MIN_VALUE) {
mapManager.touchVolume(fw.getName(), x, ymin, z, x+15, ymax, z+15, "chunkgenerate");
}
addKnownChunk(fw, cp);
// If cooked, add it to known
if ((c.getStatus() == ChunkStatus.FULL) && (c instanceof Chunk)) {
addKnownChunk(fw, cp);
}
}
}
}

View File

@ -59,6 +59,7 @@ import net.minecraft.world.level.block.LiquidBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.chunk.ChunkAccess;
import net.minecraft.world.level.chunk.ChunkStatus;
import net.minecraft.world.level.chunk.LevelChunk;
import net.minecraft.world.level.chunk.LevelChunkSection;
import net.minecraft.world.level.material.Material;
import net.minecraft.world.phys.Vec3;
@ -1703,7 +1704,7 @@ public class DynmapPlugin
LevelAccessor w = event.getWorld();
if(!(w instanceof ServerLevel)) return;
ChunkAccess c = event.getChunk();
if ((c != null) && (c.getStatus() == ChunkStatus.FULL)) {
if ((c != null) && (c.getStatus() == ChunkStatus.FULL) && (c instanceof LevelChunk)) {
ForgeWorld fw = getWorld((ServerLevel)w, false);
if (fw != null) {
addKnownChunk(fw, c.getPos());
@ -1717,7 +1718,7 @@ public class DynmapPlugin
LevelAccessor w = event.getWorld();
if(!(w instanceof ServerLevel)) return;
ChunkAccess c = event.getChunk();
if ((c != null) && (c.getStatus() == ChunkStatus.FULL)) {
if (c != null) {
ForgeWorld fw = getWorld((ServerLevel)w, false);
ChunkPos cp = c.getPos();
if (fw != null) {
@ -1751,7 +1752,7 @@ public class DynmapPlugin
LevelAccessor w = event.getWorld();
if(!(w instanceof ServerLevel)) return;
ChunkAccess c = event.getChunk();
if ((c != null) && (c.getStatus() == ChunkStatus.FULL)) {
if (c != null) {
ForgeWorld fw = getWorld((ServerLevel)w, false);
ChunkPos cp = c.getPos();
if (fw != null) {
@ -1771,8 +1772,11 @@ public class DynmapPlugin
// If not empty AND not initial scan
if (ymax != Integer.MIN_VALUE) {
mapManager.touchVolume(fw.getName(), x, ymin, z, x+15, ymax, z+15, "chunkgenerate");
}
addKnownChunk(fw, cp);
}
// If chunk is cooked, add it to known
if ((c.getStatus() == ChunkStatus.FULL) && (c instanceof LevelChunk)) {
addKnownChunk(fw, cp);
}
}
}
}

View File

@ -57,6 +57,7 @@ import net.minecraft.world.level.block.LiquidBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.chunk.ChunkAccess;
import net.minecraft.world.level.chunk.ChunkStatus;
import net.minecraft.world.level.chunk.LevelChunk;
import net.minecraft.world.level.chunk.LevelChunkSection;
import net.minecraft.world.level.material.Material;
import net.minecraft.world.phys.Vec3;
@ -1704,7 +1705,7 @@ public class DynmapPlugin
LevelAccessor w = event.getWorld();
if(!(w instanceof ServerLevel)) return;
ChunkAccess c = event.getChunk();
if ((c != null) && (c.getStatus() == ChunkStatus.FULL)) {
if ((c != null) && (c.getStatus() == ChunkStatus.FULL) && (c instanceof LevelChunk)) {
ForgeWorld fw = getWorld((ServerLevel)w, false);
if (fw != null) {
addKnownChunk(fw, c.getPos());
@ -1718,7 +1719,7 @@ public class DynmapPlugin
LevelAccessor w = event.getWorld();
if(!(w instanceof ServerLevel)) return;
ChunkAccess c = event.getChunk();
if ((c != null) && (c.getStatus() == ChunkStatus.FULL)) {
if (c != null) {
ForgeWorld fw = getWorld((ServerLevel)w, false);
ChunkPos cp = c.getPos();
if (fw != null) {
@ -1752,7 +1753,7 @@ public class DynmapPlugin
LevelAccessor w = event.getWorld();
if(!(w instanceof ServerLevel)) return;
ChunkAccess c = event.getChunk();
if ((c != null) && (c.getStatus() == ChunkStatus.FULL)) {
if (c != null) {
ForgeWorld fw = getWorld((ServerLevel)w, false);
ChunkPos cp = c.getPos();
if (fw != null) {
@ -1773,8 +1774,11 @@ public class DynmapPlugin
if (ymax != Integer.MIN_VALUE) {
//Log.info(String.format("chunkkeyerate(save)(%s,%d,%d,%d,%d,%d,%s)", fw.getName(), x, ymin, z, x+15, ymax, z+15));
mapManager.touchVolume(fw.getName(), x, ymin, z, x+15, ymax, z+15, "chunkgenerate");
}
addKnownChunk(fw, cp);
}
// If cooked, add to known
if ((c.getStatus() == ChunkStatus.FULL) && (c instanceof LevelChunk)) {
addKnownChunk(fw, cp);
}
}
}
}