Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-22 14:28:09 +01:00
50 Zeilen
1.9 KiB
Diff
50 Zeilen
1.9 KiB
Diff
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||
|
From: KennyTV <jahnke.nassim@gmail.com>
|
||
|
Date: Sun, 26 Jul 2020 14:44:16 +0200
|
||
|
Subject: [PATCH] More lightning API
|
||
|
|
||
|
|
||
|
diff --git a/src/main/java/org/bukkit/entity/LightningStrike.java b/src/main/java/org/bukkit/entity/LightningStrike.java
|
||
|
index be347c3d0291f44036bae29a4e7e4645d6a4cdf6..2c81a3f685588431a3c7675c84b35a28975232af 100644
|
||
|
--- a/src/main/java/org/bukkit/entity/LightningStrike.java
|
||
|
+++ b/src/main/java/org/bukkit/entity/LightningStrike.java
|
||
|
@@ -31,4 +31,38 @@ public interface LightningStrike extends Entity {
|
||
|
@Override
|
||
|
Spigot spigot();
|
||
|
// Spigot end
|
||
|
+
|
||
|
+ // Paper start
|
||
|
+ /**
|
||
|
+ * Returns the amount of flash iterations that will be done before the lightning dies.
|
||
|
+ *
|
||
|
+ * @see #getLifeTicks() for how long the current flash will last
|
||
|
+ * @return amount of flashes that will be shown before the lightning dies
|
||
|
+ */
|
||
|
+ int getFlashCount();
|
||
|
+
|
||
|
+ /**
|
||
|
+ * Sets the amount of life iterations that will be done before the lightning dies.
|
||
|
+ * Default number of flashes on creation is between 1-3.
|
||
|
+ *
|
||
|
+ * @param flashes amount of iterations that will be done before the lightning dies, must to be a positive number
|
||
|
+ */
|
||
|
+ void setFlashCount(int flashes);
|
||
|
+
|
||
|
+ /**
|
||
|
+ * Returns the amount of ticks the current flash will do damage for.
|
||
|
+ * Starts with 2 by default, will damage while it is equal to or above 0, with the next flash beginning somewhere between 0 and -9.
|
||
|
+ *
|
||
|
+ * @return ticks the current flash will do damage for
|
||
|
+ */
|
||
|
+ int getLifeTicks();
|
||
|
+
|
||
|
+ /**
|
||
|
+ * Sets the amount of ticks the current flash will do damage/fire for.
|
||
|
+ * Default is 2 for each flash, on which the sound and effect will also be played.
|
||
|
+ *
|
||
|
+ * @param lifeTicks ticks the current flash will do damage for
|
||
|
+ */
|
||
|
+ void setLifeTicks(int lifeTicks);
|
||
|
+ // Paper end
|
||
|
}
|