mirror of
https://github.com/plexusorg/Module-Guilds.git
synced 2024-11-23 12:35:00 +00:00
i broke it this will need fixing
This commit is contained in:
parent
5e4cb5cd52
commit
edaa8f7614
@ -21,7 +21,6 @@ dependencies {
|
||||
compileOnly("io.papermc.paper:paper-api:1.19-R0.1-SNAPSHOT")
|
||||
implementation("org.apache.commons:commons-lang3:3.12.0")
|
||||
compileOnly("dev.plex:server:1.2-SNAPSHOT")
|
||||
compileOnly("dev.plex:api:1.2-SNAPSHOT")
|
||||
compileOnly("dev.morphia.morphia:morphia-core:2.2.7")
|
||||
compileOnly("org.json:json:20220320")
|
||||
implementation("org.jetbrains:annotations:23.0.0")
|
||||
|
@ -6,16 +6,11 @@ import dev.plex.data.SQLGuildManager;
|
||||
import dev.plex.data.SQLManager;
|
||||
import dev.plex.guild.Guild;
|
||||
import dev.plex.guild.GuildHolder;
|
||||
import dev.plex.handler.ChatHandlerImpl;
|
||||
import dev.plex.listener.impl.ChatListener;
|
||||
import dev.plex.module.PlexModule;
|
||||
import dev.plex.storage.StorageType;
|
||||
import dev.plex.util.PlexLog;
|
||||
import io.papermc.paper.event.player.AsyncChatEvent;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
//TODO: Implement mongodb
|
||||
@Getter
|
||||
public class Guilds extends PlexModule
|
||||
@ -55,7 +50,7 @@ public class Guilds extends PlexModule
|
||||
});
|
||||
}
|
||||
|
||||
Plex.get().setChatHandler(new ChatHandlerImpl());
|
||||
//Plex.get().setChat(new ChatHandlerImpl());
|
||||
|
||||
addDefaultMessage("guildsHelpCommand", "<gradient:gold:yellow>======</gradient>Guild Menu<gradient:gold:yellow>======</gradient><newline><newline>{0}", "0 - The commands list");
|
||||
addDefaultMessage("guildsCommandDisplay", "<gold>{0} <yellow>{1}", "0 - The command name", "1 - The command description");
|
||||
@ -99,7 +94,7 @@ public class Guilds extends PlexModule
|
||||
{
|
||||
// Unregistering listeners / commands is handled by Plex
|
||||
this.getGuildHolder().getGuilds().forEach(sqlGuildManager::updateGuild);
|
||||
this.getPlex().setChatHandler(new ChatListener.ChatHandlerImpl());
|
||||
//this.getPlex().setChat(new ChatListener.PlexChatRenderer());
|
||||
}
|
||||
|
||||
public static Guilds get()
|
||||
|
@ -2,14 +2,15 @@ package dev.plex.handler;
|
||||
|
||||
import dev.plex.Guilds;
|
||||
import dev.plex.Plex;
|
||||
import dev.plex.api.chat.IChatHandler;
|
||||
import dev.plex.cache.PlayerCache;
|
||||
import dev.plex.guild.data.Member;
|
||||
import dev.plex.player.PlexPlayer;
|
||||
import dev.plex.util.PlexUtils;
|
||||
import dev.plex.util.minimessage.SafeMiniMessage;
|
||||
import io.papermc.paper.chat.ChatRenderer;
|
||||
import io.papermc.paper.event.player.AsyncChatEvent;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import net.kyori.adventure.audience.Audience;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.TextReplacementConfig;
|
||||
@ -19,21 +20,17 @@ import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver;
|
||||
import net.kyori.adventure.text.minimessage.tag.standard.StandardTags;
|
||||
import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
public class ChatHandlerImpl implements IChatHandler
|
||||
public class ChatHandlerImpl
|
||||
{
|
||||
private final static TextReplacementConfig URL_REPLACEMENT_CONFIG = TextReplacementConfig.builder().match("(https?|ftp|file)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]").replacement((matchResult, builder) -> Component.empty().content(matchResult.group()).clickEvent(ClickEvent.openUrl(matchResult.group()))).build();
|
||||
private final PlexChatRenderer renderer = new PlexChatRenderer();
|
||||
|
||||
@Override
|
||||
@EventHandler
|
||||
public void doChat(AsyncChatEvent event)
|
||||
{
|
||||
event.renderer(renderer);
|
||||
|
Loading…
Reference in New Issue
Block a user