diff --git a/paper-server/nms-patches/net/minecraft/world/level/block/SculkSensorBlock.patch b/paper-server/nms-patches/net/minecraft/world/level/block/SculkSensorBlock.patch index 6d7a8cf3f1..5310672c16 100644 --- a/paper-server/nms-patches/net/minecraft/world/level/block/SculkSensorBlock.patch +++ b/paper-server/nms-patches/net/minecraft/world/level/block/SculkSensorBlock.patch @@ -12,7 +12,26 @@ public class SculkSensorBlock extends BlockTileEntity implements IBlockWaterlogged { public static final int ACTIVE_TICKS = 40; -@@ -234,6 +239,15 @@ +@@ -135,6 +140,18 @@ + @Override + public void stepOn(World world, BlockPosition blockposition, IBlockData iblockdata, Entity entity) { + if (!world.isClientSide() && canActivate(iblockdata) && entity.getType() != EntityTypes.WARDEN) { ++ // CraftBukkit start ++ org.bukkit.event.Cancellable cancellable; ++ if (entity instanceof EntityHuman) { ++ cancellable = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent((EntityHuman) entity, org.bukkit.event.block.Action.PHYSICAL, blockposition, null, null, null); ++ } else { ++ cancellable = new org.bukkit.event.entity.EntityInteractEvent(entity.getBukkitEntity(), world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ())); ++ world.getCraftServer().getPluginManager().callEvent((org.bukkit.event.entity.EntityInteractEvent) cancellable); ++ } ++ if (cancellable.isCancelled()) { ++ return; ++ } ++ // CraftBukkit end + TileEntity tileentity = world.getBlockEntity(blockposition); + + if (tileentity instanceof SculkSensorBlockEntity) { +@@ -234,6 +251,15 @@ } public static void deactivate(World world, BlockPosition blockposition, IBlockData iblockdata) { @@ -28,7 +47,7 @@ world.setBlock(blockposition, (IBlockData) ((IBlockData) iblockdata.setValue(SculkSensorBlock.PHASE, SculkSensorPhase.COOLDOWN)).setValue(SculkSensorBlock.POWER, 0), 3); world.scheduleTick(blockposition, iblockdata.getBlock(), 1); if (!(Boolean) iblockdata.getValue(SculkSensorBlock.WATERLOGGED)) { -@@ -244,6 +258,15 @@ +@@ -244,6 +270,15 @@ } public static void activate(@Nullable Entity entity, World world, BlockPosition blockposition, IBlockData iblockdata, int i) { @@ -44,7 +63,7 @@ world.setBlock(blockposition, (IBlockData) ((IBlockData) iblockdata.setValue(SculkSensorBlock.PHASE, SculkSensorPhase.ACTIVE)).setValue(SculkSensorBlock.POWER, i), 3); world.scheduleTick(blockposition, iblockdata.getBlock(), 40); updateNeighbours(world, blockposition); -@@ -306,9 +329,16 @@ +@@ -306,9 +341,16 @@ @Override public void spawnAfterBreak(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, ItemStack itemstack, boolean flag) { super.spawnAfterBreak(iblockdata, worldserver, blockposition, itemstack, flag); diff --git a/paper-server/nms-patches/net/minecraft/world/level/block/SculkShriekerBlock.patch b/paper-server/nms-patches/net/minecraft/world/level/block/SculkShriekerBlock.patch index a814775acb..79b65aadd3 100644 --- a/paper-server/nms-patches/net/minecraft/world/level/block/SculkShriekerBlock.patch +++ b/paper-server/nms-patches/net/minecraft/world/level/block/SculkShriekerBlock.patch @@ -1,6 +1,14 @@ --- a/net/minecraft/world/level/block/SculkShriekerBlock.java +++ b/net/minecraft/world/level/block/SculkShriekerBlock.java -@@ -140,10 +140,17 @@ +@@ -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);