diff --git a/src/de/steamwar/bungeecore/listeners/BrandListener.java b/src/de/steamwar/bungeecore/listeners/BrandListener.java index 6ff10e5..f34a59d 100644 --- a/src/de/steamwar/bungeecore/listeners/BrandListener.java +++ b/src/de/steamwar/bungeecore/listeners/BrandListener.java @@ -19,7 +19,6 @@ package de.steamwar.bungeecore.listeners; -import de.steamwar.bungeecore.BungeeCore; import de.steamwar.messages.ChatSender; import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBufAllocator; @@ -37,23 +36,17 @@ public class BrandListener extends BasicListener { return; } - if(event.getReceiver().getAddress().getHostName().contains("localhost")) { - return; - } - if (!(event.getReceiver() instanceof ProxiedPlayer)) { return; } event.setCancelled(true); - ProxyServer.getInstance().getScheduler().runAsync(BungeeCore.get(), () -> { - ProxiedPlayer player = (ProxiedPlayer) event.getReceiver(); - String brandString = ChatSender.of(player).parseToLegacy("STEAMWAR_BRAND", ProxyServer.getInstance().getName(), player.getServer().getInfo().getName(), new String(event.getData(), 1, event.getData().length - 1)); + ProxiedPlayer player = (ProxiedPlayer) event.getReceiver(); + String brandString = ChatSender.of(player).parseToLegacy("STEAMWAR_BRAND", ProxyServer.getInstance().getName(), player.getServer().getInfo().getName(), new String(event.getData(), 1, event.getData().length - 1)); - ByteBuf brand = ByteBufAllocator.DEFAULT.heapBuffer(); - DefinedPacket.writeString(brandString, brand); - player.sendData(event.getTag(), DefinedPacket.toArray(brand)); - brand.release(); - }); + ByteBuf brand = ByteBufAllocator.DEFAULT.heapBuffer(); + DefinedPacket.writeString(brandString, brand); + player.sendData(event.getTag(), DefinedPacket.toArray(brand)); + brand.release(); } }