Support colors in PERMISSION-MESSAGE

This commit is contained in:
filoghost 2021-04-04 14:34:22 +02:00
parent 2ec403ba8e
commit b90fa741c5

View File

@ -6,18 +6,19 @@
package me.filoghost.chestcommands.attribute;
import me.filoghost.chestcommands.icon.InternalConfigurableIcon;
import me.filoghost.fcommons.Colors;
public class ClickPermissionMessageAttribute implements IconAttribute {
private final String clickPermissionMessage;
private final String message;
public ClickPermissionMessageAttribute(String clickPermissionMessage, AttributeErrorHandler errorHandler) {
this.clickPermissionMessage = clickPermissionMessage;
public ClickPermissionMessageAttribute(String serializedMessage, AttributeErrorHandler errorHandler) {
this.message = Colors.addColors(serializedMessage);
}
@Override
public void apply(InternalConfigurableIcon icon) {
icon.setNoClickPermissionMessage(clickPermissionMessage);
icon.setNoClickPermissionMessage(message);
}
}