Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/main/java/dev/espi/protectionstones/ListenerClass.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,14 @@
import dev.espi.protectionstones.utils.WGUtils;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.ExplosionResult;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.block.*;
import org.bukkit.command.CommandSender;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.AbstractWindCharge;
import org.bukkit.entity.Player;
import org.bukkit.entity.WindCharge;
import org.bukkit.event.Event;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
Expand Down Expand Up @@ -437,12 +438,13 @@ private void pistonUtil(List<Block> pushedBlocks, BlockPistonEvent e) {

@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
public void onBlockExplode(BlockExplodeEvent e) {
explodeUtil(e.blockList(), e.getBlock().getLocation().getWorld(), false);
boolean isWindCharge = e.getExplosionResult() == ExplosionResult.TRIGGER_BLOCK;
this.explodeUtil(e.blockList(), e.getBlock().getLocation().getWorld(), isWindCharge);
}

@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
public void onEntityExplode(EntityExplodeEvent e) {
boolean isWindCharge = e.getEntity() instanceof WindCharge;
boolean isWindCharge = e.getEntity() instanceof AbstractWindCharge || e.getExplosionResult() == ExplosionResult.TRIGGER_BLOCK;
explodeUtil(e.blockList(), e.getLocation().getWorld(), isWindCharge);
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/block1.toml
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ placing_bypasses_wg_passthrough = true
# Recommended to keep true to prevent players from exploiting more protection stones with /ps unhide (when the block is destroyed)
prevent_explode = true

# Prevents the block from being destroyed when exploded wind charge.
# Prevents the block from being destroyed when exploded wind charge, this also affects explosions from enchantments wind_burst.
# Recommended to keep true if you don't want to ban all explosions, but don't want the region to explode using this method
prevent_wind_charge_explode = true

Expand Down
Loading