Add a cache for prisoners online only, this should help performance #26

The cache listens to a lot of events and custom events to ensure the
cache is up to date, this way we don't have to loop through all the
prisoners in a jail every single time they move or something but instead
just check the cache.
This commit is contained in:
graywolf336
2014-05-30 12:23:32 -05:00
parent 82f17f3a4b
commit af1fa37470
5 changed files with 144 additions and 3 deletions

View File

@ -12,6 +12,7 @@ import com.graywolf336.jail.command.JailHandler;
import com.graywolf336.jail.enums.Settings;
import com.graywolf336.jail.legacy.LegacyManager;
import com.graywolf336.jail.listeners.BlockListener;
import com.graywolf336.jail.listeners.CacheListener;
import com.graywolf336.jail.listeners.EntityListener;
import com.graywolf336.jail.listeners.HandCuffListener;
import com.graywolf336.jail.listeners.JailingListener;
@ -79,6 +80,7 @@ public class JailMain extends JavaPlugin {
PluginManager plm = this.getServer().getPluginManager();
plm.registerEvents(new BlockListener(this), this);
plm.registerEvents(new CacheListener(this), this);
plm.registerEvents(new EntityListener(this), this);
plm.registerEvents(new HandCuffListener(this), this);
plm.registerEvents(new JailingListener(this), this);