3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-16 03:20:07 +01:00

Add new 1.19.3 fires of EntityInsideBlockEvent (#8629)

Dieser Commit ist enthalten in:
Jake Potrebic 2022-12-09 02:46:47 -08:00 committet von GitHub
Ursprung 4d270892ec
Commit 20549ff2d7
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23
4 geänderte Dateien mit 21 neuen und 6 gelöschten Zeilen

Datei anzeigen

@ -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>

Datei anzeigen

@ -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

Datei anzeigen

@ -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) {

Datei anzeigen

@ -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();