mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-04 14:38:49 +00:00
Remove replacements feature (use filters instead)
This commit is contained in:
1 parent
f22003b6e0
commit
6af75c8e86
3 files changed
+1
-23
No files matched your search
@@ -84,7 +84,7 @@ public final class CarbonChat extends JavaPlugin {
|
|||||||
pluginManager.registerEvents(new LegacyFormatHandler(), this);
|
pluginManager.registerEvents(new LegacyFormatHandler(), this);
|
||||||
pluginManager.registerEvents(new OfflineNameHandler(), this);
|
pluginManager.registerEvents(new OfflineNameHandler(), this);
|
||||||
pluginManager.registerEvents(new PingHandler(this), this);
|
pluginManager.registerEvents(new PingHandler(this), this);
|
||||||
pluginManager.registerEvents(new PlaceholderHandler(this), this);
|
pluginManager.registerEvents(new PlaceholderHandler(), this);
|
||||||
pluginManager.registerEvents(new PlayerJoinListener(this), this);
|
pluginManager.registerEvents(new PlayerJoinListener(this), this);
|
||||||
pluginManager.registerEvents(new UserFormattingListener(), this);
|
pluginManager.registerEvents(new UserFormattingListener(), this);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,32 +1,13 @@
|
|||||||
package net.draycia.carbon.listeners;
|
package net.draycia.carbon.listeners;
|
||||||
|
|
||||||
import me.clip.placeholderapi.PlaceholderAPI;
|
import me.clip.placeholderapi.PlaceholderAPI;
|
||||||
import net.draycia.carbon.CarbonChat;
|
|
||||||
import net.draycia.carbon.events.ChatFormatEvent;
|
import net.draycia.carbon.events.ChatFormatEvent;
|
||||||
import org.bukkit.configuration.ConfigurationSection;
|
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
|
|
||||||
public class PlaceholderHandler implements Listener {
|
public class PlaceholderHandler implements Listener {
|
||||||
|
|
||||||
private final CarbonChat carbonChat;
|
|
||||||
|
|
||||||
public PlaceholderHandler(CarbonChat carbonChat) {
|
|
||||||
this.carbonChat = carbonChat;
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.LOWEST)
|
|
||||||
public void onChatPlaceholder(ChatFormatEvent event) {
|
|
||||||
ConfigurationSection replacements = carbonChat.getConfig().getConfigurationSection("replacements");
|
|
||||||
|
|
||||||
if (replacements != null) {
|
|
||||||
for (String key : replacements.getKeys(false)) {
|
|
||||||
event.setMessage(event.getMessage().replace(key, replacements.getString(key)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.LOWEST)
|
@EventHandler(priority = EventPriority.LOWEST)
|
||||||
public void onPapiPlaceholder(ChatFormatEvent event) {
|
public void onPapiPlaceholder(ChatFormatEvent event) {
|
||||||
event.setFormat(PlaceholderAPI.setPlaceholders(event.getUser().asOfflinePlayer(), event.getFormat()));
|
event.setFormat(PlaceholderAPI.setPlaceholders(event.getUser().asOfflinePlayer(), event.getFormat()));
|
||||||
|
|||||||
@@ -61,9 +61,6 @@ channels:
|
|||||||
ignorable: false
|
ignorable: false
|
||||||
should-bungee: false
|
should-bungee: false
|
||||||
|
|
||||||
replacements:
|
|
||||||
'%shrug%': '¯\_(ツ)_/¯'
|
|
||||||
|
|
||||||
# Options:
|
# Options:
|
||||||
# 'MiniMessage': https://github.com/KyoriPowered/adventure-docs/blob/feature/minimessage/source/minimessage.rst#the-components
|
# 'MiniMessage': https://github.com/KyoriPowered/adventure-docs/blob/feature/minimessage/source/minimessage.rst#the-components
|
||||||
# 'MiniMessage-Markdown': https://github.com/KyoriPowered/adventure-docs/blob/feature/minimessage/source/minimessage.rst#markdown
|
# 'MiniMessage-Markdown': https://github.com/KyoriPowered/adventure-docs/blob/feature/minimessage/source/minimessage.rst#markdown
|
||||||
|
|||||||
Reference in new issue
Block a user