From d432386d58dc56f962f52eb59468d49435be463c Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Sun, 2 Apr 2023 13:21:31 +1000 Subject: [PATCH] #836: Add missing API for explosive minecarts By: Parker Hawke --- .../entity/minecart/ExplosiveMinecart.java | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/paper-api/src/main/java/org/bukkit/entity/minecart/ExplosiveMinecart.java b/paper-api/src/main/java/org/bukkit/entity/minecart/ExplosiveMinecart.java index a4411daca0..8636fe6c4d 100644 --- a/paper-api/src/main/java/org/bukkit/entity/minecart/ExplosiveMinecart.java +++ b/paper-api/src/main/java/org/bukkit/entity/minecart/ExplosiveMinecart.java @@ -6,4 +6,49 @@ import org.bukkit.entity.Minecart; * Represents a Minecart with TNT inside it that can explode when triggered. */ public interface ExplosiveMinecart extends Minecart { + + /** + * Set the fuse ticks of this minecart. + * + * If the fuse ticks are set to a non-zero value, this will ignite the + * explosive. + * + * @param ticks the ticks + */ + public void setFuseTicks(int ticks); + + /** + * Get the fuse ticks of this minecart. + * + * If the fuse ticks reach 0, the minecart will explode. + * + * @return the fuse ticks, or -1 if this minecart's fuse has not yet been + * ignited + */ + public int getFuseTicks(); + + /** + * Ignite this minecart's fuse naturally. + */ + public void ignite(); + + /** + * Check whether or not this minecart's fuse has been ignited. + * + * @return true if ignited, false otherwise + */ + public boolean isIgnited(); + + /** + * Immediately explode this minecart with the power assumed by its current + * movement. + */ + public void explode(); + + /** + * Immediately explode this minecart with the given power. + * + * @param power the power to use. Must be positive and cannot exceed 5.0 + */ + public void explode(double power); }