Record Class ZenTypeInfo

java.lang.Object
java.lang.Record
com.blamejared.crafttweaker.api.zencode.ZenTypeInfo
Record Components:
targetName - The fully qualified name of the class as it should be exposed to ZenCode, if attempting to register a class; otherwise the fully qualified name of the ZenCode type that should be expanded, if attempting to register an expansion.
kind - The kind of type that should be exposed to ZenCode.

public record ZenTypeInfo(String targetName, ZenTypeInfo.TypeKind kind) extends Record
Holds information relative to a specific type that still needs to be registered to ZenCode.

This record is used as a holder to store all information that CraftTweaker requires to properly create and register a type to the ZenCode environment. The registered types will then be accessible through the IZenClassRegistry.

Since:
9.1.0
  • Constructor Details

    • ZenTypeInfo

      public ZenTypeInfo(String targetName, ZenTypeInfo.TypeKind kind)
      Creates an instance of a ZenTypeInfo record class.
      Parameters:
      targetName - the value for the targetName record component
      kind - the value for the kind record component
  • Method Details

    • from

      public static ZenTypeInfo from(NativeTypeInfo nativeInfo)
      Converts a NativeTypeInfo into a ZenTypeInfo for ZenCode registration.
      Parameters:
      nativeInfo - The native type info to convert.
      Returns:
      A ZenTypeInfo which can be used to expose the given native type to ZenCode.
      Since:
      9.1.0
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • targetName

      public String targetName()
      Returns the value of the targetName record component.
      Returns:
      the value of the targetName record component
    • kind

      public ZenTypeInfo.TypeKind kind()
      Returns the value of the kind record component.
      Returns:
      the value of the kind record component