mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-02 06:28:54 +00:00
Fixes round 3000
This commit is contained in:
1 parent
58477c0b6a
commit
569cd78748
15 files changed
+583
-54
No files matched your search
@@ -5,9 +5,11 @@ import com.palmergames.bukkit.towny.exceptions.NotRegisteredException;
|
||||
import com.palmergames.bukkit.towny.object.Nation;
|
||||
import com.palmergames.bukkit.towny.object.Resident;
|
||||
import net.draycia.simplechat.SimpleChat;
|
||||
import net.draycia.simplechat.channels.ChatChannel;
|
||||
import net.draycia.simplechat.storage.ChatUser;
|
||||
import net.kyori.adventure.text.format.TextColor;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class NationChatChannel extends SimpleChatChannel {
|
||||
@@ -54,9 +56,141 @@ public class NationChatChannel extends SimpleChatChannel {
|
||||
return new NationChatChannel.Builder(name);
|
||||
}
|
||||
|
||||
public static class Builder extends SimpleChatChannel.Builder {
|
||||
private Builder(String name) {
|
||||
super(name);
|
||||
public static class Builder extends ChatChannel.Builder {
|
||||
|
||||
private TextColor color = TextColor.of(255, 255, 255);
|
||||
private long id = -1;
|
||||
private Map<String, String> formats = new HashMap<>();
|
||||
private String webhook = null;
|
||||
private boolean isDefault = false;
|
||||
private boolean ignorable = true;
|
||||
private String name;
|
||||
private double distance = -1;
|
||||
private String switchMessage = "<gray>You are now in <color><channel> <gray>chat!";
|
||||
private String toggleOffMessage = "<gray>You can no longer see <color><channel> <gray>chat!";
|
||||
private String toggleOnMessage = "<gray>You can now see <color><channel> <gray>chat!";
|
||||
private boolean forwardFormatting = true;
|
||||
private boolean shouldBungee = false;
|
||||
private boolean filterEnabled = true;
|
||||
private boolean firstMatchingGroup = false;
|
||||
|
||||
Builder(String name) {
|
||||
this.name = name.toLowerCase();
|
||||
}
|
||||
|
||||
@Override
|
||||
public NationChatChannel build(SimpleChat simpleChat) {
|
||||
return new NationChatChannel(color, id, formats, webhook, isDefault, ignorable, name, distance, switchMessage, toggleOffMessage, toggleOnMessage, forwardFormatting, shouldBungee, filterEnabled, firstMatchingGroup, simpleChat);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NationChatChannel.Builder setColor(TextColor color) {
|
||||
this.color = color;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NationChatChannel.Builder setColor(String color) {
|
||||
return setColor(TextColor.fromHexString(color));
|
||||
}
|
||||
|
||||
@Override
|
||||
public NationChatChannel.Builder setId(long id) {
|
||||
this.id = id;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NationChatChannel.Builder setFormats(Map<String, String> formats) {
|
||||
this.formats = formats;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NationChatChannel.Builder setWebhook(String webhook) {
|
||||
this.webhook = webhook;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NationChatChannel.Builder setIsDefault(boolean aDefault) {
|
||||
this.isDefault = aDefault;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NationChatChannel.Builder setIgnorable(boolean ignorable) {
|
||||
this.ignorable = ignorable;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NationChatChannel.Builder setName(String name) {
|
||||
this.name = name;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NationChatChannel.Builder setDistance(double distance) {
|
||||
this.distance = distance;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NationChatChannel.Builder setSwitchMessage(String switchMessage) {
|
||||
this.switchMessage = switchMessage;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NationChatChannel.Builder setToggleOffMessage(String toggleOffMessage) {
|
||||
this.toggleOffMessage = toggleOffMessage;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NationChatChannel.Builder setToggleOnMessage(String toggleOnMessage) {
|
||||
this.toggleOnMessage = toggleOnMessage;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NationChatChannel.Builder setShouldForwardFormatting(boolean forwardFormatting) {
|
||||
this.forwardFormatting = forwardFormatting;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NationChatChannel.Builder setShouldBungee(boolean shouldBungee) {
|
||||
this.shouldBungee = shouldBungee;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NationChatChannel.Builder setFilterEnabled(boolean filterEnabled) {
|
||||
this.filterEnabled = filterEnabled;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NationChatChannel.Builder setFirstMatchingGroup(boolean firstMatchingGroup) {
|
||||
this.firstMatchingGroup = firstMatchingGroup;
|
||||
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user