use of net.dzikoysk.funnyguilds.concurrency.ConcurrencyManager in project FunnyGuilds by FunnyGuilds.
the class Manager method start.
public void start() {
if (FunnyGuilds.getInstance().isDisabling()) {
return;
}
if (this.task != null) {
return;
}
FunnyGuilds funnyGuilds = FunnyGuilds.getInstance();
ConcurrencyManager concurrencyManager = funnyGuilds.getConcurrencyManager();
long interval = this.getSettings().dataInterval * 60 * 20;
DataSaveRequest saveRequest = new DataSaveRequest();
this.task = Bukkit.getScheduler().runTaskTimerAsynchronously(funnyGuilds, () -> concurrencyManager.postRequests(saveRequest), interval, interval);
}
use of net.dzikoysk.funnyguilds.concurrency.ConcurrencyManager in project FunnyGuilds by FunnyGuilds.
the class PlayerJoin method onJoin.
@EventHandler
public void onJoin(PlayerJoinEvent e) {
Player player = e.getPlayer();
User user = User.get(player);
PluginConfig config = Settings.getConfig();
if (config.playerlistEnable && !AbstractTablist.hasTablist(player)) {
AbstractTablist.createTablist(config.playerList, config.playerListHeader, config.playerListFooter, config.playerListPing, player);
}
user.getScoreboard();
/*
IndependentThread.actions(ActionType.PREFIX_GLOBAL_UPDATE_PLAYER, player);
IndependentThread.actions(ActionType.DUMMY_GLOBAL_UPDATE_USER, user);
IndependentThread.actions(ActionType.RANK_UPDATE_USER, user);
*/
ConcurrencyManager concurrencyManager = FunnyGuilds.getInstance().getConcurrencyManager();
concurrencyManager.postRequests(new PrefixGlobalUpdatePlayer(player), new DummyGlobalUpdateUserRequest(user), new RankUpdateUserRequest(user));
this.plugin.getServer().getScheduler().runTaskLaterAsynchronously(this.plugin, () -> {
PacketExtension.registerPlayer(player);
Version.isNewAvailable(player, false);
Region region = RegionUtils.getAt(player.getLocation());
if (region == null || region.getGuild() == null) {
return;
}
if (config.createEntityType != null) {
EntityUtil.spawn(region.getGuild(), player);
}
}, 30L);
}
Aggregations