Enum Class ItemDisplayContext

java.lang.Object
java.lang.Enum<ItemDisplayContext>
net.minecraft.world.item.ItemDisplayContext
All Implemented Interfaces:
Serializable, Comparable<ItemDisplayContext>, Constable, StringRepresentable, IExtensibleEnum

public enum ItemDisplayContext extends Enum<ItemDisplayContext> implements StringRepresentable, IExtensibleEnum
  • Enum Constant Details

  • Field Details

    • CODEC

      public static final com.mojang.serialization.Codec<ItemDisplayContext> CODEC
    • BY_ID

      public static final IntFunction<ItemDisplayContext> BY_ID
    • id

      private final byte id
    • name

      private final String name
    • isModded

      private final boolean isModded
      Neo: indicates whether this is a modded display context
    • fallback

      private final Supplier<@Nullable ItemDisplayContext> fallback
      Neo: holds a supplier for the context to fall back to if this context is not specified
  • Constructor Details

    • ItemDisplayContext

      private ItemDisplayContext(int id, String name)
    • ItemDisplayContext

      private ItemDisplayContext(int id, String name, @Nullable String fallbackName)
      Neo: constructor for modded display contexts
  • Method Details

    • values

      public static ItemDisplayContext[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ItemDisplayContext valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getSerializedName

      public String getSerializedName()
      Specified by:
      getSerializedName in interface StringRepresentable
    • getId

      public byte getId()
    • firstPerson

      public boolean firstPerson()
    • leftHand

      public boolean leftHand()
    • isModded

      public boolean isModded()
      Neo: Returns whether this is a modded display context.
      Returns:
      whether this is a modded display context
    • fallback

      public @Nullable ItemDisplayContext fallback()
      Neo: Returns the context to fall back to if this context is not specified.
      Returns:
      the context to fall back to if this context is not specified
    • getExtensionInfo

      public static ExtensionInfo getExtensionInfo()