From e325e3726885319f4d44e1d9f98581ff39c8cba6 Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Thu, 8 Jun 2023 17:34:35 -0700 Subject: [PATCH] add missing call to EntityInsideBlockEvent --- patches/api/0289-Add-EntityInsideBlockEvent.patch | 5 +++-- patches/server/0614-Add-EntityInsideBlockEvent.patch | 12 ++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/patches/api/0289-Add-EntityInsideBlockEvent.patch b/patches/api/0289-Add-EntityInsideBlockEvent.patch index f1ce553e7b..91451b592d 100644 --- a/patches/api/0289-Add-EntityInsideBlockEvent.patch +++ b/patches/api/0289-Add-EntityInsideBlockEvent.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add EntityInsideBlockEvent diff --git a/src/main/java/io/papermc/paper/event/entity/EntityInsideBlockEvent.java b/src/main/java/io/papermc/paper/event/entity/EntityInsideBlockEvent.java new file mode 100644 -index 0000000000000000000000000000000000000000..447fed3d39d68f13fd6cd94332c7ec7553d8e0df +index 0000000000000000000000000000000000000000..109dd7e6d0e7bb0a83fc4c5230f7d5dc122f2bb5 --- /dev/null +++ b/src/main/java/io/papermc/paper/event/entity/EntityInsideBlockEvent.java -@@ -0,0 +1,83 @@ +@@ -0,0 +1,84 @@ +package io.papermc.paper.event.entity; + +import org.bukkit.block.Block; @@ -41,6 +41,7 @@ index 0000000000000000000000000000000000000000..447fed3d39d68f13fd6cd94332c7ec75 + *
  • Hopper
  • + *
  • Detector rails
  • + *
  • Nether portals
  • ++ *
  • Pitcher crop
  • + *
  • Powdered snow
  • + *
  • Pressure plates
  • + *
  • Sweet berry bush
  • diff --git a/patches/server/0614-Add-EntityInsideBlockEvent.patch b/patches/server/0614-Add-EntityInsideBlockEvent.patch index b8e8dd194a..96a5c26841 100644 --- a/patches/server/0614-Add-EntityInsideBlockEvent.patch +++ b/patches/server/0614-Add-EntityInsideBlockEvent.patch @@ -196,6 +196,18 @@ index 69f34c566bf825259253abbefd7d7ba2e847231b..a6ab0d0defc05e56a91084c498970596 if (entity.canChangeDimensions()) { // CraftBukkit start - Entity in portal EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), pos.getX(), pos.getY(), pos.getZ())); +diff --git a/src/main/java/net/minecraft/world/level/block/PitcherCropBlock.java b/src/main/java/net/minecraft/world/level/block/PitcherCropBlock.java +index 94e0bf98753d3dee5ad275e4783682025f687ddf..593eae04ecf6dee86c9c3664ddcdc3f86d042e66 100644 +--- a/src/main/java/net/minecraft/world/level/block/PitcherCropBlock.java ++++ b/src/main/java/net/minecraft/world/level/block/PitcherCropBlock.java +@@ -96,6 +96,7 @@ public class PitcherCropBlock extends DoublePlantBlock implements BonemealableBl + + @Override + public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) { ++ if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(world, pos)).callEvent()) { return; } // Paper + if (entity instanceof Ravager && world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) { + world.destroyBlock(pos, true, entity); + } diff --git a/src/main/java/net/minecraft/world/level/block/PowderSnowBlock.java b/src/main/java/net/minecraft/world/level/block/PowderSnowBlock.java index 47f54002654d198a56a85884de34e305e545eb4b..518d3832c36c9ecf1ed9267ffc1f926dc84b7989 100644 --- a/src/main/java/net/minecraft/world/level/block/PowderSnowBlock.java