SPIGOT-6852: BlockReceiveGameEvent#getBlock returning wrong block
This commit is contained in:
parent
dad8517102
commit
e36f7599d6
@ -21,7 +21,7 @@
|
|||||||
- if (!this.config.shouldListen(world, this, blockposition, gameevent, entity)) {
|
- if (!this.config.shouldListen(world, this, blockposition, gameevent, entity)) {
|
||||||
+ // CraftBukkit start
|
+ // CraftBukkit start
|
||||||
+ boolean defaultCancel = !this.config.shouldListen(world, this, blockposition, gameevent, entity);
|
+ 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);
|
+ event.setCancelled(defaultCancel);
|
||||||
+ world.getCraftServer().getPluginManager().callEvent(event);
|
+ world.getCraftServer().getPluginManager().callEvent(event);
|
||||||
+ if (event.isCancelled()) {
|
+ if (event.isCancelled()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user