aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/SculkShriekerBlock.java.patch
diff options
context:
space:
mode:
authorMiniDigger | Martin <[email protected]>2024-01-14 11:04:49 +0100
committerMiniDigger | Martin <[email protected]>2024-01-14 11:04:49 +0100
commitbee74680e607c2e29b038329f62181238911cd83 (patch)
tree708fd1a4a0227d9071243adf2a42d5e9e96cde4a /patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/SculkShriekerBlock.java.patch
parent0a44692ef6ff6e255d48eb3ba1bb114166eafda9 (diff)
downloadPaper-softspoon.tar.gz
Paper-softspoon.zip
add remapped patches as a testsoftspoon
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.patch44
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