Optimize checkIfActive to only check if chunks are loaded if entity is active

This will cut down on the call to areChunksLoaded drastically, which is pretty slow

By: Aikar <aikar@aikar.co>
This commit is contained in:
Spigot
2013-02-27 02:27:14 -05:00
parent 2c8cc83ee8
commit dfe217aca6
2 changed files with 16 additions and 17 deletions

View File

@@ -1,4 +1,4 @@
From b0378ebbdbfe2bb1462cf2c3c44562b9ac731408 Mon Sep 17 00:00:00 2001
From 51ae704ad3290541373ec51570d48c9e66743f5c Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sat, 23 Feb 2013 12:33:20 +1100
Subject: [PATCH] Watchdog Thread.
@@ -34,7 +34,7 @@ index aa6a14a..6005fac 100644
this.isStopped = true;
} catch (Throwable throwable1) {
diff --git a/src/main/java/org/bukkit/craftbukkit/Spigot.java b/src/main/java/org/bukkit/craftbukkit/Spigot.java
index 3171411..c0335fa 100644
index 83018b0..931f6fd 100644
--- a/src/main/java/org/bukkit/craftbukkit/Spigot.java
+++ b/src/main/java/org/bukkit/craftbukkit/Spigot.java
@@ -1,5 +1,6 @@
@@ -90,7 +90,7 @@ index 3171411..c0335fa 100644
}
if (server.chunkGCPeriod == 0) {
@@ -265,4 +280,63 @@ public class Spigot {
@@ -264,4 +279,63 @@ public class Spigot {
SpigotTimings.checkIfActiveTimer.stopTiming();
return isActive;
}
@@ -297,5 +297,5 @@ index e568bf6..7c18391 100644
default:
growth-chunks-per-tick: 650
--
1.8.1-rc2
1.8.1.1