Package be.seeseemelk.mockbukkit.potion
Class MockPotionEffectType
java.lang.Object
org.bukkit.potion.PotionEffectType
be.seeseemelk.mockbukkit.potion.MockPotionEffectType
- All Implemented Interfaces:
FeatureDependant,net.kyori.adventure.key.Keyed,net.kyori.adventure.translation.Translatable,Keyed,Translatable
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
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 NamespacedKey key, int id, @NotNull String name, boolean instant, @NotNull Color color, @NotNull PotionEffectType.Category category, String translationKey) MockPotionEffectType(@NotNull NamespacedKey key, int id, String name, boolean instant, Color color) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttributeModifier(Attribute attribute, AttributeModifier modifier) Adds an attribute modifier to this potion effect type.@NotNull PotionEffectcreateEffect(int duration, int amplifier) booleanstatic Keyedfrom(com.google.gson.JsonObject data) doublegetAttributeModifierAmount(@NotNull Attribute attribute, int effectAmplifier) @NotNull PotionEffectTypeCategory@NotNull ColorgetColor()doubleDeprecated.@NotNull Map<Attribute, AttributeModifier> @NotNull PotionEffectType.CategoryintgetId()Deprecated.@NotNull 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
requiredFeatures
-
Constructor Details
-
MockPotionEffectType
@Internal public MockPotionEffectType(@NotNull @NotNull NamespacedKey key, int id, @NotNull @NotNull String name, boolean instant, @NotNull @NotNull Color color, @NotNull @NotNull 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 NamespacedKey key, int id, String name, boolean instant, 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 classPotionEffectType
-
getName
- Specified by:
getNamein classPotionEffectType
-
getId
Deprecated.- Specified by:
getIdin classPotionEffectType
-
getKey
-
createEffect
- Specified by:
createEffectin classPotionEffectType
-
isInstant
public boolean isInstant()- Specified by:
isInstantin classPotionEffectType
-
getCategory
- Specified by:
getCategoryin classPotionEffectType
-
getColor
- Specified by:
getColorin classPotionEffectType
-
equals
-
hashCode
public int hashCode() -
addAttributeModifier
Adds an attribute modifier to this potion effect type.- Parameters:
attribute- The attribute to modify.modifier- The modifier to apply.
-
getEffectAttributes
- Specified by:
getEffectAttributesin classPotionEffectType
-
getAttributeModifierAmount
public double getAttributeModifierAmount(@NotNull @NotNull Attribute attribute, int effectAmplifier) - Specified by:
getAttributeModifierAmountin classPotionEffectType
-
getEffectCategory
- Specified by:
getEffectCategoryin classPotionEffectType
-
translationKey
-
from
-
getTranslationKey
-