SteamWar/BungeeCore
Archiviert
13
2

Speed BrandListener up
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
yoyosource 2022-04-27 10:06:44 +02:00
Ursprung 07da2c56a3
Commit d4a50d3974

Datei anzeigen

@ -47,17 +47,21 @@ public class BrandListener extends BasicListener {
@EventHandler @EventHandler
public void onServerSwitch(PluginMessageEvent event) { public void onServerSwitch(PluginMessageEvent event) {
long time = System.currentTimeMillis();
if(!event.getTag().equals("minecraft:brand") && !event.getTag().equals("MC|Brand")) { if(!event.getTag().equals("minecraft:brand") && !event.getTag().equals("MC|Brand")) {
return; return;
} }
System.out.println("TIME Check brand: " + (System.currentTimeMillis() - time));
if (isLocalHost(event.getReceiver().getAddress().getAddress())) { if (isLocalHost(event.getReceiver().getAddress().getAddress())) {
return; return;
} }
System.out.println("TIME Check localhost: " + (System.currentTimeMillis() - time));
if (!(event.getReceiver() instanceof ProxiedPlayer)) { if (!(event.getReceiver() instanceof ProxiedPlayer)) {
return; return;
} }
System.out.println("TIME Was proxiedplayer: " + (System.currentTimeMillis() - time));
event.setCancelled(true); event.setCancelled(true);
ProxiedPlayer player = (ProxiedPlayer) event.getReceiver(); ProxiedPlayer player = (ProxiedPlayer) event.getReceiver();
@ -67,5 +71,6 @@ public class BrandListener extends BasicListener {
DefinedPacket.writeString(brandString, brand); DefinedPacket.writeString(brandString, brand);
player.sendData(event.getTag(), DefinedPacket.toArray(brand)); player.sendData(event.getTag(), DefinedPacket.toArray(brand));
brand.release(); brand.release();
System.out.println("TIME finish: " + (System.currentTimeMillis() - time));
} }
} }