public class GelCapability
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
GelCapability.Storage |
Modifier and Type | Field and Description |
---|---|
static net.minecraftforge.common.capabilities.Capability<IGelEntity> |
INSTANCE |
Constructor and Description |
---|
GelCapability() |
Modifier and Type | Method and Description |
---|---|
static <E extends net.minecraft.entity.Entity> |
get(E entity)
Gets the capability instance from the entity passed.
|
static <E extends net.minecraft.entity.Entity,R> |
getIfPresent(E entity,
java.util.function.Function<IGelEntity,R> action)
Runs the function if the entity has the capability.
|
static <E extends net.minecraft.entity.Entity,R> |
getIfPresent(E entity,
java.util.function.Function<IGelEntity,R> action,
java.util.function.Function<E,R> elseAction)
Runs the first function if the entity has the capability.
|
static <E extends net.minecraft.entity.Entity> |
ifPresent(E entity,
java.util.function.Consumer<IGelEntity> action)
Runs the consumer if the entity has the capability
|
static <E extends net.minecraft.entity.Entity> |
ifPresent(E entity,
java.util.function.Consumer<IGelEntity> action,
java.util.function.Consumer<E> elseAction)
Runs the first consumer if the entity has the capability.
|
static void |
register() |
public static net.minecraftforge.common.capabilities.Capability<IGelEntity> INSTANCE
public static void register()
@Nullable public static <E extends net.minecraft.entity.Entity> IGelEntity get(E entity)
entity
- IGelEntity
public static <E extends net.minecraft.entity.Entity> void ifPresent(E entity, java.util.function.Consumer<IGelEntity> action)
entity
- action
- public static <E extends net.minecraft.entity.Entity> void ifPresent(E entity, java.util.function.Consumer<IGelEntity> action, java.util.function.Consumer<E> elseAction)
entity
- action
- elseAction
- @Nullable public static <E extends net.minecraft.entity.Entity,R> R getIfPresent(E entity, java.util.function.Function<IGelEntity,R> action)
entity
- action
- @Nullable public static <E extends net.minecraft.entity.Entity,R> R getIfPresent(E entity, java.util.function.Function<IGelEntity,R> action, java.util.function.Function<E,R> elseAction)
entity
- action
- elseAction
-