summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/MinecraftServer.java
diff options
context:
space:
mode:
authorMike Primm <mike@primmhome.com>2012-08-03 01:19:10 -0500
committerWesley Wolfe <weswolf@aol.com>2012-08-03 01:19:10 -0500
commitfe8fc6b90e9e16b62f8123f9309561b9262f9849 (patch)
treefe01bb37eb1899bc048d740681d9b6dbcfb563e1 /src/main/java/net/minecraft/server/MinecraftServer.java
parentf5794937a91b574dc4fd3876adb22676c7c166de (diff)
downloadcraftbukkit-fe8fc6b90e9e16b62f8123f9309561b9262f9849.tar
craftbukkit-fe8fc6b90e9e16b62f8123f9309561b9262f9849.tar.gz
craftbukkit-fe8fc6b90e9e16b62f8123f9309561b9262f9849.tar.lz
craftbukkit-fe8fc6b90e9e16b62f8123f9309561b9262f9849.tar.xz
craftbukkit-fe8fc6b90e9e16b62f8123f9309561b9262f9849.zip
Process entity ticks on worlds without players. Fixes BUKKIT-2031
Both the CB 1.3.1 code, and vanilla 1.3.1 code, have modified the behavior of entity tick processing in a way that can lead to disabling of entity cleanup. Specifically, the tickEntities() call in n.m.s.World, which processes both the entity cleanup (removing from the world entity list) and tile entity tick processing (furnaces and such) does not get called by n.m.s.MinecraftServer's q() method (which drives tick processing calls in general) when no players are on the given world. This causes a serious memory leak when automation processes, like dynmap mapping, load and unload chunks - as entities on unloaded chunks are only cleaned up during entity tick processing. It also will cause issues with any mods that use persistent chunk loading (that is, keeping chunks loaded so that tile entities will continue being processed), since such processing will no longer function without at least one player on the given world. In any case, the tickEntities() call should be called in the same fashion as under 1.2.x (each tick, independent of player population, as opposed to being suspended indefinitely when no players are on the given world). The specific memory leak observed, with removing the unloaded entites from the world, requires this call be made regularly (or, at least, whenever the entity unload queue (world.g) is not empty. Closes GH-832
Diffstat (limited to 'src/main/java/net/minecraft/server/MinecraftServer.java')
-rw-r--r--src/main/java/net/minecraft/server/MinecraftServer.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 8d07f855..bba95156 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -539,7 +539,7 @@ public abstract class MinecraftServer implements Runnable, IMojangStatistics, IC
while (true) {
if (!worldserver.updateLights()) {
// this.methodProfiler.b(); // CraftBukkit - not in production code
- if (!worldserver.players.isEmpty()) {
+ if (true || !worldserver.players.isEmpty()) { // CraftBukkit - this prevents entity cleanup, other issue on servers with no players
worldserver.tickEntities();
}