SteamWar/BungeeCore
Archiviert
13
2
Dieser Commit ist enthalten in:
Chaoscaot 2020-10-12 11:32:00 +02:00
Ursprung 13767c6d83
Commit 080fae613b
2 geänderte Dateien mit 54 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -22,6 +22,7 @@ package de.steamwar.bungeecore;
import de.steamwar.bungeecore.commands.*; import de.steamwar.bungeecore.commands.*;
import de.steamwar.bungeecore.comms.SpigotReceiver; import de.steamwar.bungeecore.comms.SpigotReceiver;
import de.steamwar.bungeecore.listeners.*; import de.steamwar.bungeecore.listeners.*;
import de.steamwar.bungeecore.listeners.mods.Fabric;
import de.steamwar.bungeecore.listeners.mods.Forge; import de.steamwar.bungeecore.listeners.mods.Forge;
import de.steamwar.bungeecore.listeners.mods.LabyMod; import de.steamwar.bungeecore.listeners.mods.LabyMod;
import de.steamwar.bungeecore.sql.SQL; import de.steamwar.bungeecore.sql.SQL;
@ -82,6 +83,7 @@ public class BungeeCore extends Plugin {
new ChatListener(); new ChatListener();
new BanListener(); new BanListener();
new CheckListener(); new CheckListener();
new Fabric();
commands.put("/b", null); commands.put("/b", null);
commands.put("/gs", null); commands.put("/gs", null);

Datei anzeigen

@ -0,0 +1,52 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bungeecore.listeners.mods;
import de.steamwar.bungeecore.Storage;
import de.steamwar.bungeecore.listeners.BasicListener;
import net.md_5.bungee.api.connection.Connection;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import net.md_5.bungee.api.event.PlayerDisconnectEvent;
import net.md_5.bungee.api.event.PluginMessageEvent;
import net.md_5.bungee.event.EventHandler;
public class Fabric extends BasicListener {
@EventHandler
public void onPluginMessageEvent(PluginMessageEvent e){
Connection sender = e.getSender();
if(!(sender instanceof ProxiedPlayer))
return;
if(!e.getTag().equals("minecraft:brand"))
return;
if(new String(e.getData()).contains("fabric")){
ProxiedPlayer p = (ProxiedPlayer) sender;
Storage.fabricPlayers.add(p);
}
}
@EventHandler
public void onDisconnect(PlayerDisconnectEvent e){
Storage.fabricPlayers.removeIf(player -> player == e.getPlayer());
}
}