mirror of
https://gitlab.com/phoenix-dvpmt/mmocore.git
synced 2024-11-27 00:45:40 +01:00
add color support for message triggers
This commit is contained in:
parent
b19ee4dc2f
commit
2db9606083
@ -1,5 +1,6 @@
|
||||
package net.Indyuce.mmocore.api.quest.trigger;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import net.Indyuce.mmocore.MMOCore;
|
||||
@ -7,7 +8,7 @@ import net.Indyuce.mmocore.api.load.MMOLineConfig;
|
||||
import net.Indyuce.mmocore.api.player.PlayerData;
|
||||
|
||||
public class MessageTrigger extends Trigger {
|
||||
private final String message;
|
||||
private String message;
|
||||
|
||||
public MessageTrigger(MMOLineConfig config) {
|
||||
super(config);
|
||||
@ -22,6 +23,7 @@ public class MessageTrigger extends Trigger {
|
||||
}
|
||||
|
||||
private String format(Player player) {
|
||||
message = ChatColor.translateAlternateColorCodes('&', message);
|
||||
return MMOCore.plugin.placeholderParser.parse(player, message.replace("%player%", player.getName()));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user