mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-03 22:15:45 +00:00
Add per channel bungee toggle
This commit is contained in:
1 parent
c798208670
commit
cb060225f1
4 files changed
+25
-2
No files matched your search
@@ -42,6 +42,8 @@ public abstract class ChatChannel {
|
|||||||
*/
|
*/
|
||||||
public abstract boolean isIgnorable();
|
public abstract boolean isIgnorable();
|
||||||
|
|
||||||
|
public abstract boolean shouldBungee();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return The name of this channel.
|
* @return The name of this channel.
|
||||||
*/
|
*/
|
||||||
@@ -139,6 +141,7 @@ public abstract class ChatChannel {
|
|||||||
public abstract ChatChannel.Builder setToggleOffMessage(String toggleOffMessage);
|
public abstract ChatChannel.Builder setToggleOffMessage(String toggleOffMessage);
|
||||||
public abstract ChatChannel.Builder setToggleOnMessage(String toggleOnMessage);
|
public abstract ChatChannel.Builder setToggleOnMessage(String toggleOnMessage);
|
||||||
public abstract ChatChannel.Builder setShouldForwardFormatting(boolean forwardFormatting);
|
public abstract ChatChannel.Builder setShouldForwardFormatting(boolean forwardFormatting);
|
||||||
|
public abstract ChatChannel.Builder setShouldBungee(boolean shouldBungee);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -39,6 +39,7 @@ public class SimpleChatChannel extends ChatChannel {
|
|||||||
private String toggleOffMessage;
|
private String toggleOffMessage;
|
||||||
private String toggleOnMessage;
|
private String toggleOnMessage;
|
||||||
private boolean forwardFormatting;
|
private boolean forwardFormatting;
|
||||||
|
private boolean shouldBungee;
|
||||||
|
|
||||||
private DiscordWebhook discordWebhook = null;
|
private DiscordWebhook discordWebhook = null;
|
||||||
|
|
||||||
@@ -46,7 +47,7 @@ public class SimpleChatChannel extends ChatChannel {
|
|||||||
|
|
||||||
private SimpleChatChannel() { }
|
private SimpleChatChannel() { }
|
||||||
|
|
||||||
SimpleChatChannel(TextColor color, long id, Map<String, String> formats, String webhook, boolean isDefault, boolean ignorable, String name, double distance, String switchMessage, String toggleOffMessage, String toggleOnMessage, boolean forwardFormatting, SimpleChat simpleChat) {
|
SimpleChatChannel(TextColor color, long id, Map<String, String> formats, String webhook, boolean isDefault, boolean ignorable, String name, double distance, String switchMessage, String toggleOffMessage, String toggleOnMessage, boolean forwardFormatting, boolean shouldBungee, SimpleChat simpleChat) {
|
||||||
this.color = color;
|
this.color = color;
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.formats = formats;
|
this.formats = formats;
|
||||||
@@ -59,6 +60,7 @@ public class SimpleChatChannel extends ChatChannel {
|
|||||||
this.toggleOffMessage = toggleOffMessage;
|
this.toggleOffMessage = toggleOffMessage;
|
||||||
this.toggleOnMessage = toggleOnMessage;
|
this.toggleOnMessage = toggleOnMessage;
|
||||||
this.forwardFormatting = forwardFormatting;
|
this.forwardFormatting = forwardFormatting;
|
||||||
|
this.shouldBungee = shouldBungee;
|
||||||
|
|
||||||
this.simpleChat = simpleChat;
|
this.simpleChat = simpleChat;
|
||||||
|
|
||||||
@@ -277,6 +279,11 @@ public class SimpleChatChannel extends ChatChannel {
|
|||||||
return ignorable;
|
return ignorable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldBungee() {
|
||||||
|
return shouldBungee;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
@@ -325,6 +332,7 @@ public class SimpleChatChannel extends ChatChannel {
|
|||||||
private String toggleOffMessage = "<gray>You can no longer see <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 String toggleOnMessage = "<gray>You can now see <color><channel> <gray>chat!";
|
||||||
private boolean forwardFormatting = true;
|
private boolean forwardFormatting = true;
|
||||||
|
private boolean shouldBungee = false;
|
||||||
|
|
||||||
private Builder() { }
|
private Builder() { }
|
||||||
|
|
||||||
@@ -334,7 +342,7 @@ public class SimpleChatChannel extends ChatChannel {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SimpleChatChannel build(SimpleChat simpleChat) {
|
public SimpleChatChannel build(SimpleChat simpleChat) {
|
||||||
return new SimpleChatChannel(color, id, formats, webhook, isDefault, ignorable, name, distance, switchMessage, toggleOffMessage, toggleOnMessage, forwardFormatting, simpleChat);
|
return new SimpleChatChannel(color, id, formats, webhook, isDefault, ignorable, name, distance, switchMessage, toggleOffMessage, toggleOnMessage, forwardFormatting, shouldBungee, simpleChat);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -425,6 +433,13 @@ public class SimpleChatChannel extends ChatChannel {
|
|||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Builder setShouldBungee(boolean shouldBungee) {
|
||||||
|
this.shouldBungee = shouldBungee;
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -97,6 +97,10 @@ public class ChannelManager {
|
|||||||
builder.setShouldForwardFormatting(section.getBoolean("forward-format"));
|
builder.setShouldForwardFormatting(section.getBoolean("forward-format"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (section.contains("should-bungee")) {
|
||||||
|
builder.setShouldBungee(section.getBoolean("should-bungee"));
|
||||||
|
}
|
||||||
|
|
||||||
ChatChannel channel = builder.build(simpleChat);
|
ChatChannel channel = builder.build(simpleChat);
|
||||||
|
|
||||||
if (channel.isTownChat() || channel.isNationChat() || channel.isAllianceChat()) {
|
if (channel.isTownChat() || channel.isNationChat() || channel.isAllianceChat()) {
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ channels:
|
|||||||
ignorable: true # Removing this option defaults to 'true'
|
ignorable: true # Removing this option defaults to 'true'
|
||||||
distance: -1 # Set to -1, comment out, or remove to disable distance checking
|
distance: -1 # Set to -1, comment out, or remove to disable distance checking
|
||||||
forward-format: true # Removing this option defaults to 'true'. Forces all other servers to use this server's formatting for this channel.
|
forward-format: true # Removing this option defaults to 'true'. Forces all other servers to use this server's formatting for this channel.
|
||||||
|
should-bungee: true # Removing this option defaults to 'false'. Enables/disables cross server chat for this channel.
|
||||||
|
|
||||||
bot-token: -1
|
bot-token: -1
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user