#1160: Add more bell API

By: Parker Hawke <hawkeboyz2@hotmail.com>
This commit is contained in:
CraftBukkit/Spigot
2023-04-02 14:35:13 +10:00
parent a9bdb77af1
commit 496189d962
4 changed files with 127 additions and 2 deletions

View File

@@ -0,0 +1,14 @@
--- a/net/minecraft/world/level/block/BlockBell.java
+++ b/net/minecraft/world/level/block/BlockBell.java
@@ -137,6 +137,11 @@
if (enumdirection == null) {
enumdirection = (EnumDirection) world.getBlockState(blockposition).getValue(BlockBell.FACING);
}
+ // CraftBukkit start
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.handleBellRingEvent(world, blockposition, enumdirection, entity)) {
+ return false;
+ }
+ // CraftBukkit end
((TileEntityBell) tileentity).onHit(enumdirection);
world.playSound((EntityHuman) null, blockposition, SoundEffects.BELL_BLOCK, SoundCategory.BLOCKS, 2.0F, 1.0F);