mirror of
				https://github.com/IntellectualSites/PlotSquared.git
				synced 2025-11-04 03:03:43 +01:00 
			
		
		
		
	Forgot to push this
This commit is contained in:
		@@ -0,0 +1,54 @@
 | 
			
		||||
package com.intellectualcrafters.plot.object;
 | 
			
		||||
 | 
			
		||||
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) {
 | 
			
		||||
        ChatManager.manager.color(this, color);
 | 
			
		||||
        return this;
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    public void send(PlotPlayer player) {
 | 
			
		||||
        ChatManager.manager.send(this, player);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,22 @@
 | 
			
		||||
package com.intellectualcrafters.plot.util;
 | 
			
		||||
 | 
			
		||||
import com.intellectualcrafters.plot.object.PlotMessage;
 | 
			
		||||
import com.intellectualcrafters.plot.object.PlotPlayer;
 | 
			
		||||
 | 
			
		||||
public abstract class ChatManager<T> {
 | 
			
		||||
    public static ChatManager<?> manager;
 | 
			
		||||
    
 | 
			
		||||
    public abstract T builder();
 | 
			
		||||
    
 | 
			
		||||
    public abstract void color(PlotMessage message, String color);
 | 
			
		||||
    
 | 
			
		||||
    public abstract void tooltip(PlotMessage message, PlotMessage... tooltip);
 | 
			
		||||
    
 | 
			
		||||
    public abstract void command(PlotMessage message, String command);
 | 
			
		||||
    
 | 
			
		||||
    public abstract void text(PlotMessage message, String text);
 | 
			
		||||
 | 
			
		||||
    public abstract void send(PlotMessage plotMessage, PlotPlayer player);
 | 
			
		||||
 | 
			
		||||
    public abstract void suggest(PlotMessage plotMessage, String command);
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user