From bf8890f3e948dab3cd94b0213a1a04fb13a88c47 Mon Sep 17 00:00:00 2001 From: Teriuihi Date: Fri, 11 Nov 2022 02:13:51 +0100 Subject: [PATCH] Call the events after creating them --- .../java/com/alttd/datalock/PluginMessageListener.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugin/src/main/java/com/alttd/datalock/PluginMessageListener.java b/plugin/src/main/java/com/alttd/datalock/PluginMessageListener.java index 895407b..ae639ae 100644 --- a/plugin/src/main/java/com/alttd/datalock/PluginMessageListener.java +++ b/plugin/src/main/java/com/alttd/datalock/PluginMessageListener.java @@ -35,31 +35,31 @@ class PluginMessageListener implements org.bukkit.plugin.messaging.PluginMessage if (!alreadyReceived.putIdempotencyData(RequestType.TRY_LOCK, idempotencyData)) return; DataLock.getInstance().removeActiveRequest(RequestType.TRY_LOCK, idempotencyData); - new LockResponseEvent(true, channel, ResponseType.TRY_LOCK_RESULT, data, result); + new LockResponseEvent(true, channel, ResponseType.TRY_LOCK_RESULT, data, result).callEvent(); } case "queue-lock-failed" -> { if (!alreadyReceived.putIdempotencyData(RequestType.TRY_LOCK, idempotencyData)) return; DataLock.getInstance().removeActiveRequest(RequestType.TRY_LOCK, idempotencyData); - new LockResponseEvent(true, channel, ResponseType.QUEUE_LOCK_FAILED, data, result); + new LockResponseEvent(true, channel, ResponseType.QUEUE_LOCK_FAILED, data, result).callEvent(); } case "try-unlock-result" -> { if (!alreadyReceived.putIdempotencyData(RequestType.TRY_UNLOCK, idempotencyData)) return; DataLock.getInstance().removeActiveRequest(RequestType.TRY_UNLOCK, idempotencyData); - new LockResponseEvent(true, channel, ResponseType.TRY_UNLOCK_RESULT, data, result); + new LockResponseEvent(true, channel, ResponseType.TRY_UNLOCK_RESULT, data, result).callEvent(); } case "locked-queue-lock" -> { if (!alreadyReceived.putIdempotencyData(RequestType.TRY_LOCK, idempotencyData)) return; DataLock.getInstance().removeActiveRequest(RequestType.TRY_LOCK, idempotencyData); - new LockResponseEvent(true, channel, ResponseType.LOCKED_QUEUE_LOCK, data, result); + new LockResponseEvent(true, channel, ResponseType.LOCKED_QUEUE_LOCK, data, result).callEvent(); } case "check-lock-result" -> { if (!alreadyReceived.putIdempotencyData(RequestType.CHECK_LOCK, idempotencyData)) return; DataLock.getInstance().removeActiveRequest(RequestType.CHECK_LOCK, idempotencyData); - new LockResponseEvent(true, channel, ResponseType.CHECK_LOCK_RESULT, data, result); + new LockResponseEvent(true, channel, ResponseType.CHECK_LOCK_RESULT, data, result).callEvent(); } } }