- Description
- Nested Class Summary
- Field Summary
- Method Summary
- Field Details
- Method Details
- forArea(World, Vector3ic, Vector3ic, PrefetchLease, Prefetch.Budget)
- forArea(World, Prefetch.Area, PrefetchLease, Prefetch.Budget)
- lineArea(int, int, int, int, int, int, int, int, BrushOrigin)
- grownArea(Vector3ic, Vector3ic, int)
- brushOriginOffset(BrushOrigin, int)
- faceArea(int, int, int, int, int, int)
- allSections(ChunkStore, Vector3ic, Vector3ic, PrefetchLease)
- forAreas(World, List, PrefetchLease, Prefetch.Budget)
- loadsArea(Vector3ic, Vector3ic, Prefetch.Budget)
- forMovedArea(World, Vector3ic, Vector3ic, int, int, int, PrefetchLease, Prefetch.Budget)
- forExtrudedArea(World, Vector3ic, Vector3ic, Vector3ic, int, int, PrefetchLease, Prefetch.Budget)
- copiesWithinLimit(Vector3ic, Vector3ic, Vector3ic, int, int, Prefetch.Budget)
- copiesInMemory(World, Vector3ic, Vector3ic, Vector3ic, int, int, Prefetch.Budget)
- forSelection(World, BlockSelection, int, int, int, PrefetchLease, Prefetch.Budget)
- forSnapshots(World, List, PrefetchLease)
Class Prefetch
PrefetchLease until the edit runs.
A load asks for the column and for every section the edit touches. The column unload gate reads only the column's own keep-loaded flag, so a held section does not keep its column resident on its own.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic final recordHow much a single load may bring in.static final classThe columns and sections a run of snapshot restores covers, counted against one shared budget. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intHow many columns an area may cover before it is held as it is instead of loaded.static final intHow many sections an area may cover before it is held as it is instead of loaded.static final intHow far outside the cells it writes an edit reads. -
Method Summary
Modifier and TypeMethodDescriptionstatic CompletableFuture<Void> allSections(ChunkStore chunkStore, org.joml.Vector3ic min, org.joml.Vector3ic max, PrefetchLease lease) Loads every section covering the inclusive box, however many there are.static intbrushOriginOffset(BrushOrigin origin, int halfHeight) How far along Y a brush stamp sits from the cell it was aimed at.static intcopiesInMemory(World world, org.joml.Vector3ic min, org.joml.Vector3ic max, org.joml.Vector3ic direction, int depth, int spacing, Prefetch.Budget budget) How many copies of an extrude the world already holds, counted outward from the source box.static intcopiesWithinLimit(org.joml.Vector3ic min, org.joml.Vector3ic max, org.joml.Vector3ic direction, int depth, int spacing, Prefetch.Budget budget) How many copies of an extrude stay within the load limits.static Prefetch.AreafaceArea(int targetX, int targetY, int targetZ, int depth, int width, int length) The box a face edit reads and writes.static CompletableFuture<Void> forArea(World world, Prefetch.Area area, PrefetchLease lease, Prefetch.Budget budget) static CompletableFuture<Void> forArea(World world, org.joml.Vector3ic min, org.joml.Vector3ic max, PrefetchLease lease, Prefetch.Budget budget) Loads the columns and the sections covering the inclusive box, and holds them on the lease.static CompletableFuture<Void> forAreas(World world, List<Prefetch.Area> areas, PrefetchLease lease, Prefetch.Budget budget) Loads the columns and the sections covering every box.static CompletableFuture<Void> forExtrudedArea(World world, org.joml.Vector3ic min, org.joml.Vector3ic max, org.joml.Vector3ic direction, int depth, int spacing, PrefetchLease lease, Prefetch.Budget budget) Loads the inclusive box together with everywhere an extrude of it copies to.static CompletableFuture<Void> forMovedArea(World world, org.joml.Vector3ic min, org.joml.Vector3ic max, int offsetX, int offsetY, int offsetZ, PrefetchLease lease, Prefetch.Budget budget) Loads the inclusive box together with the same box moved by the offset.static CompletableFuture<Void> forSelection(World world, BlockSelection selection, int originX, int originY, int originZ, PrefetchLease lease, Prefetch.Budget budget) Loads the region the selection covers when it is placed at the given origin.static CompletableFuture<Void> forSnapshots(World world, List<SelectionSnapshot<?>> snapshots, PrefetchLease lease) Loads the region every block selection in the snapshots covers.static Prefetch.AreagrownArea(org.joml.Vector3ic min, org.joml.Vector3ic max, int amount) The inclusive box grown byamounton every side, ordered low to high.static Prefetch.ArealineArea(int startX, int startY, int startZ, int endX, int endY, int endZ, int width, int height, BrushOrigin origin) The box an edit along a line reads and writes: the line, half the brush on every side, and the shift the origin setting applies.static booleanloadsArea(org.joml.Vector3ic min, org.joml.Vector3ic max, Prefetch.Budget budget) WhetherforArea(World, Vector3ic, Vector3ic, PrefetchLease, Prefetch.Budget)loads the box, or leaves it to be read as it is.
-
Field Details
-
DEFAULT_MAX_PREFETCH_COLUMNS
public static final int DEFAULT_MAX_PREFETCH_COLUMNSHow many columns an area may cover before it is held as it is instead of loaded.A selection reaches
MAX_EDIT_BLOCK_COUNTcells, over sixty thousand columns for a flat box, which costs far more memory than the streaming window a player is served.- See Also:
-
DEFAULT_MAX_PREFETCH_SECTIONS
public static final int DEFAULT_MAX_PREFETCH_SECTIONSHow many sections an area may cover before it is held as it is instead of loaded.A cubic world stacks sections without a ceiling, so a box of a few columns still reaches any amount of work through its Y span.
- See Also:
-
MASK_SHELL
public static final int MASK_SHELLHow far outside the cells it writes an edit reads. A mask filter judges a cell by the one next to it, so the box an edit walks is loaded with a shell this thick around it.- See Also:
-
-
Method Details
-
forArea
@Nonnull public static CompletableFuture<Void> forArea(@Nonnull World world, @Nonnull org.joml.Vector3ic min, @Nonnull org.joml.Vector3ic max, @Nonnull PrefetchLease lease, @Nonnull Prefetch.Budget budget) Loads the columns and the sections covering the inclusive box, and holds them on the lease. A box over the budget loads nothing, and holds only what is already in memory. -
forArea
@Nonnull public static CompletableFuture<Void> forArea(@Nonnull World world, @Nonnull Prefetch.Area area, @Nonnull PrefetchLease lease, @Nonnull Prefetch.Budget budget) -
lineArea
@Nonnull public static Prefetch.Area lineArea(int startX, int startY, int startZ, int endX, int endY, int endZ, int width, int height, @Nonnull BrushOrigin origin) The box an edit along a line reads and writes: the line, half the brush on every side, and the shift the origin setting applies. The Y reach is not symmetric, because an origin other than the centre moves the whole stamp a half height off the line. -
grownArea
@Nonnull public static Prefetch.Area grownArea(@Nonnull org.joml.Vector3ic min, @Nonnull org.joml.Vector3ic max, int amount) The inclusive box grown byamounton every side, ordered low to high. Growth stops at the coordinate range rather than wrapping.An edit reads a shell around the cells it writes. Mask filters of the above, below, adjacent and neighbour kinds judge a cell by the one next to it, and absent storage reads as air, so a shell left out makes the mask decide differently than it would with the world loaded.
-
brushOriginOffset
How far along Y a brush stamp sits from the cell it was aimed at. A stamp anchored at its bottom rests on top of that cell, and one anchored at its top hangs under it. -
faceArea
@Nonnull public static Prefetch.Area faceArea(int targetX, int targetY, int targetZ, int depth, int width, int length) The box a face edit reads and writes. The walk reaches its own half extent plus the depth away from the target, which is the reach the tool caches. -
allSections
@Nonnull public static CompletableFuture<Void> allSections(@Nonnull ChunkStore chunkStore, @Nonnull org.joml.Vector3ic min, @Nonnull org.joml.Vector3ic max, @Nonnull PrefetchLease lease) Loads every section covering the inclusive box, however many there are. The caller loads the columns itself.The count is not capped, so this is for a caller that writes the whole box to a file, where a section left out would reach the file as a hole. An edit goes through
forArea(World, Vector3ic, Vector3ic, PrefetchLease, Prefetch.Budget), which stops at a limit and reports what it skipped. -
forAreas
@Nonnull public static CompletableFuture<Void> forAreas(@Nonnull World world, @Nonnull List<Prefetch.Area> areas, @Nonnull PrefetchLease lease, @Nonnull Prefetch.Budget budget) Loads the columns and the sections covering every box. An edit whose source and destination lie far apart passes them as separate boxes, so the empty space between them is not loaded. -
loadsArea
public static boolean loadsArea(@Nonnull org.joml.Vector3ic min, @Nonnull org.joml.Vector3ic max, @Nonnull Prefetch.Budget budget) WhetherforArea(World, Vector3ic, Vector3ic, PrefetchLease, Prefetch.Budget)loads the box, or leaves it to be read as it is. A caller with a smaller area to fall back on asks this first, because an area over a limit loads nothing at all rather than as much as it can. -
forMovedArea
@Nonnull public static CompletableFuture<Void> forMovedArea(@Nonnull World world, @Nonnull org.joml.Vector3ic min, @Nonnull org.joml.Vector3ic max, int offsetX, int offsetY, int offsetZ, @Nonnull PrefetchLease lease, @Nonnull Prefetch.Budget budget) Loads the inclusive box together with the same box moved by the offset. The two boxes are loaded on their own, so a move over a long distance does not load the ground it passes over. -
forExtrudedArea
@Nonnull public static CompletableFuture<Void> forExtrudedArea(@Nonnull World world, @Nonnull org.joml.Vector3ic min, @Nonnull org.joml.Vector3ic max, @Nonnull org.joml.Vector3ic direction, int depth, int spacing, @Nonnull PrefetchLease lease, @Nonnull Prefetch.Budget budget) Loads the inclusive box together with everywhere an extrude of it copies to. A run whose last copy leaves the coordinate range loads nothing, andcopiesWithinLimit(Vector3ic, Vector3ic, Vector3ic, int, int, Prefetch.Budget)refuses that depth as well. -
copiesWithinLimit
public static int copiesWithinLimit(@Nonnull org.joml.Vector3ic min, @Nonnull org.joml.Vector3ic max, @Nonnull org.joml.Vector3ic direction, int depth, int spacing, @Nonnull Prefetch.Budget budget) How many copies of an extrude stay within the load limits. The copies tile the space between the source box and the last one, so the run grows one stride at a time and a binary search finds the count. -
copiesInMemory
public static int copiesInMemory(@Nonnull World world, @Nonnull org.joml.Vector3ic min, @Nonnull org.joml.Vector3ic max, @Nonnull org.joml.Vector3ic direction, int depth, int spacing, @Nonnull Prefetch.Budget budget) How many copies of an extrude the world already holds, counted outward from the source box. A run over the column limit is not loaded first, so this says whether it can go ahead on what is resident. -
forSelection
@Nonnull public static CompletableFuture<Void> forSelection(@Nonnull World world, @Nonnull BlockSelection selection, int originX, int originY, int originZ, @Nonnull PrefetchLease lease, @Nonnull Prefetch.Budget budget) Loads the region the selection covers when it is placed at the given origin. -
forSnapshots
@Nonnull public static CompletableFuture<Void> forSnapshots(@Nonnull World world, @Nonnull List<SelectionSnapshot<?>> snapshots, @Nonnull PrefetchLease lease) Loads the region every block selection in the snapshots covers. A snapshot restores at its own position.The limits an edit works under do not apply here. A restore cannot refuse or shrink itself the way an edit can, and a region left out would reach the world as a hole in the state the player asked to come back.
-