From 93048da2672d4843808fceebe06730974bf6ef44 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 19 Dec 2017 16:24:42 -0500 Subject: [PATCH] Add World#createExplosion(Location, float, boolean, boolean) API diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java index 0bc47dd6..7687f882 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -754,6 +754,22 @@ public interface World extends PluginMessageRecipient, Metadatable { */ public boolean createExplosion(Location loc, float power, boolean setFire); + // Paper start + /** + * Creates explosion at given coordinates with given power and optionally + * setting blocks on fire or breaking blocks. + * + * @param loc Location to blow up + * @param power The power of explosion, where 4F is TNT + * @param setFire Whether or not to set blocks on fire + * @param breakBlocks Whether or not to have blocks be destroyed + * @return false if explosion was canceled, otherwise true + */ + public default boolean createExplosion(Location loc, float power, boolean setFire, boolean breakBlocks) { + return createExplosion(loc.getX(), loc.getY(), loc.getZ(), power, setFire, breakBlocks); + } + // Paper end + /** * Gets the {@link Environment} type of this world * -- 2.15.1