mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-02 14:38:49 +00:00
bug fixes btw
This commit is contained in:
1 parent
b4b5989a23
commit
d6972528ab
12 files changed
+60
-56
No files matched your search
@@ -58,6 +58,10 @@ public class CarbonChatChannel extends ChatChannel {
|
||||
|
||||
@Override
|
||||
public void sendMessage(ChatUser user, String message, boolean fromBungee) {
|
||||
if (user.isOnline()) {
|
||||
user.asPlayer().setDisplayName(user.getNickname());
|
||||
}
|
||||
|
||||
// Get player's formatting
|
||||
String messageFormat = getFormat(user);
|
||||
|
||||
@@ -66,7 +70,7 @@ public class CarbonChatChannel extends ChatChannel {
|
||||
|
||||
Bukkit.getPluginManager().callEvent(formatEvent);
|
||||
|
||||
if (formatEvent.isCancelled()) {
|
||||
if (formatEvent.isCancelled() || formatEvent.getMessage().isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ public class ChannelCommand extends BaseCommand {
|
||||
@CommandPermission("carbonchat.switch.others")
|
||||
@Subcommand("other")
|
||||
@CommandCompletion("@chatchannel @players")
|
||||
public void baseCommand(CommandSender sender, ChatChannel channel, ChatUser user) {
|
||||
public void baseCommand(CommandSender sender, @Conditions("exists:true") ChatChannel channel, ChatUser user) {
|
||||
user.setSelectedChannel(channel);
|
||||
|
||||
String message = channel.getSwitchMessage();
|
||||
|
||||
@@ -8,10 +8,8 @@ public class UserFormattingListener implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onFormat(ChatFormatEvent event) {
|
||||
if (event.getUser().isOnline() && event.getUser().asPlayer().hasPermission("carbonchat.formatting")) {
|
||||
event.setFormat(event.getFormat()
|
||||
.replace("<pre><message></pre>", "<message>")
|
||||
.replace("<pre><message>", "<message>")
|
||||
if (!event.getUser().isOnline() || !event.getUser().asPlayer().hasPermission("carbonchat.formatting")) {
|
||||
event.setFormat(event.getFormat().replace("<message>", "<pre><message></pre>")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user