Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

Commit

Permalink
Integrations: add moderation placeholders
Browse files Browse the repository at this point in the history
  • Loading branch information
TheFaser committed Nov 10, 2023
1 parent 8eded66 commit e24dcd3
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,24 @@ public boolean persist() {

@Override
public String onRequest(@Nullable OfflinePlayer player, @NotNull String params) {
if (player == null || !player.isOnline()) return null;
if (player == null) return null;

FPlayer fPlayer = FPlayerManager.get(player.getName());
FPlayer fPlayer = FPlayerManager.getOffline(player.getName());
if(fPlayer == null) return null;

String placeholder = switch (params.toLowerCase()) {

if (params.startsWith("moderation")) {
FlectoneChat.getDatabase().getWarns(fPlayer);

return switch (params.toLowerCase()) {
case "moderation_ban" -> FPlayerManager.getBANNED_PLAYERS().contains(fPlayer.getUuid()) ? "1" : "0";
case "moderation_mute" -> FPlayerManager.getMUTED_PLAYERS().contains(fPlayer.getMinecraftName()) ? "1" : "0";
case "moderation_warn" -> String.valueOf(fPlayer.getCountWarns());
default -> null;
};
}

case "stream_prefix" -> fPlayer.getStreamPrefix();
case "afk_suffix" -> fPlayer.getAfkSuffix();
case "world_prefix" -> fPlayer.getWorldPrefix();
Expand Down

0 comments on commit e24dcd3

Please sign in to comment.