Package org.cyclops.cyclopscore.helper
Class BlockEntityHelpers
java.lang.Object
org.cyclops.cyclopscore.helper.BlockEntityHelpers
Deprecated.
Contains helper methods for various block entity specific things.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic booleanDeprecated.If block entities should be retrieved in an unsafe manner from the non-main thread. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Optional<T> get(net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, Class<T> targetClazz) Deprecated.Safely cast a block entity.static <T> Optional<T> Deprecated.Safely cast a block entity.static <T,C> Optional <T> getCapability(net.neoforged.neoforge.common.extensions.ILevelExtension level, net.minecraft.core.BlockPos pos, C context, net.neoforged.neoforge.capabilities.BlockCapability<T, C> capability) Deprecated.Safely get a capability from a block entity.static <T,C> Optional <T> getCapability(net.neoforged.neoforge.common.extensions.ILevelExtension level, net.minecraft.core.BlockPos pos, net.neoforged.neoforge.capabilities.BlockCapability<T, C> capability) Deprecated.Safely get a capability from a block entity.static <T,C> Optional <T> getCapability(DimPos dimPos, C context, net.neoforged.neoforge.capabilities.BlockCapability<T, C> capability) Deprecated.Safely get a capability from a block entity.static <T,C> Optional <T> getCapability(DimPos dimPos, net.neoforged.neoforge.capabilities.BlockCapability<T, C> capability) Deprecated.Safely get a capability from a block entity.
-
Field Details
-
UNSAFE_BLOCK_ENTITY_GETTER
public static boolean UNSAFE_BLOCK_ENTITY_GETTERDeprecated.If block entities should be retrieved in an unsafe manner from the non-main thread. USE WITH CAUTION!!!
-
-
Constructor Details
-
BlockEntityHelpers
public BlockEntityHelpers()Deprecated.
-
-
Method Details
-
get
Deprecated.Safely cast a block entity.- Type Parameters:
T- The type of block entity to cast at.- Parameters:
dimPos- The dimensional position of the block providing the block entity.targetClazz- The class to cast to.- Returns:
- The optional block entity.
-
get
public static <T> Optional<T> get(net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, Class<T> targetClazz) Deprecated.Safely cast a block entity.- Type Parameters:
T- The type of block entity to cast at.- Parameters:
level- The level.pos- The position of the block providing the block entity.targetClazz- The class to cast to.- Returns:
- The optional block entity.
-
getCapability
public static <T,C> Optional<T> getCapability(DimPos dimPos, net.neoforged.neoforge.capabilities.BlockCapability<T, C> capability) Deprecated.Safely get a capability from a block entity.- Type Parameters:
T- The capability instance.C- The capability context.- Parameters:
dimPos- The dimensional position of the block providing the block entity.capability- The capability.- Returns:
- The lazy optional capability.
-
getCapability
public static <T,C> Optional<T> getCapability(DimPos dimPos, C context, net.neoforged.neoforge.capabilities.BlockCapability<T, C> capability) Deprecated.Safely get a capability from a block entity.- Type Parameters:
T- The capability instance.C- The capability context.- Parameters:
dimPos- The dimensional position of the block providing the block entity.context- The context to get the capability from.capability- The capability.- Returns:
- The lazy optional capability.
-
getCapability
public static <T,C> Optional<T> getCapability(net.neoforged.neoforge.common.extensions.ILevelExtension level, net.minecraft.core.BlockPos pos, net.neoforged.neoforge.capabilities.BlockCapability<T, C> capability) Deprecated.Safely get a capability from a block entity.- Type Parameters:
T- The capability instance.C- The capability context.- Parameters:
level- The level.pos- The position of the block of the block entity providing the capability.capability- The capability.- Returns:
- The lazy optional capability.
-
getCapability
public static <T,C> Optional<T> getCapability(net.neoforged.neoforge.common.extensions.ILevelExtension level, net.minecraft.core.BlockPos pos, C context, net.neoforged.neoforge.capabilities.BlockCapability<T, C> capability) Deprecated.Safely get a capability from a block entity.- Type Parameters:
T- The capability instance.C- The capability context.- Parameters:
level- The level.pos- The position of the block of the block entity providing the capability.context- The context to get the capability from.capability- The capability.- Returns:
- The lazy optional capability.
-