mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-21 20:56:45 +01:00
feat: Display explosion particles even after the event got canceled (with setting to control behavior) (#3436)
* feat: display explosion particles even after event cancel And add settings option to change behavior * refactor * refactor: Change settings comment to clearer connect to it's purpose.
This commit is contained in:
parent
2c55c6a92e
commit
b43d08f4aa
@ -48,6 +48,7 @@ import com.plotsquared.core.util.Permissions;
|
||||
import com.sk89q.worldedit.bukkit.BukkitAdapter;
|
||||
import com.sk89q.worldedit.world.block.BlockType;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Ageable;
|
||||
@ -323,6 +324,10 @@ public class EntityEventListener implements Listener {
|
||||
}
|
||||
}
|
||||
event.setCancelled(true);
|
||||
//Spawn Explosion Particles when enabled in settings
|
||||
if (Settings.General.ALWAYS_SHOW_EXPLOSIONS) {
|
||||
event.getLocation().getWorld().spawnParticle(Particle.EXPLOSION_HUGE, event.getLocation(), 0);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
|
@ -279,6 +279,8 @@ public class Settings extends Config {
|
||||
public static boolean SCIENTIFIC = false;
|
||||
@Comment("Replace wall when merging")
|
||||
public static boolean MERGE_REPLACE_WALL = true;
|
||||
@Comment("Always show explosion Particles, even if explosion flag is set to false")
|
||||
public static boolean ALWAYS_SHOW_EXPLOSIONS = false;
|
||||
@Comment({"Blocks that may not be used in plot components",
|
||||
"Checkout the wiki article regarding plot components before modifying: https://github.com/IntellectualSites/PlotSquared-Documentation/wiki/Plot-Components"})
|
||||
public static List<String>
|
||||
|
Loading…
Reference in New Issue
Block a user