Contents
- Description
- Nested Class Summary
- Method Summary
- Method Details
- stampBlockWithFiller(SectionAccessor, BlockSelection, BlockSelection, Int3OpenHashSet, int, int, int, int, int, boolean)
- stampBlockWithFiller(SectionAccessor, BlockSelection, BlockSelection, Int3OpenHashSet, int, int, int, int, int, boolean, BlockSelection)
- addBlockWithFiller(SectionAccessor, BlockSelection, BlockSelection, int, int, int, int, int)
- addBlockWithFiller(SectionAccessor, BlockSelection, BlockSelection, int, int, int, int, int, BlockBoundingBoxes.RotatedVariantBoxes)
- captureAndClearFootprint(SectionAccessor, BlockSelection, BlockSelection, int, int, int)
- captureAndClearFootprint(SectionAccessor, BlockSelection, BlockSelection, int, int, int, BlockSelection)
- isFootprintReadable(SectionAccessor, int, int, int, BlockBoundingBoxes.RotatedVariantBoxes)
Class FillerPlacementUtil
java.lang.Object
com.hypixel.hytale.builtin.buildertools.utils.FillerPlacementUtil
Shared multi-cell block stamping for the builder tools. Every tool that writes blocks into a
BlockSelection
(selection edits and brushes alike) goes through here so multi-cell hitboxes get complete filler, structures they
overwrite are repaired instead of orphaned, and footprints tile within an edit pass without overlapping.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumWhat became of a stamp. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddBlockWithFiller(SectionAccessor accessor, BlockSelection before, BlockSelection after, int baseX, int baseY, int baseZ, int blockId, int rotation) static voidaddBlockWithFiller(SectionAccessor accessor, BlockSelection before, BlockSelection after, int baseX, int baseY, int baseZ, int blockId, int rotation, BlockBoundingBoxes.RotatedVariantBoxes boxes) static booleancaptureAndClearFootprint(SectionAccessor accessor, BlockSelection before, BlockSelection after, int x, int y, int z) static booleancaptureAndClearFootprint(SectionAccessor accessor, BlockSelection before, BlockSelection after, int x, int y, int z, BlockSelection overlay) Same ascaptureAndClearFootprint(SectionAccessor, BlockSelection, BlockSelection, int, int, int), but the occupying structure is resolved throughoverlay(andafter) before falling back to the world, so a structure an earlier pass placed is cleared in full rather than resolved against the stale world filler.static booleanisFootprintReadable(SectionAccessor accessor, int x, int y, int z, BlockBoundingBoxes.RotatedVariantBoxes boxes) Whether every cell of theboxesfootprint anchored at world (x,y,z) has its storage in memory.stampBlockWithFiller(SectionAccessor accessor, BlockSelection before, BlockSelection after, Int3OpenHashSet occupied, int x, int y, int z, int blockId, int rotation, boolean requireWorldEmpty) StampsblockId/rotationat base (x,y,z) into the selections with full multi-cell filler, recording the displaced state inbefore.stampBlockWithFiller(SectionAccessor accessor, BlockSelection before, BlockSelection after, Int3OpenHashSet occupied, int x, int y, int z, int blockId, int rotation, boolean requireWorldEmpty, BlockSelection overlay) Same asstampBlockWithFiller(SectionAccessor, BlockSelection, BlockSelection, Int3OpenHashSet, int, int, int, int, int, boolean), but the structure overwritten by the footprint is resolved throughoverlay(the edits accumulated by earlier passes) before falling back to the world.
-
Method Details
-
stampBlockWithFiller
@Nonnull public static FillerPlacementUtil.StampResult stampBlockWithFiller(@Nonnull SectionAccessor accessor, @Nonnull BlockSelection before, @Nonnull BlockSelection after, @Nullable Int3OpenHashSet occupied, int x, int y, int z, int blockId, int rotation, boolean requireWorldEmpty) StampsblockId/rotationat base (x,y,z) into the selections with full multi-cell filler, recording the displaced state inbefore. Whenoccupiedis non-null the block is tiled: a multi-cell block whose footprint overlaps an already-claimed cell is skipped without touching anything. WhenrequireWorldEmptyis set the block is only placed if every footprint cell is currently air, so callers like fill never overwrite existing geometry. Any structure the footprint does overlap is cleared and repaired throughcaptureAndClearFootprint(SectionAccessor, BlockSelection, BlockSelection, int, int, int)before the new base and siblings are written, and the footprint is then marked inoccupied. -
stampBlockWithFiller
@Nonnull public static FillerPlacementUtil.StampResult stampBlockWithFiller(@Nonnull SectionAccessor accessor, @Nonnull BlockSelection before, @Nonnull BlockSelection after, @Nullable Int3OpenHashSet occupied, int x, int y, int z, int blockId, int rotation, boolean requireWorldEmpty, @Nullable BlockSelection overlay) Same asstampBlockWithFiller(SectionAccessor, BlockSelection, BlockSelection, Int3OpenHashSet, int, int, int, int, int, boolean), but the structure overwritten by the footprint is resolved throughoverlay(the edits accumulated by earlier passes) before falling back to the world. Multi-stage brushes pass their accumulated edits here so a later pass clears the block an earlier pass placed instead of resolving the stale world filler and leaving the earlier block half-overwritten. -
addBlockWithFiller
public static void addBlockWithFiller(@Nonnull SectionAccessor accessor, @Nonnull BlockSelection before, @Nonnull BlockSelection after, int baseX, int baseY, int baseZ, int blockId, int rotation) -
addBlockWithFiller
public static void addBlockWithFiller(@Nonnull SectionAccessor accessor, @Nonnull BlockSelection before, @Nonnull BlockSelection after, int baseX, int baseY, int baseZ, int blockId, int rotation, @Nullable BlockBoundingBoxes.RotatedVariantBoxes boxes) -
captureAndClearFootprint
public static boolean captureAndClearFootprint(@Nonnull SectionAccessor accessor, @Nonnull BlockSelection before, @Nonnull BlockSelection after, int x, int y, int z) -
captureAndClearFootprint
public static boolean captureAndClearFootprint(@Nonnull SectionAccessor accessor, @Nonnull BlockSelection before, @Nonnull BlockSelection after, int x, int y, int z, @Nullable BlockSelection overlay) Same ascaptureAndClearFootprint(SectionAccessor, BlockSelection, BlockSelection, int, int, int), but the occupying structure is resolved throughoverlay(andafter) before falling back to the world, so a structure an earlier pass placed is cleared in full rather than resolved against the stale world filler. The pre-edit state captured intobeforeis still read from the world so undo restores the original cells.- Returns:
- whether the structure was captured, which it is not when part of it has no storage in memory
-
isFootprintReadable
public static boolean isFootprintReadable(@Nonnull SectionAccessor accessor, int x, int y, int z, @Nullable BlockBoundingBoxes.RotatedVariantBoxes boxes) Whether every cell of theboxesfootprint anchored at world (x,y,z) has its storage in memory.A cell without storage reads as air, so an edit there would keep air for undo and then write over whatever the placement loads or generates. A footprint is refused whole, because clearing part of one would orphan the rest.
-