Class ElytraCap
java.lang.Object
io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem
io.github.thebusybiscuit.slimefun4.implementation.items.armor.SlimefunArmorPiece
io.github.thebusybiscuit.slimefun4.implementation.items.armor.ElytraCap
- All Implemented Interfaces:
DamageableItem
,ItemAttribute
,Placeable
,ProtectiveArmor
The
ElytraCap
negates damage taken when crashing into a wall using an elytra.- Author:
- Seggan
- See Also:
-
Field Summary
Fields inherited from class io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem
addon, disenchantable, enchantable, hidden, recipeOutput, useableInWorkbench
-
Constructor Summary
ConstructorDescriptionElytraCap
(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) -
Method Summary
Modifier and TypeMethodDescriptionvoid
damageItem
(Player p, ItemStack item) This method will damage the givenItemStack
once.boolean
evaluateUnbreakingEnchantment
(int unbreakingLevel) This method will randomly decide if the item should be damaged or not This does not damage the item, it is called byDamageableItem.damageItem(Player, ItemStack)
to randomly generate a boolean This function should be overridden when the item type is not a tool which is the default valueThis returns the armor setNamespacedKey
of thisSlimefunArmorPiece
.boolean
Implement this method to make the behaviour of this interface dependent on the state of your object.boolean
This returns whether the full set is required forPlayer
's protection on assignedProtectionType
damages.Methods inherited from class io.github.thebusybiscuit.slimefun4.implementation.items.armor.SlimefunArmorPiece
getPotionEffects
Methods inherited from class io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem
addItemHandler, addItemSetting, addOfficialWikipage, callItemHandler, canUse, equals, error, getAddon, getBlockTicker, getById, getByItem, getDrops, getDrops, getHandlers, getId, getItem, getItemGroup, getItemName, getItemSetting, getItemSettings, getOptionalById, getOptionalByItem, getRecipe, getRecipeOutput, getRecipeType, getResearch, getState, getWikipage, hashCode, hasResearch, info, isDisabled, isDisabledIn, isDisenchantable, isEnchantable, isHidden, isItem, isItemStackImmutable, isTicking, isUseableInWorkbench, load, postRegister, preRegister, register, sendDeprecationWarning, setHidden, setItemGroup, setRecipe, setRecipeOutput, setRecipeType, setResearch, setUseableInWorkbench, toString, warn
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.github.thebusybiscuit.slimefun4.core.attributes.ItemAttribute
getId
Methods inherited from interface io.github.thebusybiscuit.slimefun4.core.attributes.Placeable
useVanillaBlockBreaking
-
Constructor Details
-
ElytraCap
@ParametersAreNonnullByDefault public ElytraCap(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe)
-
-
Method Details
-
isDamageable
public boolean isDamageable()Description copied from interface:DamageableItem
Implement this method to make the behaviour of this interface dependent on the state of your object. You could add aConfig
option to toggle the behaviour for example.- Specified by:
isDamageable
in interfaceDamageableItem
- Returns:
- Whether this
SlimefunItem
is damageable
-
damageItem
Description copied from interface:DamageableItem
This method will damage the givenItemStack
once. It also takes into account theEnchantment
Unbreaking
. It will only apply the damage ifDamageableItem.isDamageable()
returned true.- Specified by:
damageItem
in interfaceDamageableItem
- Parameters:
p
- ThePlayer
to which the item belongsitem
- TheItemStack
to damage
-
evaluateUnbreakingEnchantment
public boolean evaluateUnbreakingEnchantment(int unbreakingLevel) Description copied from interface:DamageableItem
This method will randomly decide if the item should be damaged or not This does not damage the item, it is called byDamageableItem.damageItem(Player, ItemStack)
to randomly generate a boolean This function should be overridden when the item type is not a tool which is the default value- Specified by:
evaluateUnbreakingEnchantment
in interfaceDamageableItem
- Parameters:
unbreakingLevel
- TheInteger
level of the unbreakingEnchantment
- Returns:
- Whether to save the item from taking damage
-
getProtectionTypes
Description copied from interface:ProtectiveArmor
- Specified by:
getProtectionTypes
in interfaceProtectiveArmor
- Returns:
- The
ProtectionType
s.
-
isFullSetRequired
public boolean isFullSetRequired()Description copied from interface:ProtectiveArmor
This returns whether the full set is required forPlayer
's protection on assignedProtectionType
damages.- Specified by:
isFullSetRequired
in interfaceProtectiveArmor
- Returns:
- Whether or not he full set is required.
-
getArmorSetId
Description copied from interface:ProtectiveArmor
This returns the armor setNamespacedKey
of thisSlimefunArmorPiece
.- Specified by:
getArmorSetId
in interfaceProtectiveArmor
- Returns:
- The set
NamespacedKey
,null
if none is found.
-