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
ConstructorsConstructorDescriptionElytraCap(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) -
Method Summary
Modifier and TypeMethodDescriptionvoiddamageItem(Player p, ItemStack item) This method will damage the givenItemStackonce.booleanevaluateUnbreakingEnchantment(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 setNamespacedKeyof thisSlimefunArmorPiece.booleanImplement this method to make the behaviour of this interface dependent on the state of your object.booleanThis returns whether the full set is required forPlayer's protection on assignedProtectionTypedamages.Methods inherited from class io.github.thebusybiscuit.slimefun4.implementation.items.armor.SlimefunArmorPiece
getPotionEffectsMethods 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, warnMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.github.thebusybiscuit.slimefun4.core.attributes.ItemAttribute
getIdMethods 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:DamageableItemImplement this method to make the behaviour of this interface dependent on the state of your object. You could add aConfigoption to toggle the behaviour for example.- Specified by:
isDamageablein interfaceDamageableItem- Returns:
- Whether this
SlimefunItemis damageable
-
damageItem
Description copied from interface:DamageableItemThis method will damage the givenItemStackonce. It also takes into account theEnchantmentUnbreaking. It will only apply the damage ifDamageableItem.isDamageable()returned true.- Specified by:
damageItemin interfaceDamageableItem- Parameters:
p- ThePlayerto which the item belongsitem- TheItemStackto damage
-
evaluateUnbreakingEnchantment
public boolean evaluateUnbreakingEnchantment(int unbreakingLevel) Description copied from interface:DamageableItemThis 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:
evaluateUnbreakingEnchantmentin interfaceDamageableItem- Parameters:
unbreakingLevel- TheIntegerlevel of the unbreakingEnchantment- Returns:
- Whether to save the item from taking damage
-
getProtectionTypes
Description copied from interface:ProtectiveArmor- Specified by:
getProtectionTypesin interfaceProtectiveArmor- Returns:
- The
ProtectionTypes.
-
isFullSetRequired
public boolean isFullSetRequired()Description copied from interface:ProtectiveArmorThis returns whether the full set is required forPlayer's protection on assignedProtectionTypedamages.- Specified by:
isFullSetRequiredin interfaceProtectiveArmor- Returns:
- Whether or not he full set is required.
-
getArmorSetId
Description copied from interface:ProtectiveArmorThis returns the armor setNamespacedKeyof thisSlimefunArmorPiece.- Specified by:
getArmorSetIdin interfaceProtectiveArmor- Returns:
- The set
NamespacedKey,nullif none is found.
-