mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 11:44:19 +01:00
c6f488dfd5
By: BlackHole <black-hole@live.com>
29 lines
1.5 KiB
Diff
29 lines
1.5 KiB
Diff
--- a/net/minecraft/world/level/block/SculkShriekerBlock.java
|
|
+++ b/net/minecraft/world/level/block/SculkShriekerBlock.java
|
|
@@ -56,6 +56,7 @@
|
|
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);
|
|
});
|
|
@@ -140,10 +141,17 @@
|
|
@Override
|
|
public void spawnAfterBreak(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, ItemStack itemstack, boolean flag) {
|
|
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
|