From 20549ff2d71f48af8ca2417e49a87ddb57b47913 Mon Sep 17 00:00:00 2001
From: Jake Potrebic <jake.m.potrebic@gmail.com>
Date: Fri, 9 Dec 2022 02:46:47 -0800
Subject: [PATCH] Add new 1.19.3 fires of EntityInsideBlockEvent (#8629)

---
 patches/api/0301-Add-EntityInsideBlockEvent.patch    |  7 +++++--
 patches/server/0629-Add-EntityInsideBlockEvent.patch | 12 ++++++++++++
 .../server/0879-Add-missing-BlockFadeEvents.patch    |  4 ++--
 ...-Fixes-and-additions-to-the-SpawnReason-API.patch |  4 ++--
 4 files changed, 21 insertions(+), 6 deletions(-)

diff --git a/patches/api/0301-Add-EntityInsideBlockEvent.patch b/patches/api/0301-Add-EntityInsideBlockEvent.patch
index 26c188e7a0..f1ce553e7b 100644
--- a/patches/api/0301-Add-EntityInsideBlockEvent.patch
+++ b/patches/api/0301-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..94e8b6f6501c92711bd0bc9ee0f67e28f85a605f
+index 0000000000000000000000000000000000000000..447fed3d39d68f13fd6cd94332c7ec7553d8e0df
 --- /dev/null
 +++ b/src/main/java/io/papermc/paper/event/entity/EntityInsideBlockEvent.java
-@@ -0,0 +1,80 @@
+@@ -0,0 +1,83 @@
 +package io.papermc.paper.event.entity;
 +
 +import org.bukkit.block.Block;
@@ -27,6 +27,7 @@ index 0000000000000000000000000000000000000000..94e8b6f6501c92711bd0bc9ee0f67e28
 + * <p>
 + * Blocks this is currently called for:
 + * <ul>
++ *     <li>Big dripleaf</li>
 + *     <li>Bubble column</li>
 + *     <li>Buttons</li>
 + *     <li>Cactus</li>
@@ -35,10 +36,12 @@ index 0000000000000000000000000000000000000000..94e8b6f6501c92711bd0bc9ee0f67e28
 + *     <li>Crops</li>
 + *     <li>Ender Portal</li>
 + *     <li>Fires</li>
++ *     <li>Frogspawn</li>
 + *     <li>Honey</li>
 + *     <li>Hopper</li>
 + *     <li>Detector rails</li>
 + *     <li>Nether portals</li>
++ *     <li>Powdered snow</li>
 + *     <li>Pressure plates</li>
 + *     <li>Sweet berry bush</li>
 + *     <li>Tripwire</li>
diff --git a/patches/server/0629-Add-EntityInsideBlockEvent.patch b/patches/server/0629-Add-EntityInsideBlockEvent.patch
index 6ec2cad77a..93132df578 100644
--- a/patches/server/0629-Add-EntityInsideBlockEvent.patch
+++ b/patches/server/0629-Add-EntityInsideBlockEvent.patch
@@ -124,6 +124,18 @@ index 3b54eb4962a0cd39e6ff7a934f814de864a16a3d..150c16da7caa655cfc2c371d3336a8d7
          if (world instanceof ServerLevel && !entity.isPassenger() && !entity.isVehicle() && entity.canChangeDimensions() && Shapes.joinIsNotEmpty(Shapes.create(entity.getBoundingBox().move((double) (-pos.getX()), (double) (-pos.getY()), (double) (-pos.getZ()))), state.getShape(world, pos), BooleanOp.AND)) {
              ResourceKey<Level> resourcekey = world.getTypeKey() == LevelStem.END ? Level.OVERWORLD : Level.END; // CraftBukkit - SPIGOT-6152: send back to main overworld in custom ends
              ServerLevel worldserver = ((ServerLevel) world).getServer().getLevel(resourcekey);
+diff --git a/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java b/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java
+index b63835fe3eda974746163e7a9e26080da7538c4d..834c5e3fbff3819f3f72e95a1072d9b9e57f25b3 100644
+--- a/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java
++++ b/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java
+@@ -71,6 +71,7 @@ public class FrogspawnBlock extends Block {
+ 
+     @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.getType().equals(EntityType.FALLING_BLOCK)) {
+             this.destroyBlock(world, pos);
+         }
 diff --git a/src/main/java/net/minecraft/world/level/block/HoneyBlock.java b/src/main/java/net/minecraft/world/level/block/HoneyBlock.java
 index 0549256cbd7028c82bf82ccc4ff64219df7e0906..683f24251baf8ef3bef8f32ba83dc7f0e8ed7d70 100644
 --- a/src/main/java/net/minecraft/world/level/block/HoneyBlock.java
diff --git a/patches/server/0879-Add-missing-BlockFadeEvents.patch b/patches/server/0879-Add-missing-BlockFadeEvents.patch
index 2d2a6fa5d4..e939b49a21 100644
--- a/patches/server/0879-Add-missing-BlockFadeEvents.patch
+++ b/patches/server/0879-Add-missing-BlockFadeEvents.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Add missing BlockFadeEvents
 
 
 diff --git a/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java b/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java
-index b63835fe3eda974746163e7a9e26080da7538c4d..2974f64d5a931a08e450aacbfd1281c4d3f15303 100644
+index 834c5e3fbff3819f3f72e95a1072d9b9e57f25b3..294d22b6b27e96b59c77527efcfefa9410b756e4 100644
 --- a/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java
 +++ b/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java
-@@ -84,6 +84,11 @@ public class FrogspawnBlock extends Block {
+@@ -85,6 +85,11 @@ public class FrogspawnBlock extends Block {
      }
  
      private void hatchFrogspawn(ServerLevel world, BlockPos pos, RandomSource random) {
diff --git a/patches/server/0943-Fixes-and-additions-to-the-SpawnReason-API.patch b/patches/server/0943-Fixes-and-additions-to-the-SpawnReason-API.patch
index caab78b83d..86feead4ab 100644
--- a/patches/server/0943-Fixes-and-additions-to-the-SpawnReason-API.patch
+++ b/patches/server/0943-Fixes-and-additions-to-the-SpawnReason-API.patch
@@ -34,10 +34,10 @@ index 6afe37e42d88701af38df5793a9ea9d7d2cda5c5..c72ab3c9f7cb20f22b051981fe1fc419
                  this.discard();
              }
 diff --git a/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java b/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java
-index 2974f64d5a931a08e450aacbfd1281c4d3f15303..5ac75fbb994b4436fa3d6b723a9e0f58650236ed 100644
+index 294d22b6b27e96b59c77527efcfefa9410b756e4..bebcdc70c4cb01764428836fff76f03b94f2eae8 100644
 --- a/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java
 +++ b/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java
-@@ -109,7 +109,7 @@ public class FrogspawnBlock extends Block {
+@@ -110,7 +110,7 @@ public class FrogspawnBlock extends Block {
                  int k = random.nextInt(1, 361);
                  tadpole.moveTo(d, (double)pos.getY() - 0.5D, e, (float)k, 0.0F);
                  tadpole.setPersistenceRequired();