Moved everything for Channel.java
This commit is contained in:
parent
e2698179c7
commit
8dfea2032f
6 changed files with 103 additions and 0 deletions
36
src/main/java/buttondevteam/lib/chat/Channel.java
Normal file
36
src/main/java/buttondevteam/lib/chat/Channel.java
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
package buttondevteam.lib.chat;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class Channel {
|
||||||
|
public final String DisplayName;
|
||||||
|
public final Color color;
|
||||||
|
public final String Command;
|
||||||
|
|
||||||
|
private static List<Channel> channels = new ArrayList<>();
|
||||||
|
|
||||||
|
public Channel(String displayname, Color color, String command) {
|
||||||
|
DisplayName = displayname;
|
||||||
|
this.color = color;
|
||||||
|
Command = command;
|
||||||
|
}
|
||||||
|
|
||||||
|
static {
|
||||||
|
channels.add(GlobalChat = new Channel("§fg§f", Color.White, "g"));
|
||||||
|
channels.add(TownChat = new Channel("§3TC§f", Color.DarkAqua, "tc"));
|
||||||
|
channels.add(NationChat = new Channel("§6NC§f", Color.Gold, "nc"));
|
||||||
|
channels.add(AdminChat = new Channel("§cADMIN§f", Color.Red, "a"));
|
||||||
|
channels.add(ModChat = new Channel("§9MOD§f", Color.Blue, "mod"));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<Channel> getChannels() {
|
||||||
|
return channels;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Channel GlobalChat;
|
||||||
|
public static Channel TownChat;
|
||||||
|
public static Channel NationChat;
|
||||||
|
public static Channel AdminChat;
|
||||||
|
public static Channel ModChat;
|
||||||
|
}
|
19
src/main/java/buttondevteam/lib/chat/Color.java
Normal file
19
src/main/java/buttondevteam/lib/chat/Color.java
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
package buttondevteam.lib.chat;
|
||||||
|
|
||||||
|
public enum Color implements TellrawSerializableEnum {
|
||||||
|
Black("black"), DarkBlue("dark_blue"), DarkGreen("dark_green"), DarkAqua("dark_aqua"), DarkRed(
|
||||||
|
"dark_red"), DarkPurple("dark_purple"), Gold("gold"), Gray("gray"), DarkGray("dark_gray"), Blue(
|
||||||
|
"blue"), Green("green"), Aqua("aqua"), Red(
|
||||||
|
"red"), LightPurple("light_purple"), Yellow("yellow"), White("white"), RPC("rpc");
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
Color(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
}
|
24
src/main/java/buttondevteam/lib/chat/Format.java
Normal file
24
src/main/java/buttondevteam/lib/chat/Format.java
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
package buttondevteam.lib.chat;
|
||||||
|
|
||||||
|
public enum Format implements TellrawSerializableEnum {
|
||||||
|
Bold("bold"), Underlined("underlined"), Italic("italic"), Strikethrough("strikethrough"), Obfuscated(
|
||||||
|
"obfuscated");
|
||||||
|
// TODO: Add format codes to /u c <mode>
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
Format(String name) {
|
||||||
|
this.name = name;
|
||||||
|
this.flag = 1 << this.ordinal();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
private final int flag;
|
||||||
|
|
||||||
|
public int getFlag() {
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
}
|
14
src/main/java/buttondevteam/lib/chat/Priority.java
Normal file
14
src/main/java/buttondevteam/lib/chat/Priority.java
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
package buttondevteam.lib.chat;
|
||||||
|
|
||||||
|
public enum Priority {
|
||||||
|
Low(0), Normal(1), High(2);
|
||||||
|
private int val;
|
||||||
|
|
||||||
|
Priority(int v) {
|
||||||
|
val = v;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int GetValue() {
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
}
|
|
@ -6,6 +6,7 @@ import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
import org.reflections.Reflections;
|
import org.reflections.Reflections;
|
||||||
import org.reflections.scanners.SubTypesScanner;
|
import org.reflections.scanners.SubTypesScanner;
|
||||||
|
@ -160,4 +161,8 @@ public class TBMCChatAPI {
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void SendChatMessage(Channel channel, CommandSender sender, String message) {
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
package buttondevteam.lib.chat;
|
||||||
|
|
||||||
|
public interface TellrawSerializableEnum {
|
||||||
|
public String getName();
|
||||||
|
}
|
Loading…
Reference in a new issue