mirror of
https://github.com/webbukkit/dynmap.git
synced 2025-01-01 05:27:39 +01:00
Add tileupdatedelay setting, compute more accurate bounding box for new chunks
This commit is contained in:
parent
bd12420edd
commit
f43027f02f
@ -17,6 +17,7 @@ import java.util.concurrent.Future;
|
|||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Chunk;
|
import org.bukkit.Chunk;
|
||||||
|
import org.bukkit.ChunkSnapshot;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.OfflinePlayer;
|
import org.bukkit.OfflinePlayer;
|
||||||
@ -1392,10 +1393,17 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI {
|
|||||||
@EventHandler(priority=EventPriority.MONITOR)
|
@EventHandler(priority=EventPriority.MONITOR)
|
||||||
public void onChunkPopulate(ChunkPopulateEvent event) {
|
public void onChunkPopulate(ChunkPopulateEvent event) {
|
||||||
Chunk c = event.getChunk();
|
Chunk c = event.getChunk();
|
||||||
|
ChunkSnapshot cs = c.getChunkSnapshot();
|
||||||
|
int ymax = 0;
|
||||||
|
for(int i = 0; i < c.getWorld().getMaxHeight() / 16; i++) {
|
||||||
|
if(!cs.isSectionEmpty(i)) {
|
||||||
|
ymax = (i+1)*16;
|
||||||
|
}
|
||||||
|
}
|
||||||
/* Touch extreme corners */
|
/* Touch extreme corners */
|
||||||
int x = c.getX() << 4;
|
int x = c.getX() << 4;
|
||||||
int z = c.getZ() << 4;
|
int z = c.getZ() << 4;
|
||||||
mapManager.touchVolume(getWorld(event.getWorld()).getName(), x, 0, z, x+15, 128, z+16, "chunkpopulate");
|
mapManager.touchVolume(getWorld(event.getWorld()).getName(), x, 0, z, x+15, ymax, z+16, "chunkpopulate");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
pm.registerEvents(chunkTrigger, this);
|
pm.registerEvents(chunkTrigger, this);
|
||||||
|
@ -42,7 +42,7 @@ components:
|
|||||||
hideifsneaking: false
|
hideifsneaking: false
|
||||||
# If true, player positions/status is protected (login with ID with dynmap.playermarkers.seeall permission required for info other than self)
|
# If true, player positions/status is protected (login with ID with dynmap.playermarkers.seeall permission required for info other than self)
|
||||||
protected-player-info: false
|
protected-player-info: false
|
||||||
@ If true, hide players with invisibility potion effects active
|
# If true, hide players with invisibility potion effects active
|
||||||
hide-if-invisiblity-potion: true
|
hide-if-invisiblity-potion: true
|
||||||
#- class: org.dynmap.JsonFileClientUpdateComponent
|
#- class: org.dynmap.JsonFileClientUpdateComponent
|
||||||
# writeinterval: 1
|
# writeinterval: 1
|
||||||
@ -186,6 +186,11 @@ saverestorepending: true
|
|||||||
# Zoom-out tile update period - how often to scan for and process tile updates into zoom-out tiles (in seconds)
|
# Zoom-out tile update period - how often to scan for and process tile updates into zoom-out tiles (in seconds)
|
||||||
zoomoutperiod: 30
|
zoomoutperiod: 30
|
||||||
|
|
||||||
|
# Default delay on processing of updated tiles, in seconds. This can reduce potentially expensive re-rendering
|
||||||
|
# of frequently updated tiles (such as due to machines, pistons, quarries or other automation). Values can
|
||||||
|
# also be set on individual worlds and individual maps.
|
||||||
|
tileupdatedelay: 30
|
||||||
|
|
||||||
# Tile hashing is used to minimize tile file updates when no changes have occurred - set to false to disable
|
# Tile hashing is used to minimize tile file updates when no changes have occurred - set to false to disable
|
||||||
enabletilehash: true
|
enabletilehash: true
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user