mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-20 15:39:37 +00:00
* rebase * optimize LivingEntity#travel * cleanup * Replace fluid height map * reuse array list in Entity#collide * cleanup * fix fire and liquid collision shape * fix checkInside * inline betweenClosed * cleanup * optimize getOnPos * optimize equals in getOnPos * update mainSupportingBlockPos on dirty * cleanup * rename * merge same patch * rebase and remove properly * [ci skip] cleanup * rebase and rebuild * fix async locator * remove async locator * cleanup * rebase --------- Co-authored-by: Taiyou06 <kaandindar21@gmail.com>
28 lines
1.5 KiB
Diff
28 lines
1.5 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Pascalpex <pascalpex@gmail.com>
|
|
Date: Wed, 4 Jun 2025 17:03:32 +0200
|
|
Subject: [PATCH] Add BlockExplosionHitEvent
|
|
|
|
|
|
diff --git a/net/minecraft/world/level/ServerExplosion.java b/net/minecraft/world/level/ServerExplosion.java
|
|
index 1669c21534a453c9cf16b992df7a6bf276dea887..1039cf820ecac54e290dc5dfe7f714bf2b9d2bdd 100644
|
|
--- a/net/minecraft/world/level/ServerExplosion.java
|
|
+++ b/net/minecraft/world/level/ServerExplosion.java
|
|
@@ -615,9 +615,13 @@ public class ServerExplosion implements Explosion {
|
|
}
|
|
// CraftBukkit end
|
|
|
|
- this.level
|
|
- .getBlockState(blockPos)
|
|
- .onExplosionHit(this.level, blockPos, this, (itemStack, blockPos1) -> addOrAppendStack(list, itemStack, blockPos1));
|
|
+ // Leaf start - Add BlockExplosionHitEvent
|
|
+ if (new org.dreeam.leaf.event.BlockExplosionHitEvent(CraftLocation.toBukkit(blockPos, this.level.getWorld()).getBlock(), this.source == null ? null : this.source.getBukkitEntity(), org.bukkit.craftbukkit.CraftExplosionResult.toExplosionResult(this.blockInteraction)).callEvent()) {
|
|
+ this.level
|
|
+ .getBlockState(blockPos)
|
|
+ .onExplosionHit(this.level, blockPos, this, (itemStack, blockPos1) -> addOrAppendStack(list, itemStack, blockPos1));
|
|
+ }
|
|
+ // Leaf end - Add BlockExplosionHitEvent
|
|
}
|
|
|
|
for (ServerExplosion.StackCollector stackCollector : list) {
|