From 29c5b656756838c4881be217b022937a8ba5fa2a Mon Sep 17 00:00:00 2001 From: turikhay Date: Wed, 7 Sep 2022 14:06:57 +0300 Subject: [PATCH] Restrict WorldIdHandler to only send the packet on a request --- .../turikhay/mc/mapmodcompanion/spigot/WorldIdHandler.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/spigot/src/main/java/com/turikhay/mc/mapmodcompanion/spigot/WorldIdHandler.java b/spigot/src/main/java/com/turikhay/mc/mapmodcompanion/spigot/WorldIdHandler.java index 174f384..ebfa76f 100644 --- a/spigot/src/main/java/com/turikhay/mc/mapmodcompanion/spigot/WorldIdHandler.java +++ b/spigot/src/main/java/com/turikhay/mc/mapmodcompanion/spigot/WorldIdHandler.java @@ -27,8 +27,11 @@ public void init() { @Override public void scheduleLevelIdPacket(Runnable r, EventSource source) { - long delay = source == EventSource.PLUGIN_MESSAGE ? 0L : 20L * WORLD_ID_PACKET_DELAY; - plugin.getServer().getScheduler().runTaskLater(plugin, r, delay); + if (source != EventSource.PLUGIN_MESSAGE) { + // This handler should only send worldId on a request + return; + } + r.run(); } @Override