SPIGOT-5753: Back PotionType by a minecraft registry

By: DerFrZocker <derrieple@gmail.com>
This commit is contained in:
Bukkit/Spigot
2023-10-09 20:22:49 +11:00
parent 199105c1d5
commit 5889c180cc
8 changed files with 192 additions and 35 deletions

View File

@@ -6,6 +6,7 @@ import org.bukkit.Particle;
import org.bukkit.potion.PotionData;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import org.bukkit.potion.PotionType;
import org.bukkit.projectiles.ProjectileSource;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -149,17 +150,36 @@ public interface AreaEffectCloud extends Entity {
* Sets the underlying potion data
*
* @param data PotionData to set the base potion state to
* @deprecated Upgraded / extended potions are now their own {@link PotionType} use {@link #setBasePotionType} instead.
*/
@Deprecated
void setBasePotionData(@NotNull PotionData data);
/**
* Returns the potion data about the base potion
*
* @return a PotionData object
* @deprecated Upgraded / extended potions are now their own {@link PotionType} use {@link #getBasePotionType()} instead.
*/
@NotNull
@Deprecated
PotionData getBasePotionData();
/**
* Sets the underlying potion type
*
* @param type PotionType to set the base potion state to
*/
void setBasePotionType(@NotNull PotionType type);
/**
* Returns the potion type about the base potion
*
* @return a PotionType object
*/
@NotNull
PotionType getBasePotionType();
/**
* Checks for the presence of custom potion effects.
*

View File

@@ -5,6 +5,7 @@ import org.bukkit.Color;
import org.bukkit.potion.PotionData;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import org.bukkit.potion.PotionType;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -14,17 +15,36 @@ public interface Arrow extends AbstractArrow {
* Sets the underlying potion data
*
* @param data PotionData to set the base potion state to
* @deprecated Upgraded / extended potions are now their own {@link PotionType} use {@link #setBasePotionType} instead.
*/
@Deprecated
void setBasePotionData(@NotNull PotionData data);
/**
* Returns the potion data about the base potion
*
* @return a PotionData object
* @deprecated Upgraded / extended potions are now their own {@link PotionType} use {@link #getBasePotionType()} instead.
*/
@NotNull
@Deprecated
PotionData getBasePotionData();
/**
* Sets the underlying potion type
*
* @param type PotionType to set the base potion state to
*/
void setBasePotionType(@NotNull PotionType type);
/**
* Returns the potion type about the base potion
*
* @return a PotionType object
*/
@NotNull
PotionType getBasePotionType();
/**
* Gets the color of this arrow.
*