From e36f7599d64ed22674f8d51733d3b5d5fa1e0bdb Mon Sep 17 00:00:00 2001 From: md_5 Date: Tue, 14 Dec 2021 07:52:43 +1100 Subject: [PATCH] SPIGOT-6852: BlockReceiveGameEvent#getBlock returning wrong block --- .../world/level/gameevent/vibrations/VibrationListener.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nms-patches/net/minecraft/world/level/gameevent/vibrations/VibrationListener.patch b/nms-patches/net/minecraft/world/level/gameevent/vibrations/VibrationListener.patch index 9abd2ff07..f0e742de2 100644 --- a/nms-patches/net/minecraft/world/level/gameevent/vibrations/VibrationListener.patch +++ b/nms-patches/net/minecraft/world/level/gameevent/vibrations/VibrationListener.patch @@ -21,7 +21,7 @@ - if (!this.config.shouldListen(world, this, blockposition, gameevent, entity)) { + // CraftBukkit start + boolean defaultCancel = !this.config.shouldListen(world, this, blockposition, gameevent, entity); -+ BlockReceiveGameEvent event = new BlockReceiveGameEvent(org.bukkit.GameEvent.getByKey(CraftNamespacedKey.fromMinecraft(IRegistry.GAME_EVENT.getKey(gameevent))), CraftBlock.at(world, blockposition), (entity == null) ? null : entity.getBukkitEntity()); ++ BlockReceiveGameEvent event = new BlockReceiveGameEvent(org.bukkit.GameEvent.getByKey(CraftNamespacedKey.fromMinecraft(IRegistry.GAME_EVENT.getKey(gameevent))), CraftBlock.at(world, blockposition1), (entity == null) ? null : entity.getBukkitEntity()); + event.setCancelled(defaultCancel); + world.getCraftServer().getPluginManager().callEvent(event); + if (event.isCancelled()) {