diff options
Diffstat (limited to 'patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/SculkShriekerBlock.java.patch')
-rw-r--r-- | patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/SculkShriekerBlock.java.patch | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/SculkShriekerBlock.java.patch b/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/SculkShriekerBlock.java.patch new file mode 100644 index 0000000000..c4ad66e5af --- /dev/null +++ b/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/SculkShriekerBlock.java.patch @@ -0,0 +1,44 @@ +--- a/net/minecraft/world/level/block/SculkShriekerBlock.java ++++ b/net/minecraft/world/level/block/SculkShriekerBlock.java +@@ -61,11 +57,16 @@ + } + + @Override +- public void stepOn(Level level, BlockPos pos, BlockState state, Entity entity) { +- if (level instanceof ServerLevel serverLevel) { +- ServerPlayer serverPlayer = SculkShriekerBlockEntity.tryGetPlayer(entity); +- if (serverPlayer != null) { +- serverLevel.getBlockEntity(pos, BlockEntityType.SCULK_SHRIEKER).ifPresent(sculkShrieker -> sculkShrieker.tryShriek(serverLevel, serverPlayer)); ++ public void stepOn(Level level, BlockPos pos, IBlockData state, Entity entity) { ++ if (level instanceof ServerLevel) { ++ ServerLevel worldserver = (ServerLevel) level; ++ ServerPlayer entityplayer = SculkShriekerBlockEntity.tryGetPlayer(entity); ++ ++ if (entityplayer != null) { ++ if (org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(entityplayer, org.bukkit.event.block.Action.PHYSICAL, pos, null, null, null).isCancelled()) return; // CraftBukkit ++ worldserver.getBlockEntity(pos, BlockEntityType.SCULK_SHRIEKER).ifPresent((sculkshriekerblockentity) -> { ++ sculkshriekerblockentity.tryShriek(worldserver, entityplayer); ++ }); + } + } + +@@ -139,9 +148,17 @@ + @Override + public void spawnAfterBreak(BlockState state, ServerLevel level, BlockPos pos, ItemStack stack, boolean dropExperience) { + super.spawnAfterBreak(state, level, pos, stack, dropExperience); +- if (dropExperience) { +- this.tryDropExperience(level, pos, stack, ConstantInt.of(5)); ++ // CraftBukkit start - Delegate to getExpDrop ++ } ++ ++ @Override ++ public int getExpDrop(IBlockData iblockdata, ServerLevel worldserver, BlockPos blockposition, ItemStack itemstack, boolean flag) { ++ if (flag) { ++ return this.tryDropExperience(worldserver, blockposition, itemstack, ConstantInt.of(5)); + } ++ ++ return 0; ++ // CraftBukkit end + } + + @Nullable |