Interface CorporeaHelper

All Known Implementing Classes:
CorporeaHelperImpl

public interface CorporeaHelper
  • Field Details

  • Method Details

    • instance

      static CorporeaHelper instance()
    • getNodesOnNetwork

      default Set<CorporeaNode> getNodesOnNetwork(CorporeaSpark spark)
      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

      default CorporeaRequestMatcher createMatcher(String name)
      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 with spark.
      Parameters:
      matcher - Specifies what you want to request. See createMatcher(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)