Allow Fabric
Dieser Commit ist enthalten in:
Ursprung
1e244ef067
Commit
d699f639ab
33
src/de/steamwar/bungeecore/Fabric.java
Normale Datei
33
src/de/steamwar/bungeecore/Fabric.java
Normale Datei
@ -0,0 +1,33 @@
|
|||||||
|
package de.steamwar.bungeecore;
|
||||||
|
|
||||||
|
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.api.plugin.Listener;
|
||||||
|
import net.md_5.bungee.event.EventHandler;
|
||||||
|
|
||||||
|
public class Fabric implements Listener {
|
||||||
|
|
||||||
|
@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;
|
||||||
|
//p.disconnect(BungeeCore.stringToText("§7Die Verwendung von Fabric ist auf §eSteam§8War §7nicht gestattet."));
|
||||||
|
Storage.fabricPlayers.add(p);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onDisconnect(PlayerDisconnectEvent e){
|
||||||
|
Storage.fabricPlayers.removeIf(player -> player == e.getPlayer());
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -49,6 +49,7 @@ public class Persistent extends Plugin {
|
|||||||
PluginUtils.loadPlugin(new File(getProxy().getPluginsFolder(), "BungeeCore.jar"));
|
PluginUtils.loadPlugin(new File(getProxy().getPluginsFolder(), "BungeeCore.jar"));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
getProxy().getPluginManager().unregisterListener(new Fabric());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -22,9 +22,7 @@ package de.steamwar.bungeecore;
|
|||||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||||
|
|
||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
import java.util.HashMap;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class Storage {
|
public class Storage {
|
||||||
private Storage(){}
|
private Storage(){}
|
||||||
@ -38,4 +36,6 @@ public class Storage {
|
|||||||
public static final Map<ProxiedPlayer, Timestamp> sessions = new HashMap<>(); // Contains session start timestamp
|
public static final Map<ProxiedPlayer, Timestamp> sessions = new HashMap<>(); // Contains session start timestamp
|
||||||
|
|
||||||
public static final Map<Integer, Subserver> eventServer = new HashMap<>(); // TeamID -> Subserver map
|
public static final Map<Integer, Subserver> eventServer = new HashMap<>(); // TeamID -> Subserver map
|
||||||
|
|
||||||
|
public static final Set<ProxiedPlayer> fabricPlayers = new HashSet<>();
|
||||||
}
|
}
|
||||||
|
@ -105,6 +105,10 @@ public class Subserver implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void sendPlayer(ProxiedPlayer p){
|
public void sendPlayer(ProxiedPlayer p){
|
||||||
|
if(type == Servertype.ARENA) {
|
||||||
|
p.sendMessage(Persistent.getPrefix() + "§cDu darfst mit Fabric nicht auf Arenen Server!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
if(!started){
|
if(!started){
|
||||||
p.sendMessage(Persistent.getPrefix() + "§7Der Server wird gestartet, einen Moment bitte...");
|
p.sendMessage(Persistent.getPrefix() + "§7Der Server wird gestartet, einen Moment bitte...");
|
||||||
cachedPlayers.add(p);
|
cachedPlayers.add(p);
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren