Class Item

All Implemented Interfaces:
ICommonType, IItem, IItemWithModel, IItemWithTexture, IMCItemProvider, ISpecialInfoHolder, ITabContainedElement

  • Field Details

    • renderType

      public int renderType
    • texture

      public TextureHolder texture
    • customModelName

      @Nonnull public String customModelName
    • customProperties

      public Map<String,Procedure> customProperties
    • states

      public List<Item.StateEntry> states
    • name

      public String name
    • rarity

      public String rarity
    • creativeTabs

      public List<TabEntry> creativeTabs
    • stackSize

      public int stackSize
    • enchantability

      public int enchantability
    • useDuration

      public int useDuration
    • toolType

      public double toolType
    • damageCount

      public int damageCount
    • recipeRemainder

      public MItemBlock recipeRemainder
    • destroyAnyBlock

      public boolean destroyAnyBlock
    • immuneToFire

      public boolean immuneToFire
    • stayInGridWhenCrafting

      public boolean stayInGridWhenCrafting
    • damageOnCrafting

      public boolean damageOnCrafting
    • enableMeleeDamage

      public boolean enableMeleeDamage
    • damageVsEntity

      public double damageVsEntity
    • specialInformation

      public StringListProcedure specialInformation
    • glowCondition

      public LogicProcedure glowCondition
    • guiBoundTo

      @Nullable public String guiBoundTo
    • inventorySize

      public int inventorySize
    • inventoryStackSize

      public int inventoryStackSize
    • onRightClickedInAir

      public Procedure onRightClickedInAir
    • onRightClickedOnBlock

      public Procedure onRightClickedOnBlock
    • onCrafted

      public Procedure onCrafted
    • onEntityHitWith

      public Procedure onEntityHitWith
    • onItemInInventoryTick

      public Procedure onItemInInventoryTick
    • onItemInUseTick

      public Procedure onItemInUseTick
    • onStoppedUsing

      public Procedure onStoppedUsing
    • onEntitySwing

      public Procedure onEntitySwing
    • onDroppedByPlayer

      public Procedure onDroppedByPlayer
    • onFinishUsingItem

      public Procedure onFinishUsingItem
    • enableRanged

      public boolean enableRanged
    • shootConstantly

      public boolean shootConstantly
    • rangedItemChargesPower

      public boolean rangedItemChargesPower
    • projectile

      public ProjectileEntry projectile
    • projectileDisableAmmoCheck

      public boolean projectileDisableAmmoCheck
    • onRangedItemUsed

      public Procedure onRangedItemUsed
    • rangedUseCondition

      public Procedure rangedUseCondition
    • isFood

      public boolean isFood
    • nutritionalValue

      public int nutritionalValue
    • saturation

      public double saturation
    • eatResultItem

      public MItemBlock eatResultItem
    • isMeat

      public boolean isMeat
    • isAlwaysEdible

      public boolean isAlwaysEdible
    • animation

      public String animation
    • isMusicDisc

      public boolean isMusicDisc
    • musicDiscMusic

      public Sound musicDiscMusic
    • musicDiscDescription

      public String musicDiscDescription
    • musicDiscLengthInTicks

      public int musicDiscLengthInTicks
    • musicDiscAnalogOutput

      public int musicDiscAnalogOutput
  • Constructor Details

  • Method Details

    • generateModElementPicture

      public BufferedImage generateModElementPicture()
      Overrides:
      generateModElementPicture in class GeneratableElement
      Returns:
      BufferedImage of mod element preview or null if default mod element icon should be used
    • getItemModel

      public Model getItemModel()
      Specified by:
      getItemModel in interface IItemWithModel
    • getTextureMap

      public Map<String,TextureHolder> getTextureMap()
      Specified by:
      getTextureMap in interface IItemWithModel
    • getCreativeTabs

      public List<TabEntry> getCreativeTabs()
      Specified by:
      getCreativeTabs in interface ITabContainedElement
    • getTexture

      public TextureHolder getTexture()
      Specified by:
      getTexture in interface IItemWithTexture
    • providedMCItems

      public List<MCItem> providedMCItems()
      Description copied from interface: IMCItemProvider
      This method determines what MCItems are provided by this generatable element

      WARNING: Calls to this method are generally not thread safe. Implementations can call MCItem.Custom::new that calls getBlockIconBasedOnName which calls ModElement#getGeneratableElement that is not thread safe

      Specified by:
      providedMCItems in interface IMCItemProvider
      Returns:
      A list of MCItems provided by this generatable element
    • getCreativeTabItems

      public List<MCItem> getCreativeTabItems()
      Description copied from interface: ITabContainedElement
      WARNING: Calls to this method are generally not thread safe. Implementations can call MCItem.Custom::new that calls getBlockIconBasedOnName that calls ModElement#getGeneratableElement which is not thread safe
      Specified by:
      getCreativeTabItems in interface ITabContainedElement
      Returns:
      list of items in the creative tab of this element
    • getSpecialInfoProcedure

      public StringListProcedure getSpecialInfoProcedure()
      Specified by:
      getSpecialInfoProcedure in interface ISpecialInfoHolder
    • hasNormalModel

      public boolean hasNormalModel()
    • hasToolModel

      public boolean hasToolModel()
    • hasRangedItemModel

      public boolean hasRangedItemModel()
    • hasInventory

      public boolean hasInventory()
    • hasNonDefaultAnimation

      public boolean hasNonDefaultAnimation()
    • hasEatResultItem

      public boolean hasEatResultItem()
    • getModels

      public List<Item.StateEntry> getModels()
      Returns a copy of states referencing only properties supported in the current workspace. Should only be used by generators to filter invalid data.

      Also populates models with Workspace reference for the use in templates

      Returns:
      Models with contents matching current generator.
    • encodeModelType

      public static int encodeModelType(Model.Type modelType)
    • decodeModelType

      public static Model.Type decodeModelType(int modelType)