2022-03-11 17:37:08 +01:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
|
|
|
|
Date: Wed, 26 May 2021 19:34:43 -0400
|
|
|
|
Subject: [PATCH] More Projectile API
|
|
|
|
|
2022-08-14 16:53:36 +02:00
|
|
|
Co-authored-by: Nassim Jahnke <nassim@njahnke.dev>
|
2022-03-11 17:37:08 +01:00
|
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/entity/Firework.java b/src/main/java/org/bukkit/entity/Firework.java
|
|
|
|
index d616d5941b3c7b85e350e845901da798601b9a3c..b7a6e3b1ac327c4e03f9d73952c1ce4d54967cf4 100644
|
|
|
|
--- a/src/main/java/org/bukkit/entity/Firework.java
|
|
|
|
+++ b/src/main/java/org/bukkit/entity/Firework.java
|
|
|
|
@@ -15,6 +15,8 @@ public interface Firework extends Projectile {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Apply the provided meta to the fireworks
|
|
|
|
+ * <p>
|
|
|
|
+ * Adjusts detonation ticks automatically.
|
|
|
|
*
|
|
|
|
* @param meta The FireworkMeta to apply
|
|
|
|
*/
|
|
|
|
@@ -54,4 +56,52 @@ public interface Firework extends Projectile {
|
|
|
|
@org.jetbrains.annotations.Nullable
|
|
|
|
public LivingEntity getBoostedEntity();
|
|
|
|
// Paper end
|
|
|
|
+
|
|
|
|
+ // Paper start - Firework API
|
|
|
|
+ /**
|
|
|
|
+ * Gets the item used in the firework.
|
|
|
|
+ *
|
|
|
|
+ * @return firework item
|
|
|
|
+ */
|
|
|
|
+ @NotNull
|
|
|
|
+ public org.bukkit.inventory.ItemStack getItem();
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Sets the item used in the firework.
|
|
|
|
+ * <p>
|
|
|
|
+ * Firework explosion effects are used from this item.
|
|
|
|
+ *
|
|
|
|
+ * @param itemStack item to set
|
|
|
|
+ */
|
|
|
|
+ void setItem(@org.jetbrains.annotations.Nullable org.bukkit.inventory.ItemStack itemStack);
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Gets the number of ticks the firework has flown.
|
|
|
|
+ *
|
|
|
|
+ * @return ticks flown
|
|
|
|
+ */
|
|
|
|
+ int getTicksFlown();
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Sets the number of ticks the firework has flown.
|
|
|
|
+ * Setting this greater than detonation ticks will cause the firework to explode.
|
|
|
|
+ *
|
|
|
|
+ * @param ticks ticks flown
|
|
|
|
+ */
|
|
|
|
+ void setTicksFlown(int ticks);
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Gets the number of ticks the firework will detonate on.
|
|
|
|
+ *
|
|
|
|
+ * @return the tick to detonate on
|
|
|
|
+ */
|
|
|
|
+ int getTicksToDetonate();
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Set the amount of ticks the firework will detonate on.
|
|
|
|
+ *
|
|
|
|
+ * @param ticks ticks to detonate on
|
|
|
|
+ */
|
|
|
|
+ void setTicksToDetonate(int ticks);
|
|
|
|
+ // Paper stop
|
|
|
|
}
|
2022-03-13 23:33:01 +01:00
|
|
|
diff --git a/src/main/java/org/bukkit/entity/FishHook.java b/src/main/java/org/bukkit/entity/FishHook.java
|
|
|
|
index d1b37530319f6d37ee37f62080289c1e45848bc8..e94c7e279356c510f60508b26277d4891a4258fa 100644
|
|
|
|
--- a/src/main/java/org/bukkit/entity/FishHook.java
|
|
|
|
+++ b/src/main/java/org/bukkit/entity/FishHook.java
|
|
|
|
@@ -162,4 +162,20 @@ public interface FishHook extends Projectile {
|
|
|
|
*/
|
|
|
|
BOBBING;
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ // Paper start - More FishHook API
|
|
|
|
+ /**
|
|
|
|
+ * Get the number of ticks the hook needs to wait for a fish to bite.
|
|
|
|
+ *
|
|
|
|
+ * @return Number of ticks
|
|
|
|
+ */
|
|
|
|
+ int getWaitTime();
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Sets the number of ticks the hook needs to wait for a fish to bite.
|
|
|
|
+ *
|
|
|
|
+ * @param ticks Number of ticks
|
|
|
|
+ */
|
|
|
|
+ void setWaitTime(int ticks);
|
|
|
|
+ // Paper end
|
|
|
|
}
|
2022-03-11 17:37:08 +01:00
|
|
|
diff --git a/src/main/java/org/bukkit/entity/ThrownPotion.java b/src/main/java/org/bukkit/entity/ThrownPotion.java
|
2022-08-17 13:02:35 +02:00
|
|
|
index 7051e07b4e456aae0ec9e37808b59e5fa62a4027..225ac312613b9e8f3cf680819f2ebe350d1bf48a 100644
|
2022-03-11 17:37:08 +01:00
|
|
|
--- a/src/main/java/org/bukkit/entity/ThrownPotion.java
|
|
|
|
+++ b/src/main/java/org/bukkit/entity/ThrownPotion.java
|
2022-08-17 13:02:35 +02:00
|
|
|
@@ -32,12 +32,34 @@ public interface ThrownPotion extends ThrowableProjectile {
|
2022-03-11 17:37:08 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the ItemStack for this thrown potion.
|
|
|
|
- * <p>
|
|
|
|
- * The ItemStack must be of type {@link org.bukkit.Material#SPLASH_POTION}
|
|
|
|
- * or {@link org.bukkit.Material#LINGERING_POTION}, otherwise an exception
|
|
|
|
- * is thrown.
|
|
|
|
*
|
|
|
|
* @param item New ItemStack
|
|
|
|
*/
|
|
|
|
public void setItem(@NotNull ItemStack item);
|
|
|
|
+
|
|
|
|
+ // Paper start - Projectile API
|
|
|
|
+ /**
|
|
|
|
+ * Gets a copy of the PotionMeta for this thrown potion.
|
|
|
|
+ * This includes what effects will be applied by this potion.
|
|
|
|
+ *
|
|
|
|
+ * @return potion meta
|
|
|
|
+ */
|
|
|
|
+ @NotNull
|
|
|
|
+ org.bukkit.inventory.meta.PotionMeta getPotionMeta();
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Sets the PotionMeta of this thrown potion.
|
|
|
|
+ * This will modify the effects applied by this potion.
|
|
|
|
+ * <p>
|
|
|
|
+ * Note that the type of {@link #getItem()} is irrelevant
|
|
|
|
+ *
|
|
|
|
+ * @param meta potion meta
|
|
|
|
+ */
|
|
|
|
+ void setPotionMeta(@NotNull org.bukkit.inventory.meta.PotionMeta meta);
|
2022-08-14 16:53:36 +02:00
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Splashes the potion at its current location.
|
|
|
|
+ */
|
|
|
|
+ void splash();
|
2022-03-11 17:37:08 +01:00
|
|
|
+ // Paper end
|
|
|
|
}
|