2022-06-07 18:00:00 +02:00
|
|
|
--- a/net/minecraft/world/level/block/SculkShriekerBlock.java
|
|
|
|
+++ b/net/minecraft/world/level/block/SculkShriekerBlock.java
|
2024-04-23 17:15:00 +02:00
|
|
|
@@ -62,6 +62,7 @@
|
2022-06-23 12:25:36 +02:00
|
|
|
EntityPlayer entityplayer = SculkShriekerBlockEntity.tryGetPlayer(entity);
|
|
|
|
|
|
|
|
if (entityplayer != null) {
|
|
|
|
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(entityplayer, org.bukkit.event.block.Action.PHYSICAL, blockposition, null, null, null).isCancelled()) return; // CraftBukkit
|
|
|
|
worldserver.getBlockEntity(blockposition, TileEntityTypes.SCULK_SHRIEKER).ifPresent((sculkshriekerblockentity) -> {
|
|
|
|
sculkshriekerblockentity.tryShriek(worldserver, entityplayer);
|
|
|
|
});
|
2024-04-23 17:15:00 +02:00
|
|
|
@@ -144,10 +145,17 @@
|
2022-06-07 18:00:00 +02:00
|
|
|
@Override
|
2024-04-23 17:15:00 +02:00
|
|
|
protected void spawnAfterBreak(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, ItemStack itemstack, boolean flag) {
|
2022-06-07 18:00:00 +02:00
|
|
|
super.spawnAfterBreak(iblockdata, worldserver, blockposition, itemstack, flag);
|
|
|
|
+ // CraftBukkit start - Delegate to getExpDrop
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public int getExpDrop(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, ItemStack itemstack, boolean flag) {
|
|
|
|
if (flag) {
|
|
|
|
- this.tryDropExperience(worldserver, blockposition, itemstack, ConstantInt.of(5));
|
|
|
|
+ return this.tryDropExperience(worldserver, blockposition, itemstack, ConstantInt.of(5));
|
|
|
|
}
|
|
|
|
|
|
|
|
+ return 0;
|
|
|
|
+ // CraftBukkit end
|
|
|
|
}
|
|
|
|
|
|
|
|
@Nullable
|