Class TEntityElement.EntityProvider
java.lang.Object
com.thecsdev.commonmc.api.client.gui.misc.TEntityElement.EntityProvider
- Enclosing class:
TEntityElement
Utility class for providing
Entity instances for rendering in GUIs.
These entities do not exist in a "real" Level. Instead, this uses a
sandbox Level to create entities in.-
Method Summary
Modifier and TypeMethodDescriptionstatic final <E extends net.minecraft.world.entity.Entity>
EgetOrCreate(@NotNull net.minecraft.world.entity.EntityType<E> entityType) Returns an instance of the givenEntityType.
-
Method Details
-
getOrCreate
@NotNull public static final <E extends net.minecraft.world.entity.Entity> E getOrCreate(@NotNull @NotNull net.minecraft.world.entity.EntityType<E> entityType) throws NullPointerException, RuntimeException Returns an instance of the givenEntityType.- Type Parameters:
E- The type of theEntity.- Parameters:
entityType- TheEntityTypeto create an instance of.- Returns:
- An instance of the given
EntityType. - Throws:
NullPointerException- If the argument isnull.RuntimeException- If an error occurs duringEntityinstance creation.
-