Skip to content

Commit

Permalink
fix: wind_burst shouldn't break sf block when mobGriefing is disa…
Browse files Browse the repository at this point in the history
…bled
  • Loading branch information
StarWishsama committed Feb 7, 2025
1 parent 7f444c5 commit 94467a8
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import java.util.List;
import javax.annotation.Nonnull;
import javax.annotation.ParametersAreNonnullByDefault;
import org.bukkit.ExplosionResult;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.EntityType;
Expand All @@ -31,10 +32,8 @@
* calls the explosive part of the {@link BlockBreakHandler}.
*
* @author TheBusyBiscuit
*
* @see BlockBreakHandler
* @see WitherProof
*
*/
public class ExplosionsListener implements Listener {

Expand All @@ -49,7 +48,8 @@ public void onEntityExplode(EntityExplodeEvent e) {
* so we just ignore it.
*/
if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_21)
&& e.getEntityType() == EntityType.WIND_CHARGE) {
&& (e.getEntityType() == EntityType.WIND_CHARGE
|| e.getEntityType() == EntityType.BREEZE_WIND_CHARGE)) {
return;
}

Expand All @@ -58,6 +58,11 @@ public void onEntityExplode(EntityExplodeEvent e) {

@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onBlockExplode(BlockExplodeEvent e) {
if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_21)
&& e.getExplosionResult() == ExplosionResult.TRIGGER_BLOCK) {
return;
}

removeResistantBlocks(e.blockList().iterator());
}

Expand Down

0 comments on commit 94467a8

Please sign in to comment.