mirror of
https://github.com/RayzsYT/ProAntiTab.git
synced 2026-11-26 18:39:43 -05:00
Add Delayed Permissions Update
This commit is contained in:
1 parent
c07f2d863b
commit
55e65bbf5e
2 files changed
+16
-2
No files matched your search
@@ -21,6 +21,8 @@ import com.velocitypowered.api.event.*;
|
||||
import de.rayzs.pat.utils.Reflection;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import com.google.inject.Inject;
|
||||
import de.rayzs.pat.utils.permission.PermissionUtil;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@Plugin(name = "ProAntiTab",
|
||||
@@ -99,6 +101,11 @@ public class VelocityLoader {
|
||||
ConfigUpdater.broadcastMissingParts();
|
||||
}
|
||||
|
||||
public static void delayedPermissionsReload() {
|
||||
Logger.info("Updating permissions!");
|
||||
server.getScheduler().buildTask(VelocityLoader.server, PermissionUtil::reloadPermissions).delay(1, TimeUnit.SECONDS).schedule();
|
||||
}
|
||||
|
||||
public void startUpdaterTask() {
|
||||
if (!Storage.ConfigSections.Settings.UPDATE.ENABLED) return;
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package de.rayzs.pat.utils.adapter;
|
||||
|
||||
import de.rayzs.pat.plugin.VelocityLoader;
|
||||
import de.rayzs.pat.plugin.listeners.velocity.VelocityAntiTabListener;
|
||||
import de.rayzs.pat.plugin.listeners.bungee.WaterfallAntiTabListener;
|
||||
import de.rayzs.pat.plugin.listeners.bukkit.BukkitAntiTabListener;
|
||||
@@ -33,7 +34,10 @@ public class LuckPermsAdapter {
|
||||
if (BukkitLoader.useSuggestions())
|
||||
eventBus.subscribe(Storage.PLUGIN_OBJECT, PreNetworkSyncEvent.class, event -> BukkitAntiTabListener.luckpermsNetworkSync());
|
||||
} else {
|
||||
if(Reflection.isVelocityServer()) VelocityAntiTabListener.updateCommands();
|
||||
if(Reflection.isVelocityServer()) {
|
||||
eventBus.subscribe(Storage.PLUGIN_OBJECT, PreNetworkSyncEvent.class, event -> VelocityLoader.delayedPermissionsReload());
|
||||
VelocityAntiTabListener.updateCommands();
|
||||
}
|
||||
else WaterfallAntiTabListener.updateCommands();
|
||||
}
|
||||
}
|
||||
@@ -91,7 +95,10 @@ public class LuckPermsAdapter {
|
||||
|
||||
if (event.isUser() && event.getTarget() instanceof User) {
|
||||
User user = (User) event.getTarget();
|
||||
if (Reflection.isProxyServer()) PermissionUtil.reloadPermissions(user.getUniqueId());
|
||||
if (Reflection.isProxyServer()) {
|
||||
if(Reflection.isVelocityServer())
|
||||
PermissionUtil.reloadPermissions(user.getUniqueId());
|
||||
}
|
||||
else BukkitAntiTabListener.luckpermsNetworkUserSync(user.getUniqueId());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user