Class IntProperty

java.lang.Object
net.minecraft.state.property.Property<Integer>
net.minecraft.state.property.IntProperty

public class IntProperty
extends Property<Integer>
  • Field Details

  • Constructor Details

    • IntProperty

      protected IntProperty​(String name, int min, int max)
  • Method Details

    • getValues

      public Collection<Integer> getValues()
      Returns all possible values the property can take.
      Specified by:
      getValues in class Property<Integer>
    • equals

      public boolean equals​(Object object)
      Overrides:
      equals in class Property<Integer>
    • computeHashCode

      public int computeHashCode()
      Overrides:
      computeHashCode in class Property<Integer>
    • of

      public static IntProperty of​(String name, int min, int max)
      Creates an integer property.

      min must be non-negative and max must be greater than min.

      Note that this method takes O(max - min) time as it computes all possible values during instantiation.

      Parameters:
      name - the name of the property
      min - the minimum value the property can take
      max - the maximum value the property can take
    • parse

      public Optional<Integer> parse​(String name)
      Specified by:
      parse in class Property<Integer>
    • name

      public String name​(Integer integer)
      Specified by:
      name in class Property<Integer>