From 8708b694dadbaaff3e5ebc67c6a748f1f1c27a54 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Tue, 22 Sep 2020 13:38:30 +0200 Subject: [PATCH] Code Cleanup --- src/de/steamwar/bungeecore/comms/SpigotReceiver.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/de/steamwar/bungeecore/comms/SpigotReceiver.java b/src/de/steamwar/bungeecore/comms/SpigotReceiver.java index d747d154..9a8da48a 100644 --- a/src/de/steamwar/bungeecore/comms/SpigotReceiver.java +++ b/src/de/steamwar/bungeecore/comms/SpigotReceiver.java @@ -37,8 +37,10 @@ public class SpigotReceiver extends BasicListener { public void onPluginMessage(PluginMessageEvent event) { if(!event.getTag().equalsIgnoreCase("sw:bridge")) return; - if(!event.getSender().getAddress().getHostName().equals("localhost")) + if(!event.getSender().getAddress().getHostName().equals("localhost")){ + event.setCancelled(true); return; + } ByteArrayDataInput in = ByteStreams.newDataInput(event.getData()); Byte handler = in.readByte(); handlerMap.get(handler).handle(in);