Package vazkii.botania.api.corporea
Interface CorporeaHelper
- All Known Implementing Classes:
CorporeaHelperImpl
public interface CorporeaHelper
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault CorporeaRequestMatchercreateMatcher(String name) Create a CorporeaRequestMatcher from a String.default CorporeaRequestMatchercreateMatcher(net.minecraft.world.item.ItemStack stack, boolean checkNBT) Create a CorporeaRequestMatcher from an ItemStack and NBT-checkness.default booleandoesBlockHaveSpark(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos) Gets if the block in the coords passed in has a spark attached.default Set<CorporeaNode> getNodesOnNetwork(CorporeaSpark spark) Gets all the nodes on this spark network.default @Nullable CorporeaSparkgetSparkForBlock(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos) Gets the spark attached to the block in the coords passed in.static CorporeaHelperinstance()default <T extends CorporeaRequestMatcher>
voidregisterRequestMatcher(net.minecraft.resources.ResourceLocation id, Class<T> clazz, Function<net.minecraft.nbt.CompoundTag, T> deserializer) default CorporeaResultrequestItem(CorporeaRequestMatcher matcher, int itemCount, CorporeaSpark spark, @Nullable net.minecraft.world.entity.LivingEntity requestor, boolean doit) Requests items from the network associated withspark.default intsignalStrengthForRequestSize(int requestSize) Returns the comparator strength for a corporea request that corporea crystal cubes and retainers use, following the usual "each step up requires double the items" formula.
-
Field Details
-
INSTANCE
-
-
Method Details
-
instance
-
getNodesOnNetwork
Gets all the nodes on this spark network. This is memoized for use once every tick. The order of the nodes in this set are unspecified. -
createMatcher
default CorporeaRequestMatcher createMatcher(net.minecraft.world.item.ItemStack stack, boolean checkNBT) Create a CorporeaRequestMatcher from an ItemStack and NBT-checkness. -
createMatcher
Create a CorporeaRequestMatcher from a String. -
requestItem
default CorporeaResult requestItem(CorporeaRequestMatcher matcher, int itemCount, CorporeaSpark spark, @Nullable @Nullable net.minecraft.world.entity.LivingEntity requestor, boolean doit) Requests items from the network associated withspark.- Parameters:
matcher- Specifies what you want to request. SeecreateMatcher(net.minecraft.world.item.ItemStack, boolean)to create one.itemCount- Specifies the maximum amount you want to request. If -1, the amount is unlimited.requestor- The entity that initiated this request, if there is one.doit- If false, only counts the items instead of actually extracting
-
getSparkForBlock
@Nullable default @Nullable CorporeaSpark getSparkForBlock(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos) Gets the spark attached to the block in the coords passed in. Note that the coords passed in are for the block that the spark will be on, not the coords of the spark itself. -
doesBlockHaveSpark
default boolean doesBlockHaveSpark(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos) Gets if the block in the coords passed in has a spark attached. Note that the coords passed in are for the block that the spark will be on, not the coords of the spark itself. -
signalStrengthForRequestSize
default int signalStrengthForRequestSize(int requestSize) Returns the comparator strength for a corporea request that corporea crystal cubes and retainers use, following the usual "each step up requires double the items" formula. -
registerRequestMatcher
default <T extends CorporeaRequestMatcher> void registerRequestMatcher(net.minecraft.resources.ResourceLocation id, Class<T> clazz, Function<net.minecraft.nbt.CompoundTag, T> deserializer)
-