Dieser Commit ist enthalten in:
Ursprung
527b1aee45
Commit
7ff4dbf44b
31
src/de/steamwar/bungeecore/commands/ToggleLocalChatCommand.java
Normale Datei
31
src/de/steamwar/bungeecore/commands/ToggleLocalChatCommand.java
Normale Datei
@ -0,0 +1,31 @@
|
|||||||
|
package de.steamwar.bungeecore.commands;
|
||||||
|
|
||||||
|
import de.steamwar.command.SWCommand;
|
||||||
|
import de.steamwar.messages.ChatSender;
|
||||||
|
import lombok.Getter;
|
||||||
|
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class ToggleLocalChatCommand extends SWCommand {
|
||||||
|
@Getter private static List<ProxiedPlayer> inLocalChat;
|
||||||
|
|
||||||
|
protected ToggleLocalChatCommand() {
|
||||||
|
super("localtoggle", null, "togglelocal", "lt");
|
||||||
|
inLocalChat = new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Register
|
||||||
|
public void toggleLocalChat(ProxiedPlayer player) {
|
||||||
|
if (inLocalChat.contains(player)) {
|
||||||
|
inLocalChat.remove(player);
|
||||||
|
ChatSender.of(player).system("LOCALTOGGLE_OFF");
|
||||||
|
} else {
|
||||||
|
inLocalChat.add(player);
|
||||||
|
ChatSender.of(player).system("LOCALTOGGLE_ON");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Ich habe keine ahnung ob ich das richtig mache
|
||||||
|
}
|
@ -21,6 +21,7 @@ package de.steamwar.bungeecore.listeners;
|
|||||||
|
|
||||||
import de.steamwar.bungeecore.*;
|
import de.steamwar.bungeecore.*;
|
||||||
import de.steamwar.bungeecore.bot.SteamwarDiscordBot;
|
import de.steamwar.bungeecore.bot.SteamwarDiscordBot;
|
||||||
|
import de.steamwar.bungeecore.commands.ToggleLocalChatCommand;
|
||||||
import de.steamwar.bungeecore.network.NetworkSender;
|
import de.steamwar.bungeecore.network.NetworkSender;
|
||||||
import de.steamwar.bungeecore.sql.*;
|
import de.steamwar.bungeecore.sql.*;
|
||||||
import de.steamwar.bungeecore.util.Chat19;
|
import de.steamwar.bungeecore.util.Chat19;
|
||||||
@ -69,7 +70,7 @@ public class ChatListener extends BasicListener {
|
|||||||
Subserver subserver = Subserver.getSubserver(player);
|
Subserver subserver = Subserver.getSubserver(player);
|
||||||
if(subserver != null && subserver.getType() == Servertype.ARENA && subserver.getServer() == player.getServer().getInfo()) {
|
if(subserver != null && subserver.getType() == Servertype.ARENA && subserver.getServer() == player.getServer().getInfo()) {
|
||||||
localChat(player, message);
|
localChat(player, message);
|
||||||
} else if (message.startsWith("+")) {
|
} else if (message.startsWith("+") || ToggleLocalChatCommand.getInLocalChat().contains(player)) {
|
||||||
localChat(player, message.substring(1));
|
localChat(player, message.substring(1));
|
||||||
} else {
|
} else {
|
||||||
sendChat(ChatSender.of(player), ChatSender.globalReceivers(), "CHAT_GLOBAL", null, message);
|
sendChat(ChatSender.of(player), ChatSender.globalReceivers(), "CHAT_GLOBAL", null, message);
|
||||||
|
@ -660,3 +660,7 @@ ADVENT_CALENDAR_DAY=§7Day§8: §e{0}
|
|||||||
ADVENT_CALENDAR_MESSAGE=§eDid you already open your advent calendar?
|
ADVENT_CALENDAR_MESSAGE=§eDid you already open your advent calendar?
|
||||||
ADVENT_CALENDAR_MESSAGE_HOVER=§eClick to open!
|
ADVENT_CALENDAR_MESSAGE_HOVER=§eClick to open!
|
||||||
ADVENT_CALENDAR_OPEN=§7You got §e{0} §7from the advent calendar!
|
ADVENT_CALENDAR_OPEN=§7You got §e{0} §7from the advent calendar!
|
||||||
|
|
||||||
|
# Toggle Local Chat
|
||||||
|
LOCALTOGGLE_ON=§7You toggled §alocal §7chat.
|
||||||
|
LOCALTOGGLE_OFF=§7You toggled §aglobal §7chat.
|
||||||
|
@ -636,3 +636,7 @@ ADVENT_CALENDAR_DAY=§7Tag§8: §e{0}
|
|||||||
ADVENT_CALENDAR_MESSAGE=§eHast du heute schon dein Geschenk geholt?
|
ADVENT_CALENDAR_MESSAGE=§eHast du heute schon dein Geschenk geholt?
|
||||||
ADVENT_CALENDAR_MESSAGE_HOVER=§eKlicken zum öffnen!
|
ADVENT_CALENDAR_MESSAGE_HOVER=§eKlicken zum öffnen!
|
||||||
ADVENT_CALENDAR_OPEN=§7Du hast §e{0}§7 aus dem Adventskalender erhalten!
|
ADVENT_CALENDAR_OPEN=§7Du hast §e{0}§7 aus dem Adventskalender erhalten!
|
||||||
|
|
||||||
|
# Toggle Local Chat
|
||||||
|
LOCALTOGGLE_ON=§7Du bist jetzt im §aLokalen §7Chat.
|
||||||
|
LOCALTOGGLE_OFF=§7Du bist jetzt im §aGlobalen §7Chat.
|
In neuem Issue referenzieren
Einen Benutzer sperren