diff options
Diffstat (limited to 'patches/api/0298-Missing-Entity-API.patch')
-rw-r--r-- | patches/api/0298-Missing-Entity-API.patch | 136 |
1 files changed, 0 insertions, 136 deletions
diff --git a/patches/api/0298-Missing-Entity-API.patch b/patches/api/0298-Missing-Entity-API.patch index 7dff1ccf46..2e2d58e8f3 100644 --- a/patches/api/0298-Missing-Entity-API.patch +++ b/patches/api/0298-Missing-Entity-API.patch @@ -63,62 +63,6 @@ index 0000000000000000000000000000000000000000..39ad7d283609d7e427a2ab35b6fad839 + SchoolableFish getSchoolLeader(); + +} -diff --git a/src/main/java/io/papermc/paper/potion/SuspiciousEffectEntry.java b/src/main/java/io/papermc/paper/potion/SuspiciousEffectEntry.java -new file mode 100644 -index 0000000000000000000000000000000000000000..c8446678e39e777bd2c9992d5c577f4c7606ce15 ---- /dev/null -+++ b/src/main/java/io/papermc/paper/potion/SuspiciousEffectEntry.java -@@ -0,0 +1,37 @@ -+package io.papermc.paper.potion; -+ -+import org.bukkit.potion.PotionEffectType; -+import org.jetbrains.annotations.Contract; -+import org.jetbrains.annotations.NotNull; -+ -+/** -+ * Represents a {@link PotionEffectType} paired with a duration. -+ */ -+public sealed interface SuspiciousEffectEntry permits SuspiciousEffectEntryImpl { -+ -+ /** -+ * Gets the effect type. -+ * -+ * @return type -+ */ -+ @NotNull PotionEffectType effect(); -+ -+ /** -+ * Gets the duration for this effect instance. -+ * -+ * @return duration (in ticks) -+ */ -+ int duration(); -+ -+ /** -+ * Creates a new instance of SuspiciousEffectEntry. -+ * -+ * @param effectType effect type -+ * @param duration duration (in ticks) -+ * @return new instance of an entry -+ */ -+ @Contract(value = "_, _ -> new", pure = true) -+ static @NotNull SuspiciousEffectEntry create(final @NotNull PotionEffectType effectType, final int duration) { -+ return new SuspiciousEffectEntryImpl(effectType, duration); -+ } -+} -diff --git a/src/main/java/io/papermc/paper/potion/SuspiciousEffectEntryImpl.java b/src/main/java/io/papermc/paper/potion/SuspiciousEffectEntryImpl.java -new file mode 100644 -index 0000000000000000000000000000000000000000..e5002ccaef9ea7a9db94296ad0d66cdae050cdd1 ---- /dev/null -+++ b/src/main/java/io/papermc/paper/potion/SuspiciousEffectEntryImpl.java -@@ -0,0 +1,7 @@ -+package io.papermc.paper.potion; -+ -+import org.bukkit.potion.PotionEffectType; -+import org.jetbrains.annotations.NotNull; -+ -+record SuspiciousEffectEntryImpl(@NotNull PotionEffectType effect, int duration) implements SuspiciousEffectEntry { -+} diff --git a/src/main/java/org/bukkit/entity/AbstractHorse.java b/src/main/java/org/bukkit/entity/AbstractHorse.java index 0d88dce9978243a1f995c5fb448c5d71b01136eb..8b1048c94dffd058eb9fd9144f7f59fc9bd219ad 100644 --- a/src/main/java/org/bukkit/entity/AbstractHorse.java @@ -721,86 +665,6 @@ index 11b6d1aba7d1f6ae1f3c822193486f5a1478e105..709c8fc3dde786f45ff13d6ee6c405ff + void setAggressive(boolean aggressive); + // Paper end } -diff --git a/src/main/java/org/bukkit/entity/MushroomCow.java b/src/main/java/org/bukkit/entity/MushroomCow.java -index cef1700834643fe28ed5737578d91ecefbe99e2f..794b7b4a870a0d289476074e3a3f46552604c954 100644 ---- a/src/main/java/org/bukkit/entity/MushroomCow.java -+++ b/src/main/java/org/bukkit/entity/MushroomCow.java -@@ -95,4 +95,75 @@ public interface MushroomCow extends Cow { - */ - BROWN; - } -+ // Paper start -+ /** -+ * Gets how long the effect applied to stew -+ * from this mushroom cow is. -+ * -+ * @return duration of the effect (in ticks) -+ * @deprecated Mushroom cows can now hold multiple effects, use {@link #getStewEffects()} -+ */ -+ @Deprecated(forRemoval = true) -+ @org.jetbrains.annotations.Contract("-> fail") -+ default int getStewEffectDuration() { -+ throw new UnsupportedOperationException("Mushroom cows can now hold multiple effects. Use #getStewEffects"); -+ } -+ -+ /** -+ * Sets how long the effect applied to stew -+ * from this mushroom cow is. -+ * -+ * @param duration duration of the effect (in ticks) -+ * @deprecated Mushroom cows can now hold multiple effects, use {@link #setStewEffects(java.util.List)} -+ */ -+ @Deprecated(forRemoval = true) -+ @org.jetbrains.annotations.Contract("_ -> fail") -+ default void setStewEffectDuration(int duration) { -+ throw new UnsupportedOperationException("Mushroom cows can now hold multiple effects. Use #setStewEffects"); -+ } -+ -+ /** -+ * Gets the type of effect applied to stew -+ * from this mushroom cow is. -+ * -+ * @return effect type, or null if an effect is currently not set -+ * @deprecated Mushroom cows can now hold multiple effects, use {@link #getStewEffects()} -+ * @throws UnsupportedOperationException -+ */ -+ @Deprecated(forRemoval = true) -+ @org.jetbrains.annotations.Contract("-> fail") -+ default org.bukkit.potion.PotionEffectType getStewEffectType() { -+ throw new UnsupportedOperationException("Mushroom cows can now hold multiple effects. Use #getStewEffects"); -+ } -+ -+ /** -+ * Sets the type of effect applied to stew -+ * from this mushroom cow is. -+ * -+ * @param type new effect type -+ * or null if this cow does not give effects -+ * @deprecated Mushroom cows can now hold multiple effects, use {@link #setStewEffects(java.util.List)} -+ * @throws UnsupportedOperationException -+ */ -+ @Deprecated(forRemoval = true) -+ @org.jetbrains.annotations.Contract("_ -> fail") -+ default void setStewEffect(@org.jetbrains.annotations.Nullable org.bukkit.potion.PotionEffectType type) { -+ throw new UnsupportedOperationException("Mushroom cows can now hold multiple effects. Use #setStewEffects"); -+ } -+ -+ /** -+ * Returns an immutable collection of the effects applied to stew -+ * items for this mushroom cow. -+ * -+ * @return immutable effect entry collection -+ */ -+ java.util.@NotNull @org.jetbrains.annotations.Unmodifiable List<io.papermc.paper.potion.SuspiciousEffectEntry> getStewEffects(); -+ -+ /** -+ * Sets effects applied to stew items for this mushroom cow. -+ * -+ * @param effects effect entry list -+ */ -+ void setStewEffects(java.util.@NotNull List<io.papermc.paper.potion.SuspiciousEffectEntry> effects); -+ // Paper end - } diff --git a/src/main/java/org/bukkit/entity/Panda.java b/src/main/java/org/bukkit/entity/Panda.java index 1f027927a1194f4f8e86c1375a2772e6e261c151..aa5686df134185334a74429576ff0709a604dbfd 100644 --- a/src/main/java/org/bukkit/entity/Panda.java |