fa547dce64
- Rename and relocate package from DeluxeHubReloaded to VexlioHub - Remove deprecated modules: antiwdl, scoreboard, tablist, pvp_mode, teleportation_bow, anti_swear, lockchat, vanish, holograms - Refactor all commands to standard Bukkit CommandExecutor/TabCompleter registered dynamically via Bukkit CommandMap - Add particle, sound, and trail configurations for launchpad and double jump modules - Implement actionbar announcements and join title welcome animation modules - Fully customize, translate to Czech, and restyle all configuration files in the 'uprava/' directory with the purple-cyan gradient theme
34 lines
1011 B
Java
34 lines
1011 B
Java
package eu.milujukockoholky.vexliolobby.utility;
|
|
|
|
import me.clip.placeholderapi.PlaceholderAPI;
|
|
import org.bukkit.Bukkit;
|
|
import org.bukkit.Location;
|
|
import org.bukkit.entity.Player;
|
|
|
|
public class PlaceholderUtil {
|
|
|
|
public static boolean PAPI;
|
|
|
|
public static String setPlaceholders(String text, Player player) {
|
|
|
|
if (text.contains("%player%") && player != null) text = text.replace("%player%", player.getName());
|
|
|
|
if (text.contains("%online%"))
|
|
text = text.replace("%online%", String.valueOf(Bukkit.getServer().getOnlinePlayers().size()));
|
|
|
|
if (text.contains("%online_max%"))
|
|
text = text.replace("%online_max%", String.valueOf(Bukkit.getServer().getMaxPlayers()));
|
|
|
|
if (text.contains("%location%") && player != null) {
|
|
Location location = player.getLocation();
|
|
text = text.replace("%location%", location.getBlockX() + ", " + location.getBlockY() + ", " + location.getBlockZ());
|
|
}
|
|
|
|
if (PAPI && player != null) text = PlaceholderAPI.setPlaceholders(player, text);
|
|
|
|
return text;
|
|
|
|
}
|
|
|
|
}
|