Package be.seeseemelk.mockbukkit.potion
Class MockPotionEffectType
java.lang.Object
org.bukkit.potion.PotionEffectType
be.seeseemelk.mockbukkit.potion.MockPotionEffectType
- All Implemented Interfaces:
io.papermc.paper.world.flag.FeatureDependant,net.kyori.adventure.key.Keyed,net.kyori.adventure.translation.Translatable,org.bukkit.Keyed,org.bukkit.Translatable
public class MockPotionEffectType
extends org.bukkit.potion.PotionEffectType
This
MockPotionEffectType mocks an actual PotionEffectType by taking an id, a name, whether it is
instant and an RGB Color variable.-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.potion.PotionEffectType
org.bukkit.potion.PotionEffectType.Category -
Field Summary
Fields inherited from class org.bukkit.potion.PotionEffectType
ABSORPTION, BAD_OMEN, BLINDNESS, CONDUIT_POWER, DARKNESS, DOLPHINS_GRACE, FIRE_RESISTANCE, GLOWING, HASTE, HEALTH_BOOST, HERO_OF_THE_VILLAGE, HUNGER, INFESTED, INSTANT_DAMAGE, INSTANT_HEALTH, INVISIBILITY, JUMP_BOOST, LEVITATION, LUCK, MINING_FATIGUE, NAUSEA, NIGHT_VISION, OOZING, POISON, RAID_OMEN, REGENERATION, RESISTANCE, SATURATION, SLOW_FALLING, SLOWNESS, SPEED, STRENGTH, TRIAL_OMEN, UNLUCK, WATER_BREATHING, WEAKNESS, WEAVING, WIND_CHARGED, WITHER -
Constructor Summary
ConstructorsConstructorDescriptionMockPotionEffectType(com.google.gson.JsonObject data) Deprecated, for removal: This API element is subject to removal in a future version.MockPotionEffectType(@NotNull org.bukkit.NamespacedKey key, int id, @NotNull String name, boolean instant, @NotNull org.bukkit.Color color, @NotNull org.bukkit.potion.PotionEffectType.Category category, String translationKey) MockPotionEffectType(@NotNull org.bukkit.NamespacedKey key, int id, String name, boolean instant, org.bukkit.Color color) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttributeModifier(org.bukkit.attribute.Attribute attribute, org.bukkit.attribute.AttributeModifier modifier) Adds an attribute modifier to this potion effect type.@NotNull org.bukkit.potion.PotionEffectcreateEffect(int duration, int amplifier) booleanstatic org.bukkit.Keyedfrom(com.google.gson.JsonObject data) doublegetAttributeModifierAmount(@NotNull org.bukkit.attribute.Attribute attribute, int effectAmplifier) @NotNull org.bukkit.potion.PotionEffectTypeCategory@NotNull org.bukkit.ColorgetColor()doubleDeprecated.@NotNull Map<org.bukkit.attribute.Attribute, org.bukkit.attribute.AttributeModifier> @NotNull org.bukkit.potion.PotionEffectType.CategoryintgetId()Deprecated.@NotNull org.bukkit.NamespacedKeygetKey()@NotNull StringgetName()@NotNull StringinthashCode()boolean@NotNull StringMethods inherited from class org.bukkit.potion.PotionEffectType
getById, getByKey, getByName, valuesMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.papermc.paper.world.flag.FeatureDependant
requiredFeaturesMethods inherited from interface org.bukkit.Keyed
key
-
Constructor Details
-
MockPotionEffectType
@Internal public MockPotionEffectType(@NotNull @NotNull org.bukkit.NamespacedKey key, int id, @NotNull @NotNull String name, boolean instant, @NotNull @NotNull org.bukkit.Color color, @NotNull @NotNull org.bukkit.potion.PotionEffectType.Category category, String translationKey) - Parameters:
key- The namespaced key representing this effectid- The magic number representing this effectname- The name of this effectinstant- Whether the effect is instant or notcolor- The color of the effectcategory- The category of the effecttranslationKey- The translation key for this potion effect type
-
MockPotionEffectType
@Deprecated(forRemoval=true) public MockPotionEffectType(@NotNull @NotNull org.bukkit.NamespacedKey key, int id, String name, boolean instant, org.bukkit.Color color) Deprecated, for removal: This API element is subject to removal in a future version.Constructs a newMockPotionEffectTypewith the provided parameters.- Parameters:
key- The key of the effect type.id- The numerical ID of the effect type.name- The name of the effect type.instant- Whether the effect type is instantly applied.color- The color of the effect type.
-
MockPotionEffectType
Deprecated, for removal: This API element is subject to removal in a future version.- Parameters:
data- Json data
-
-
Method Details
-
getDurationModifier
Deprecated.- Specified by:
getDurationModifierin classorg.bukkit.potion.PotionEffectType
-
getName
- Specified by:
getNamein classorg.bukkit.potion.PotionEffectType
-
getId
Deprecated.- Specified by:
getIdin classorg.bukkit.potion.PotionEffectType
-
getKey
@NotNull public @NotNull org.bukkit.NamespacedKey getKey() -
createEffect
@NotNull public @NotNull org.bukkit.potion.PotionEffect createEffect(int duration, int amplifier) - Specified by:
createEffectin classorg.bukkit.potion.PotionEffectType
-
isInstant
public boolean isInstant()- Specified by:
isInstantin classorg.bukkit.potion.PotionEffectType
-
getCategory
@NotNull public @NotNull org.bukkit.potion.PotionEffectTypeCategory getCategory()- Specified by:
getCategoryin classorg.bukkit.potion.PotionEffectType
-
getColor
@NotNull public @NotNull org.bukkit.Color getColor()- Specified by:
getColorin classorg.bukkit.potion.PotionEffectType
-
equals
-
hashCode
public int hashCode() -
addAttributeModifier
public void addAttributeModifier(org.bukkit.attribute.Attribute attribute, org.bukkit.attribute.AttributeModifier modifier) Adds an attribute modifier to this potion effect type.- Parameters:
attribute- The attribute to modify.modifier- The modifier to apply.
-
getEffectAttributes
@NotNull public @NotNull Map<org.bukkit.attribute.Attribute,org.bukkit.attribute.AttributeModifier> getEffectAttributes()- Specified by:
getEffectAttributesin classorg.bukkit.potion.PotionEffectType
-
getAttributeModifierAmount
public double getAttributeModifierAmount(@NotNull @NotNull org.bukkit.attribute.Attribute attribute, int effectAmplifier) - Specified by:
getAttributeModifierAmountin classorg.bukkit.potion.PotionEffectType
-
getEffectCategory
@NotNull public @NotNull org.bukkit.potion.PotionEffectType.Category getEffectCategory()- Specified by:
getEffectCategoryin classorg.bukkit.potion.PotionEffectType
-
translationKey
-
from
@Internal public static org.bukkit.Keyed from(com.google.gson.JsonObject data) -
getTranslationKey
-