SPIGOT-5753: Back PotionType by a minecraft registry
By: DerFrZocker <derrieple@gmail.com>
This commit is contained in:
@@ -3,6 +3,10 @@ package org.bukkit.potion;
|
||||
import com.google.common.base.Preconditions;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* @deprecated Upgraded / extended potions are now their own {@link PotionType} use them instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public final class PotionData {
|
||||
|
||||
private final PotionType type;
|
||||
@@ -24,6 +28,8 @@ public final class PotionData {
|
||||
Preconditions.checkArgument(!upgraded || type.isUpgradeable(), "Potion Type is not upgradable");
|
||||
Preconditions.checkArgument(!extended || type.isExtendable(), "Potion Type is not extendable");
|
||||
Preconditions.checkArgument(!upgraded || !extended, "Potion cannot be both extended and upgraded");
|
||||
Preconditions.checkArgument(!type.getKey().getKey().startsWith("strong_"), "Strong potion type cannot be used directly, got %s", type.getKey());
|
||||
Preconditions.checkArgument(!type.getKey().getKey().startsWith("long_"), "Extended potion type cannot be used directly, got %s", type.getKey());
|
||||
this.type = type;
|
||||
this.extended = extended;
|
||||
this.upgraded = upgraded;
|
||||
|
||||
Reference in New Issue
Block a user