Largely restore deprecated PotionData API

By: md_5 <git@md-5.net>
This commit is contained in:
Bukkit/Spigot
2024-05-05 20:45:43 +10:00
parent d8b68e62df
commit 26f4f1cf7d
4 changed files with 153 additions and 0 deletions

View File

@@ -3,6 +3,7 @@ package org.bukkit.entity;
import java.util.List;
import org.bukkit.Color;
import org.bukkit.Particle;
import org.bukkit.potion.PotionData;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import org.bukkit.potion.PotionType;
@@ -145,6 +146,25 @@ public interface AreaEffectCloud extends Entity {
*/
<T> void setParticle(@NotNull Particle particle, @Nullable T data);
/**
* 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(@Nullable 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.
*/
@Nullable
@Deprecated
PotionData getBasePotionData();
/**
* Sets the underlying potion type
*

View File

@@ -2,6 +2,7 @@ package org.bukkit.entity;
import java.util.List;
import org.bukkit.Color;
import org.bukkit.potion.PotionData;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import org.bukkit.potion.PotionType;
@@ -10,6 +11,25 @@ import org.jetbrains.annotations.Nullable;
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(@Nullable 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.
*/
@Nullable
@Deprecated
PotionData getBasePotionData();
/**
* Sets the underlying potion type
*