Paper/patches/server/0689-Add-EntityInsideBlockEvent.patch

247 lines
20 KiB
Diff
Raw Normal View History

2021-06-11 14:02:28 +02:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jake Potrebic <jake.m.potrebic@gmail.com>
Date: Sat, 8 May 2021 18:02:36 -0700
Subject: [PATCH] Add EntityInsideBlockEvent
diff --git a/src/main/java/net/minecraft/world/level/block/BaseFireBlock.java b/src/main/java/net/minecraft/world/level/block/BaseFireBlock.java
2021-06-15 04:59:31 +02:00
index 177d1da44c83da5f99ae91891dec41dc210bd31d..d2fb4d5738919c1e7b9a7f08aad2e4b607414a53 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/net/minecraft/world/level/block/BaseFireBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/BaseFireBlock.java
2021-06-15 04:59:31 +02:00
@@ -123,6 +123,7 @@ public abstract class BaseFireBlock extends Block {
2021-06-11 14:02:28 +02:00
@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.fireImmune()) {
entity.setRemainingFireTicks(entity.getRemainingFireTicks() + 1);
if (entity.getRemainingFireTicks() == 0) {
diff --git a/src/main/java/net/minecraft/world/level/block/BasePressurePlateBlock.java b/src/main/java/net/minecraft/world/level/block/BasePressurePlateBlock.java
2021-06-15 04:59:31 +02:00
index 94c48393e467f61cb763e8c44baccdef446be474..14de86667e9c05da95e807177d8c44cdaa765f18 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/net/minecraft/world/level/block/BasePressurePlateBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/BasePressurePlateBlock.java
2021-06-15 04:59:31 +02:00
@@ -67,6 +67,7 @@ public abstract class BasePressurePlateBlock extends Block {
2021-06-11 14:02:28 +02:00
@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 (!world.isClientSide) {
int i = this.getSignalForState(state);
diff --git a/src/main/java/net/minecraft/world/level/block/BubbleColumnBlock.java b/src/main/java/net/minecraft/world/level/block/BubbleColumnBlock.java
2021-06-15 04:59:31 +02:00
index 68135caecf506a5a2ad36def1a94a83eec3abe32..17cffb3bd362dc4a69535425f7289af7ccb640eb 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/net/minecraft/world/level/block/BubbleColumnBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/BubbleColumnBlock.java
2021-06-15 04:59:31 +02:00
@@ -38,6 +38,7 @@ public class BubbleColumnBlock extends Block implements BucketPickup {
2021-06-11 14:02:28 +02:00
@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
2021-06-15 04:59:31 +02:00
BlockState blockState = world.getBlockState(pos.above());
if (blockState.isAir()) {
entity.onAboveBubbleCol(state.getValue(DRAG_DOWN));
2021-06-11 14:02:28 +02:00
diff --git a/src/main/java/net/minecraft/world/level/block/ButtonBlock.java b/src/main/java/net/minecraft/world/level/block/ButtonBlock.java
2021-06-15 04:59:31 +02:00
index 698a80029f4410045af486f926324b3fdb98bb64..af6730322a7cea0c4f9ca92c289698554bf86b3a 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/net/minecraft/world/level/block/ButtonBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/ButtonBlock.java
2021-06-15 04:59:31 +02:00
@@ -186,6 +186,7 @@ public abstract class ButtonBlock extends FaceAttachedHorizontalDirectionalBlock
2021-06-11 14:02:28 +02:00
@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 (!world.isClientSide && this.sensitive && !(Boolean) state.getValue(ButtonBlock.POWERED)) {
this.checkPressed(state, world, pos);
}
diff --git a/src/main/java/net/minecraft/world/level/block/CactusBlock.java b/src/main/java/net/minecraft/world/level/block/CactusBlock.java
2021-06-15 04:59:31 +02:00
index 722f1816cd4130fa4b1e2310badedc77ab96eee6..2a02fdf58640d26b82e0ca22d0d8ff3326921b61 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/net/minecraft/world/level/block/CactusBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/CactusBlock.java
2021-06-15 04:59:31 +02:00
@@ -117,6 +117,7 @@ public class CactusBlock extends Block {
2021-06-11 14:02:28 +02:00
@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
CraftEventFactory.blockDamage = world.getWorld().getBlockAt(pos.getX(), pos.getY(), pos.getZ()); // CraftBukkit
entity.hurt(DamageSource.CACTUS, 1.0F);
CraftEventFactory.blockDamage = null; // CraftBukkit
diff --git a/src/main/java/net/minecraft/world/level/block/CampfireBlock.java b/src/main/java/net/minecraft/world/level/block/CampfireBlock.java
index a1f3d145414979a1994d608d525471d95fd2f72e..7d0d6da335ff3bf810fa951553b58ff8a3267b0f 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/net/minecraft/world/level/block/CampfireBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/CampfireBlock.java
@@ -94,6 +94,7 @@ public class CampfireBlock extends BaseEntityBlock implements SimpleWaterloggedB
2021-06-11 14:02:28 +02:00
@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.fireImmune() && (Boolean) state.getValue(CampfireBlock.LIT) && entity instanceof LivingEntity && !EnchantmentHelper.hasFrostWalker((LivingEntity) entity)) {
org.bukkit.craftbukkit.event.CraftEventFactory.blockDamage = CraftBlock.at(world, pos); // CraftBukkit
2021-06-11 14:02:28 +02:00
entity.hurt(DamageSource.IN_FIRE, (float) this.fireDamage);
diff --git a/src/main/java/net/minecraft/world/level/block/CropBlock.java b/src/main/java/net/minecraft/world/level/block/CropBlock.java
2021-06-15 04:59:31 +02:00
index ea8047d4509632c9bc8247356f6eb3d1289db672..6dda5eeca4e310eceb2598322803bfafc184e9c7 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/net/minecraft/world/level/block/CropBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/CropBlock.java
2021-06-15 04:59:31 +02:00
@@ -163,6 +163,7 @@ public class CropBlock extends BushBlock implements BonemealableBlock {
2021-06-11 14:02:28 +02:00
@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 && !CraftEventFactory.callEntityChangeBlockEvent(entity, pos, Blocks.AIR.defaultBlockState(), !world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)).isCancelled()) { // CraftBukkit
world.destroyBlock(pos, true, entity);
}
diff --git a/src/main/java/net/minecraft/world/level/block/DetectorRailBlock.java b/src/main/java/net/minecraft/world/level/block/DetectorRailBlock.java
2021-06-15 04:59:31 +02:00
index 63c7f2cf530ac9562960ae5a3cbc6e511a009377..3705452f1b57d3bc1307411c7367529de0fa47e1 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/net/minecraft/world/level/block/DetectorRailBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/DetectorRailBlock.java
@@ -44,6 +44,7 @@ public class DetectorRailBlock extends BaseRailBlock {
@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 (!world.isClientSide) {
if (!(Boolean) state.getValue(DetectorRailBlock.POWERED)) {
this.checkPressed(world, pos, state);
diff --git a/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java b/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java
2021-06-15 07:38:36 +02:00
index 2cd9584aae80e5bf40d0a53417692758a17d05d6..739c9c3a49fd3893ac39962a02a5e3620dc4fe06 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java
2021-06-15 04:59:31 +02:00
@@ -44,6 +44,7 @@ public class EndPortalBlock extends BaseEntityBlock {
2021-06-11 14:02:28 +02:00
@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 (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() == DimensionType.END_LOCATION ? 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/HoneyBlock.java b/src/main/java/net/minecraft/world/level/block/HoneyBlock.java
2021-06-15 04:59:31 +02:00
index 6f7bcf0ae17aec3e937ff52084f53681aacb9398..c6a988fdc92cd7329b4fd7c6b415fd2fe01aa8a3 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/net/minecraft/world/level/block/HoneyBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/HoneyBlock.java
2021-06-15 04:59:31 +02:00
@@ -55,6 +55,7 @@ public class HoneyBlock extends HalfTransparentBlock {
2021-06-11 14:02:28 +02:00
@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 (this.isSlidingDown(pos, entity)) {
this.maybeDoSlideAchievement(entity, pos);
this.doSlideMovement(entity);
diff --git a/src/main/java/net/minecraft/world/level/block/HopperBlock.java b/src/main/java/net/minecraft/world/level/block/HopperBlock.java
2021-06-15 04:59:31 +02:00
index 9a58f017bbaa742cbb892c804011cc9396b8607c..386c3e458babc31ad3bf2b51c20d1cfde08647ac 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/net/minecraft/world/level/block/HopperBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/HopperBlock.java
2021-06-15 04:59:31 +02:00
@@ -200,6 +200,7 @@ public class HopperBlock extends BaseEntityBlock {
@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
BlockEntity blockEntity = world.getBlockEntity(pos);
if (blockEntity instanceof HopperBlockEntity) {
HopperBlockEntity.entityInside(world, pos, state, entity, (HopperBlockEntity)blockEntity);
diff --git a/src/main/java/net/minecraft/world/level/block/LavaCauldronBlock.java b/src/main/java/net/minecraft/world/level/block/LavaCauldronBlock.java
index f0a3ef0529951e7732602d358ddea1782001db7e..6588b207d93d96934e72176874ba60c81e9a098c 100644
--- a/src/main/java/net/minecraft/world/level/block/LavaCauldronBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/LavaCauldronBlock.java
@@ -24,6 +24,7 @@ public class LavaCauldronBlock extends AbstractCauldronBlock {
2021-06-11 14:02:28 +02:00
@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
2021-06-15 04:59:31 +02:00
if (this.isEntityInsideContent(state, pos, entity)) {
entity.lavaHurt();
}
diff --git a/src/main/java/net/minecraft/world/level/block/LayeredCauldronBlock.java b/src/main/java/net/minecraft/world/level/block/LayeredCauldronBlock.java
index a22676495796784e59a0dd11343c966ec7ea6bc6..d06a20f12a4c0d7d561141ca004a965751a68f9e 100644
2021-06-15 04:59:31 +02:00
--- a/src/main/java/net/minecraft/world/level/block/LayeredCauldronBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/LayeredCauldronBlock.java
@@ -59,6 +59,7 @@ public class LayeredCauldronBlock extends AbstractCauldronBlock {
2021-06-11 14:02:28 +02:00
2021-06-15 04:59:31 +02:00
@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 (!world.isClientSide && entity.isOnFire() && this.isEntityInsideContent(state, pos, entity)) {
// CraftBukkit start
if (entity.mayInteract(world, pos)) {
2021-06-11 14:02:28 +02:00
diff --git a/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java b/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java
2021-06-15 04:59:31 +02:00
index cfea29f5bf1c5e74a0292c1344baaaa49c2f4403..bc2f2c69d437e99cb965cede7dfd42228151b26c 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java
2021-06-15 04:59:31 +02:00
@@ -85,6 +85,7 @@ public class NetherPortalBlock extends Block {
2021-06-11 14:02:28 +02:00
@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.isPassenger() && !entity.isVehicle() && 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()));
2021-06-15 04:59:31 +02:00
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 ceda744e9f7e48051e046eb3171e80bded739ba8..1187a7382b8849524f99bbd8d12b43677f1053cd 100644
--- a/src/main/java/net/minecraft/world/level/block/PowderSnowBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/PowderSnowBlock.java
@@ -54,6 +54,7 @@ public class PowderSnowBlock extends Block implements BucketPickup {
@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 LivingEntity) || entity.getFeetBlockState().is((Block) this)) {
entity.makeStuckInBlock(state, new Vec3(0.8999999761581421D, 1.5D, 0.8999999761581421D));
if (world.isClientSide) {
2021-06-11 14:02:28 +02:00
diff --git a/src/main/java/net/minecraft/world/level/block/SweetBerryBushBlock.java b/src/main/java/net/minecraft/world/level/block/SweetBerryBushBlock.java
2021-06-15 04:59:31 +02:00
index 1a5590ff8e5122b5c7587347fcc38d73671c2747..71abf800e623336124bd9a955e07db4950286516 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/net/minecraft/world/level/block/SweetBerryBushBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/SweetBerryBushBlock.java
2021-06-15 04:59:31 +02:00
@@ -73,6 +73,7 @@ public class SweetBerryBushBlock extends BushBlock implements BonemealableBlock
2021-06-11 14:02:28 +02:00
@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 LivingEntity && entity.getType() != EntityType.FOX && entity.getType() != EntityType.BEE) {
entity.makeStuckInBlock(state, new Vec3(0.800000011920929D, 0.75D, 0.800000011920929D));
if (!world.isClientSide && (Integer) state.getValue(SweetBerryBushBlock.AGE) > 0 && (entity.xOld != entity.getX() || entity.zOld != entity.getZ())) {
diff --git a/src/main/java/net/minecraft/world/level/block/TripWireBlock.java b/src/main/java/net/minecraft/world/level/block/TripWireBlock.java
2021-06-15 04:59:31 +02:00
index baa14c23016df6687984447d1a1f071b29aa7b49..9cafee5bd1e432ed5f114c73cf616798cd71a379 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/net/minecraft/world/level/block/TripWireBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/TripWireBlock.java
2021-06-15 04:59:31 +02:00
@@ -121,6 +121,7 @@ public class TripWireBlock extends Block {
2021-06-11 14:02:28 +02:00
@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 (!world.isClientSide) {
if (!(Boolean) state.getValue(TripWireBlock.POWERED)) {
this.checkPressed(world, pos);
diff --git a/src/main/java/net/minecraft/world/level/block/WaterlilyBlock.java b/src/main/java/net/minecraft/world/level/block/WaterlilyBlock.java
index 2b2a28d0383ccc8c0e7debd90331570b02b5e65f..bd4295f8d24ca9fd8c3af31abcd13da24db1c5d5 100644
--- a/src/main/java/net/minecraft/world/level/block/WaterlilyBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/WaterlilyBlock.java
@@ -25,6 +25,7 @@ public class WaterlilyBlock extends BushBlock {
@Override
public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) {
super.entityInside(state, world, pos, entity);
+ if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(world, pos)).callEvent()) { return; } // Paper
if (world instanceof ServerLevel && entity instanceof Boat && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(entity, pos, Blocks.AIR.defaultBlockState()).isCancelled()) { // CraftBukkit
world.destroyBlock(new BlockPos(pos), true, entity);
}
diff --git a/src/main/java/net/minecraft/world/level/block/WebBlock.java b/src/main/java/net/minecraft/world/level/block/WebBlock.java
2021-06-15 04:59:31 +02:00
index 6964308822ebf8a7027ce426062ba43a70c20c15..763fa221c562e96c2abd09c7055e91a86ac03d43 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/net/minecraft/world/level/block/WebBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/WebBlock.java
2021-06-15 04:59:31 +02:00
@@ -14,6 +14,7 @@ public class WebBlock extends Block {
2021-06-11 14:02:28 +02:00
@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
2021-06-15 04:59:31 +02:00
entity.makeStuckInBlock(state, new Vec3(0.25D, (double)0.05F, 0.25D));
2021-06-11 14:02:28 +02:00
}
}
diff --git a/src/main/java/net/minecraft/world/level/block/WitherRoseBlock.java b/src/main/java/net/minecraft/world/level/block/WitherRoseBlock.java
2021-06-15 04:59:31 +02:00
index adf1e71323ea84856ec2871b8e3227f29ff59c40..5b6fe6fa607c38e42a30d6c7c6f6fc93af93dd20 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/net/minecraft/world/level/block/WitherRoseBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/WitherRoseBlock.java
2021-06-15 04:59:31 +02:00
@@ -46,6 +46,7 @@ public class WitherRoseBlock extends FlowerBlock {
2021-06-11 14:02:28 +02:00
@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 (!world.isClientSide && world.getDifficulty() != Difficulty.PEACEFUL) {
if (entity instanceof LivingEntity) {
LivingEntity entityliving = (LivingEntity) entity;