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:
@ -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);
|
||||
|
Reference in New Issue
Block a user