Archived
0

Fixed expired message not being printed

This commit is contained in:
BuildTools 2017-07-25 15:07:51 +02:00
parent 508aceb717
commit f051852d44

View File

@ -2,6 +2,8 @@ package net.nemez.chatapi.click;
import org.bukkit.command.CommandSender;
import net.nemez.chatapi.ChatAPI;
public abstract class ClickCallback {
private boolean repeatable, async;
@ -11,7 +13,7 @@ public abstract class ClickCallback {
public ClickCallback(boolean repeatable, boolean async, String expiredMessage) {
this.repeatable = repeatable;
this.async = async;
this.expiredMessage = expiredMessage;
this.expiredMessage = ChatAPI.colorify(null, expiredMessage);
this.expired = false;
}
@ -20,6 +22,10 @@ public abstract class ClickCallback {
public final void execute(CommandSender sender) {
if (!expired) {
run(sender);
}else{
if (sender != null) {
sender.sendMessage(expiredMessage);
}
}
if (!repeatable) {
expired = true;