mirror of
https://github.com/RayzsYT/ProAntiTab.git
synced 2026-11-30 20:39:53 -05:00
Add PAPIProxyBridge Support
This commit is contained in:
1 parent
cc2f86f248
commit
9836b25524
4 files changed
+26
-9
No files matched your search
@@ -72,7 +72,10 @@ public class BungeeLoader extends Plugin {
|
||||
if (manager.getPlugin("LuckPerms") != null)
|
||||
LuckPermsAdapter.initialize();
|
||||
|
||||
Storage.USE_PAPIPROXYBRIDGE = manager.getPlugin("PAPIProxyBridge") != null;
|
||||
if(manager.getPlugin("PAPIProxyBridge") != null) {
|
||||
Storage.USE_PAPIPROXYBRIDGE = true;
|
||||
Logger.info("Successfully hooked into PAPIProxyBridge!");
|
||||
}
|
||||
|
||||
BungeePacketAnalyzer.injectAll();
|
||||
}
|
||||
|
||||
@@ -92,7 +92,10 @@ public class VelocityLoader {
|
||||
if(server.getPluginManager().getPlugin("luckperms").isPresent())
|
||||
LuckPermsAdapter.initialize();
|
||||
|
||||
Storage.USE_PAPIPROXYBRIDGE = server.getPluginManager().getPlugin("papiproxybridge").isPresent();
|
||||
if(server.getPluginManager().getPlugin("papiproxybridge").isPresent()) {
|
||||
Storage.USE_PAPIPROXYBRIDGE = true;
|
||||
Logger.info("Successfully hooked into PAPIProxyBridge!");
|
||||
}
|
||||
}
|
||||
|
||||
public void startUpdaterTask() {
|
||||
|
||||
@@ -74,12 +74,14 @@ public class MessageTranslator {
|
||||
}
|
||||
|
||||
public static void send(Object target, List<String> texts) {
|
||||
texts.forEach(text -> send(target, text));
|
||||
String stringList = StringUtils.buildStringList(texts);
|
||||
send(target, stringList);
|
||||
}
|
||||
|
||||
public static void send(Object target, List<String> texts, String... replacements) {
|
||||
texts = replaceMessageList(texts, replacements);
|
||||
texts.forEach(text -> send(target, text));
|
||||
String stringList = StringUtils.buildStringList(texts);
|
||||
send(target, stringList);
|
||||
}
|
||||
|
||||
public static void send(Object target, String text, String... replacements) {
|
||||
|
||||
+14
-5
@@ -1,6 +1,7 @@
|
||||
package de.rayzs.pat.utils.message.replacer.impl;
|
||||
|
||||
import de.rayzs.pat.utils.CommandSender;
|
||||
import de.rayzs.pat.utils.Reflection;
|
||||
import net.william278.papiproxybridge.api.PlaceholderAPI;
|
||||
import java.util.UUID;
|
||||
import java.util.function.Consumer;
|
||||
@@ -17,14 +18,22 @@ public class ProxyPlaceholderReplacer {
|
||||
UUID uuid = null;
|
||||
|
||||
if(playerObj != null)
|
||||
if(playerObj instanceof CommandSender)
|
||||
|
||||
if(playerObj instanceof CommandSender) {
|
||||
uuid = ((CommandSender) playerObj).getUniqueId();
|
||||
|
||||
else if(playerObj instanceof com.velocitypowered.api.proxy.Player)
|
||||
uuid = ((com.velocitypowered.api.proxy.Player) playerObj).getUniqueId();
|
||||
} else if(Reflection.isVelocityServer()) {
|
||||
if (playerObj instanceof com.velocitypowered.api.proxy.Player)
|
||||
uuid = ((com.velocitypowered.api.proxy.Player) playerObj).getUniqueId();
|
||||
|
||||
else if(playerObj instanceof org.bukkit.entity.Player)
|
||||
uuid = ((org.bukkit.entity.Player) playerObj).getUniqueId();
|
||||
} else if(Reflection.isProxyServer()) {
|
||||
if (playerObj instanceof net.md_5.bungee.api.connection.ProxiedPlayer)
|
||||
uuid = ((net.md_5.bungee.api.connection.ProxiedPlayer) playerObj).getUniqueId();
|
||||
|
||||
} else {
|
||||
if(playerObj instanceof org.bukkit.entity.Player)
|
||||
uuid = ((org.bukkit.entity.Player) playerObj).getUniqueId();
|
||||
}
|
||||
|
||||
if(uuid == null) return false;
|
||||
PLACEHOLDER_API.formatPlaceholders(text, uuid).thenAccept(consumer);
|
||||
|
||||
Reference in new issue
Block a user