mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-27 13:07:29 +01:00
Fixed profile migrations happening too early.
This commit is contained in:
parent
acce59edd4
commit
e94083045f
@ -167,6 +167,23 @@ public void onEnable() {
|
|||||||
|
|
||||||
executorService = MoreExecutors.listeningDecorator(EvenMoreExecutors.newBoundedCachedThreadPool(0, 1, 20));
|
executorService = MoreExecutors.listeningDecorator(EvenMoreExecutors.newBoundedCachedThreadPool(0, 1, 20));
|
||||||
|
|
||||||
|
File cacheDir = new File(getDataFolder(), "cache");
|
||||||
|
cacheDir.mkdirs();
|
||||||
|
try {
|
||||||
|
profileCache = new SQLiteCache(new File(cacheDir, "profiles.sqlite"));
|
||||||
|
} catch (IOException e) {
|
||||||
|
WorldGuard.logger.log(Level.WARNING, "Failed to initialize SQLite profile cache");
|
||||||
|
profileCache = new HashMapCache();
|
||||||
|
}
|
||||||
|
|
||||||
|
profileService = new CacheForwardingService(
|
||||||
|
new CombinedProfileService(
|
||||||
|
BukkitPlayerService.getInstance(),
|
||||||
|
HttpRepositoryService.forMinecraft()),
|
||||||
|
profileCache);
|
||||||
|
|
||||||
|
PermissionsResolverManager.initialize(this);
|
||||||
|
|
||||||
WorldGuard.getInstance().setPlatform(platform = new BukkitWorldGuardPlatform()); // Initialise WorldGuard
|
WorldGuard.getInstance().setPlatform(platform = new BukkitWorldGuardPlatform()); // Initialise WorldGuard
|
||||||
WorldGuard.getInstance().setup();
|
WorldGuard.getInstance().setup();
|
||||||
BukkitSessionManager sessionManager = (BukkitSessionManager) platform.getSessionManager();
|
BukkitSessionManager sessionManager = (BukkitSessionManager) platform.getSessionManager();
|
||||||
@ -185,32 +202,12 @@ public void onEnable() {
|
|||||||
reg.register(ToggleCommands.class);
|
reg.register(ToggleCommands.class);
|
||||||
reg.register(ProtectionCommands.class);
|
reg.register(ProtectionCommands.class);
|
||||||
|
|
||||||
getServer().getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
|
getServer().getScheduler().scheduleSyncDelayedTask(this, () -> {
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
if (!platform.getGlobalStateManager().hasCommandBookGodMode()) {
|
if (!platform.getGlobalStateManager().hasCommandBookGodMode()) {
|
||||||
reg.register(GeneralCommands.class);
|
reg.register(GeneralCommands.class);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}, 0L);
|
}, 0L);
|
||||||
|
|
||||||
File cacheDir = new File(getDataFolder(), "cache");
|
|
||||||
cacheDir.mkdirs();
|
|
||||||
try {
|
|
||||||
profileCache = new SQLiteCache(new File(cacheDir, "profiles.sqlite"));
|
|
||||||
} catch (IOException e) {
|
|
||||||
WorldGuard.logger.log(Level.WARNING, "Failed to initialize SQLite profile cache");
|
|
||||||
profileCache = new HashMapCache();
|
|
||||||
}
|
|
||||||
|
|
||||||
profileService = new CacheForwardingService(
|
|
||||||
new CombinedProfileService(
|
|
||||||
BukkitPlayerService.getInstance(),
|
|
||||||
HttpRepositoryService.forMinecraft()),
|
|
||||||
profileCache);
|
|
||||||
|
|
||||||
PermissionsResolverManager.initialize(this);
|
|
||||||
|
|
||||||
WorldGuard.logger.info("Loading region data...");
|
WorldGuard.logger.info("Loading region data...");
|
||||||
|
|
||||||
getServer().getScheduler().scheduleSyncRepeatingTask(this, sessionManager, BukkitSessionManager.RUN_DELAY, BukkitSessionManager.RUN_DELAY);
|
getServer().getScheduler().scheduleSyncRepeatingTask(this, sessionManager, BukkitSessionManager.RUN_DELAY, BukkitSessionManager.RUN_DELAY);
|
||||||
|
Loading…
Reference in New Issue
Block a user