diff options
Diffstat (limited to 'patches/server/0282-BlockDestroyEvent.patch')
-rw-r--r-- | patches/server/0282-BlockDestroyEvent.patch | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/patches/server/0282-BlockDestroyEvent.patch b/patches/server/0282-BlockDestroyEvent.patch index d5cdb40c54..0842612a62 100644 --- a/patches/server/0282-BlockDestroyEvent.patch +++ b/patches/server/0282-BlockDestroyEvent.patch @@ -11,10 +11,10 @@ floating in the air. This can replace many uses of BlockPhysicsEvent diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index e85e47b5fd8f59a298afd8962986dfc4fa956a10..cea3b4744a45b100f0c5c5cef6ecd4b932a89b71 100644 +index 181201ecd6c617cc37ba097a667bd96ae3b1823e..28ed20fc6e53490392c59b927889d78eb268b777 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -31,6 +31,7 @@ import net.minecraft.nbt.CompoundTag; +@@ -26,6 +26,7 @@ import net.minecraft.nbt.CompoundTag; import net.minecraft.network.protocol.Packet; import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; @@ -22,7 +22,7 @@ index e85e47b5fd8f59a298afd8962986dfc4fa956a10..cea3b4744a45b100f0c5c5cef6ecd4b9 import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.FullChunkStatus; import net.minecraft.server.level.ServerLevel; -@@ -586,9 +587,26 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -581,9 +582,26 @@ public abstract class Level implements LevelAccessor, AutoCloseable { return false; } else { FluidState fluid = this.getFluidState(pos); @@ -33,7 +33,7 @@ index e85e47b5fd8f59a298afd8962986dfc4fa956a10..cea3b4744a45b100f0c5c5cef6ecd4b9 + BlockState effectType = iblockdata; + int xp = iblockdata.getBlock().getExpDrop(iblockdata, (ServerLevel) this, pos, ItemStack.EMPTY, true); + if (com.destroystokyo.paper.event.block.BlockDestroyEvent.getHandlerList().getRegisteredListeners().length > 0) { -+ com.destroystokyo.paper.event.block.BlockDestroyEvent event = new com.destroystokyo.paper.event.block.BlockDestroyEvent(MCUtil.toBukkitBlock(this, pos), fluid.createLegacyBlock().createCraftBlockData(), effectType.createCraftBlockData(), xp, drop); ++ com.destroystokyo.paper.event.block.BlockDestroyEvent event = new com.destroystokyo.paper.event.block.BlockDestroyEvent(org.bukkit.craftbukkit.block.CraftBlock.at(this, pos), fluid.createLegacyBlock().createCraftBlockData(), effectType.createCraftBlockData(), xp, drop); + if (!event.callEvent()) { + return false; + } |