PlotSquared/src/main/java/com/intellectualcrafters/plot/object/PlotMessage.java

56 lines
1.3 KiB
Java
Raw Normal View History

2015-08-26 00:35:32 +02:00
package com.intellectualcrafters.plot.object;
2015-08-29 10:47:56 +02:00
import com.intellectualcrafters.plot.config.C;
2015-08-26 00:35:32 +02:00
import com.intellectualcrafters.plot.util.ChatManager;
public class PlotMessage {
private Object builder;
public PlotMessage() {
this.builder = ChatManager.manager.builder();
}
public <T> T $(ChatManager<T> manager) {
return (T) builder;
}
public PlotMessage(String text) {
this();
text(text);
}
public PlotMessage text(String text) {
ChatManager.manager.text(this, text);
return this;
}
public PlotMessage tooltip(PlotMessage... tooltip) {
ChatManager.manager.tooltip(this, tooltip);
return this;
}
public PlotMessage tooltip(String tooltip) {
return tooltip(new PlotMessage(tooltip));
}
public PlotMessage command(String command) {
ChatManager.manager.command(this, command);
return this;
}
public PlotMessage suggest(String command) {
ChatManager.manager.suggest(this, command);
return this;
}
public PlotMessage color(String color) {
2015-08-29 10:47:56 +02:00
ChatManager.manager.color(this, C.color(color));
2015-08-26 00:35:32 +02:00
return this;
}
public void send(PlotPlayer player) {
ChatManager.manager.send(this, player);
}
}