Some more compilation fixes

This commit is contained in:
Bjarne Koll 2024-04-25 19:42:24 +02:00
parent f4c7639986
commit 9c580566b9
No known key found for this signature in database
GPG key ID: 27F6CCCF55D2EE62
24 changed files with 164 additions and 72 deletions

View file

@ -192,12 +192,54 @@ index 43b049b68a8af548cd05c67dafc23dabd07bab27..6da6c20b684eba64b85d67db2482b4a9
// Paper end
}
diff --git a/src/main/java/org/bukkit/potion/PotionBrewer.java b/src/main/java/org/bukkit/potion/PotionBrewer.java
index 2072f048e10eba829cef047d854b5a22c8f055a3..eb189e170bc4975c5378f95f86ecf2cc880bd931 100644
index 2072f048e10eba829cef047d854b5a22c8f055a3..f81bbaa6d4a991f265e630dc9a3d3945bac78fff 100644
--- a/src/main/java/org/bukkit/potion/PotionBrewer.java
+++ b/src/main/java/org/bukkit/potion/PotionBrewer.java
@@ -45,4 +45,25 @@ public interface PotionBrewer {
@@ -7,7 +7,7 @@ import org.jetbrains.annotations.NotNull;
* Represents a brewer that can create {@link PotionEffect}s.
*/
public interface PotionBrewer {
-
+ // Paper start - keep old spigot methods, removal in 1.20.6
/**
* Creates a {@link PotionEffect} from the given {@link PotionEffectType},
* applying duration modifiers and checks.
@@ -16,9 +16,13 @@ public interface PotionBrewer {
* @param duration The duration in ticks
* @param amplifier The amplifier of the effect
* @return The resulting potion effect
+ * @deprecated use {@link PotionEffectType#createEffect(int, int)} instead.
*/
+ @Deprecated(forRemoval = true, since = "1.20.5")
@NotNull
@Deprecated
- public PotionEffect createEffect(@NotNull PotionEffectType potion, int duration, int amplifier);
+ default PotionEffect createEffect(@NotNull PotionEffectType potion, int duration, int amplifier) {
+ return potion.createEffect(duration, amplifier);
+ }
/**
* Returns a collection of {@link PotionEffect} that would be applied from
@@ -28,9 +32,12 @@ public interface PotionBrewer {
* @return The list of effects
* @deprecated Non-Functional
*/
- @Deprecated
+ @Deprecated(forRemoval = true, since = "1.20.5")
@NotNull
- public Collection<PotionEffect> getEffectsFromDamage(int damage);
+ default Collection<PotionEffect> getEffectsFromDamage(final int damage) {
+ return new java.util.ArrayList<>();
+ }
+ // Paper start - keep old spigot methods, removal in 1.20.6
/**
* Returns a collection of {@link PotionEffect} that would be applied from
@@ -43,6 +50,27 @@ public interface PotionBrewer {
* @deprecated Upgraded / extended potions are now their own {@link PotionType} use {@link PotionType#getPotionEffects()} instead
*/
@NotNull
- @Deprecated
+ @Deprecated(forRemoval = true, since = "1.20.5")
public Collection<PotionEffect> getEffects(@NotNull PotionType type, boolean upgraded, boolean extended);
+
+ // Paper start