From 94c2fa1b14072ab2e999b2a2a5fc82aeefae1e6d Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Tue, 14 Dec 2021 07:52:43 +1100 Subject: [PATCH] SPIGOT-6852: BlockReceiveGameEvent#getBlock returning wrong block By: md_5 --- .../world/level/gameevent/vibrations/VibrationListener.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paper-server/nms-patches/net/minecraft/world/level/gameevent/vibrations/VibrationListener.patch b/paper-server/nms-patches/net/minecraft/world/level/gameevent/vibrations/VibrationListener.patch index 9abd2ff076..f0e742de2f 100644 --- a/paper-server/nms-patches/net/minecraft/world/level/gameevent/vibrations/VibrationListener.patch +++ b/paper-server/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()) {