Class AugmentBlocksUtils

java.lang.Object
com.hypixel.hytale.builtin.augmentblocks.AugmentBlocksUtils

public final class AugmentBlocksUtils extends Object
Stateless helpers over the KDTree spatial index. Augment blocks interconnect with augment tags: a block grants its current level's GrantsAugmentTags (the flat list at level 0), and a dependent gates on RequiredAugmentTags. Tags are never persisted; every query recomputes them from the loaded augment blocks within the querying block's Radius.
  • Method Details

    • collectActiveAugmentTags

      @Nonnull public static Set<String> collectActiveAugmentTags(@Nonnull Store<ChunkStore> store, @Nonnull org.joml.Vector3i center, double radius)
      Collects every tag currently granted by the augment blocks within radius of center: each block grants exactly its current level's list (level 0 = the flat list). A level only grants while its own RequiredAugmentTags are active and grants feed each other, so this iterates to a fixpoint: removing a root provider (e.g. the power switch) cascades its dependents offline even though they remain upgraded.
    • requirementsMet

      public static boolean requirementsMet(@Nonnull Store<ChunkStore> store, @Nonnull org.joml.Vector3i center, double radius, @Nonnull String[] requiredAugmentTags)
      Whether every required tag is granted by an augment block within radius of center.
    • syncBenchAugmentTags

      public static void syncBenchAugmentTags(@Nonnull Store<ChunkStore> store, @Nonnull Ref<ChunkStore> ref, @Nonnull org.joml.Vector3i pos)
      Recomputes the tags granted to the crafting bench at ref, gating recipes that declare RequiredAugmentTags. Registered as the BenchBlock tag refresher; the bench's own tier is untouched. Benches without an AugmentBlock are skipped.
    • canReplaceBlock

      public static boolean canReplaceBlock(@Nonnull World world, @Nonnull org.joml.Vector3i pos, @Nonnull String newBlockTypeKey)
    • replaceBlock

      public static void replaceBlock(@Nonnull World world, @Nonnull Store<ChunkStore> store, @Nonnull Ref<ChunkStore> ref, @Nonnull String newBlockTypeKey)
      Replaces the block at ref with a different block type; the new block entity is created fresh.
    • applyState

      public static void applyState(@Nonnull World world, @Nonnull Store<ChunkStore> store, @Nonnull Ref<ChunkStore> ref, @Nonnull String state)
      Swaps the block at ref to the named state. Must pass the block's CURRENT (possibly state-variant) type: with the base type, swapping back to "default" silently no-ops (the state comparison and the getDefaultStateKey() resolution both break down on the base itself).
    • currentBlockType

      @Nullable public static BlockType currentBlockType(@Nonnull Store<ChunkStore> store, @Nonnull Ref<ChunkStore> ref)
      The block type currently placed at ref, or null when ref has no block state.
    • worldPos

      @Nullable public static org.joml.Vector3i worldPos(@Nonnull Store<ChunkStore> store, @Nonnull Ref<ChunkStore> ref)