forked from Upstream/CommandPanels
Merge pull request #254 from TheLonelyWolf1/master
Added Config-Option to enable MiniMessage-CommandTag on Non-Paper forks + Warning
This commit is contained in:
commit
978c745d00
@ -18,6 +18,8 @@ config:
|
||||
stop-sound: true
|
||||
disabled-world-message: true
|
||||
panel-snooper: false
|
||||
allow-unsafe-mini-message: false
|
||||
disable-unsafe-mm-warning: false
|
||||
format:
|
||||
tag: '&6[&bCommandPanels&6] '
|
||||
perms: '&cNo permission.'
|
||||
|
@ -272,6 +272,9 @@ public class CommandPanels extends JavaPlugin{
|
||||
|
||||
//get tag
|
||||
tag = tex.colour(config.getString("config.format.tag"));
|
||||
if(config.getBoolean("config.allow-unsafe-mini-message") && !config.getBoolean("config.disable-unsafe-mm-warning")){
|
||||
Bukkit.getLogger().warning("[CommandPanels] Allow unsafe MiniMessage detected! Please proceed with caution as no support will be given for it!");
|
||||
}
|
||||
|
||||
Bukkit.getLogger().info("[CommandPanels] RockyHawk's CommandPanels v" + this.getDescription().getVersion() + " Plugin Loaded!");
|
||||
}
|
||||
|
@ -142,7 +142,13 @@ public class BasicTags implements Listener {
|
||||
Component parsedText = SerializerUtils.serializeText(String.join(" ",e.args));
|
||||
player.sendMessage(parsedText);
|
||||
}else{
|
||||
plugin.tex.sendString(e.p, plugin.tag + ChatColor.RED + "MiniMessage-Feature needs Paper 1.18 or newer to work!");
|
||||
if(plugin.legacy.LOCAL_VERSION.greaterThanOrEqualTo(MinecraftVersions.v1_18) && plugin.config.getBoolean("config.allow-unsafe-mini-message")){
|
||||
Audience player = (Audience) e.p; // Needed because the basic Player from the Event can't send Paper's Components
|
||||
Component parsedText = SerializerUtils.serializeText(String.join(" ",e.args));
|
||||
player.sendMessage(parsedText);
|
||||
}else{
|
||||
plugin.tex.sendString(e.p, plugin.tag + ChatColor.RED + "MiniMessage-Feature needs Paper 1.18 or newer to work!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user