Improved PlaceholderAPI functionality and fixed bugs

This commit is contained in:
RayzsYT committed 2025-03-01 00:37:25 +01:00
1 parent ffd52212e1
commit 80becff090
7 files changed
+13 -13

No files matched your search

@@ -4,6 +4,9 @@ import de.rayzs.pat.api.event.PATEventHandler;
import de.rayzs.pat.api.storage.placeholders.commands.general.*;
import de.rayzs.pat.api.storage.placeholders.commands.group.*;
import de.rayzs.pat.api.storage.blacklist.BlacklistCreator;
import de.rayzs.pat.api.storage.placeholders.messages.BlockedBaseCommandPlaceholder;
import de.rayzs.pat.api.storage.placeholders.messages.BlockedSubCommandPlaceholder;
import de.rayzs.pat.api.storage.placeholders.messages.UnknownCommandPlaceholder;
import de.rayzs.pat.api.storage.storages.ConfigStorage;
import de.rayzs.pat.api.storage.placeholders.general.*;
import de.rayzs.pat.api.storage.placeholders.groups.*;
@@ -150,6 +153,10 @@ public class Storage {
public static GeneralCurrentVersionPlaceholder CURRENT_VERSION = new GeneralCurrentVersionPlaceholder();
public static GeneralNewestVersionPlaceholder NEWEST_VERSION = new GeneralNewestVersionPlaceholder();
public static BlockedBaseCommandPlaceholder BLOCKED_BASE_COMMAND = new BlockedBaseCommandPlaceholder();
public static BlockedSubCommandPlaceholder BLOCKED_SUB_COMMAND = new BlockedSubCommandPlaceholder();
public static UnknownCommandPlaceholder UNKNOWN_COMMAND = new UnknownCommandPlaceholder();
public static ListGroupsPlaceholder LIST_GROUP = new ListGroupsPlaceholder();
public static ListGroupsReversedPlaceholder LIST_GROUP_REVERSED = new ListGroupsReversedPlaceholder();
public static ListGroupsSortedPlaceholder LIST_GROUP_SORTED = new ListGroupsSortedPlaceholder();
@@ -184,6 +191,7 @@ public class Storage {
break;
}
System.out.println("Result: " + result);
return result;
}
}
@@ -14,9 +14,6 @@ public class ListGroupsPlaceholder extends PlaceholderStorage {
@Override
public String onRequest(Player player, String param) {
Group group = GroupManager.getGroupByName(param);
if(group == null) return null;
return StringUtils.buildStringList(
GroupManager.getGroupNames(),
SPLITTER,
@@ -14,9 +14,6 @@ public class ListGroupsReversedPlaceholder extends PlaceholderStorage {
@Override
public String onRequest(Player player, String param) {
Group group = GroupManager.getGroupByName(param);
if(group == null) return null;
return StringUtils.buildSortedStringList(
GroupManager.getGroupNames(),
SPLITTER,
@@ -14,9 +14,6 @@ public class ListGroupsSortedPlaceholder extends PlaceholderStorage {
@Override
public String onRequest(Player player, String param) {
Group group = GroupManager.getGroupByName(param);
if(group == null) return null;
return StringUtils.buildSortedStringList(
GroupManager.getGroupNames(),
SPLITTER,
@@ -9,6 +9,7 @@ public abstract class PlaceholderStorage extends StorageTemplate {
public PlaceholderStorage(String request) {
super(Storage.Files.PLACEHOLDERS, request);
this.request = request;
Storage.ConfigSections.PLACEHOLDERS.add(this);
}