Contents
Class ResourceType<ECS_TYPE, T extends Resource<ECS_TYPE>>
java.lang.Object
com.hypixel.hytale.component.ResourceType<ECS_TYPE,T>
- Type Parameters:
ECS_TYPE- The store type.T- The resource type class.
- All Implemented Interfaces:
Comparable<ResourceType<ECS_TYPE,?>>
public class ResourceType<ECS_TYPE, T extends Resource<ECS_TYPE>>
extends Object
implements Comparable<ResourceType<ECS_TYPE,?>>
Describes a
Resource type registered with a ComponentRegistry-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ResourceType[]An empty resource type array to reduce allocation. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(ResourceType<ECS_TYPE, ?> o) booleanintgetIndex()Get the index for this registered resource type.inthashCode()toString()voidvalidate()Called to validate that this resource type is valid.voidvalidateRegistry(ComponentRegistry<ECS_TYPE> registry) Called to validate that this resource type belongs to the given registry.
-
Field Details
-
EMPTY_ARRAY
An empty resource type array to reduce allocation.
-
-
Constructor Details
-
ResourceType
public ResourceType()Default Constructor for aResourceTypeinstance.
-
-
Method Details
-
getRegistry
- Returns:
- the associated component registry for this resource type.
-
getTypeClass
-
getIndex
public int getIndex()Get the index for this registered resource type.- Returns:
- The index for this resource
-
validateRegistry
Called to validate that this resource type belongs to the given registry.- Parameters:
registry- The registry to validate against.- Throws:
IllegalArgumentException- if the registries do not match.
-
validate
public void validate()Called to validate that this resource type is valid.- Throws:
IllegalStateException- if the resource type is invalid.
-
compareTo
- Specified by:
compareToin interfaceComparable<ECS_TYPE>
-
equals
-
hashCode
-
toString
-