Give one concept one name

The highest block of a column is highest(x, z, ignoreFluid) wherever it is
asked, and a sapling's surroundings read a block with get like every other
block view. The registry's property change is withPropertyIfAccepted, as it
checks the block and keeps a content plugin's block, unlike
BlockState.withProperty. BlockView no longer links the removed
PlacementContext.blocks().
This commit is contained in:
piexel committed 2026-11-06 06:18:37 +01:00
1 parent cdd138d9f4
commit 84bd65fdc4
6 files changed
+9 -9

No files matched your search

@@ -14,7 +14,7 @@ import java.util.Optional;
*
* <p>A content plugin's block ({@link BlockTrait#CUSTOM}) has the key of the block it is drawn as. The host knows it by
* the state instance it handed out, from this registry or from a block it read, so pass that instance on as it is, and
* change it through {@link #withProperty}, {@link #rotate} and {@link #merge}: a state built from the key is the plain
* change it through {@link #withPropertyIfAccepted}, {@link #rotate} and {@link #merge}: a state built from the key is the plain
* block.
*/
public interface BlockRegistry {
@@ -79,7 +79,7 @@ public interface BlockRegistry {
* {@code state} itself when the block has no property {@code name} or does not accept {@code value}, such as a
* {@code facing} of {@code up} for a block that only faces sideways.
*/
BlockState withProperty(BlockState state, String name, String value);
BlockState withPropertyIfAccepted(BlockState state, String name, String value);
/** Whether {@code state} matches {@code pattern} as the platform compares them: the same block, and every property
* {@code pattern} sets equal.
@@ -49,7 +49,7 @@ public interface SaplingGrowth {
/** The height of the topmost block at the column, ignoring fluids when {@code ignoreFluid}. */
int highest(int x, int z, boolean ignoreFluid);
BlockState blockAt(int x, int y, int z);
BlockState get(int x, int y, int z);
}
/**
@@ -3,8 +3,7 @@ package com.volmit.world;
import com.volmit.block.BlockState;
import com.volmit.geometry.BlockBox;
/** Blocks of an area to read: a placement's prepared generation blocks ({@link com.volmit.placement.PlacementContext#blocks()}),
* or, through {@link BlockAccess}, the live blocks of the platform's world. X and Z are world coordinates;
/** Blocks of an area to read, such as, through {@link BlockAccess}, the live blocks of the platform's world. X and Z are world coordinates;
* Y is the height above the dimension's bottom (0 = bottom), also in {@link #bounds()}.
* Empty space is a non-null air state. Out-of-area access throws IndexOutOfBoundsException.
* Views expire with the call or invocation that handed them out; access afterwards throws IllegalStateException.
@@ -29,7 +29,7 @@ public interface RunningWorld {
/** The height of the highest block in the column now: the terrain with what objects and structures added.
* {@code ignoreFluid} skips fluid blocks, so it answers the ground under a sea.
*/
int highestBlock(int worldX, int worldZ, boolean ignoreFluid);
int highest(int worldX, int worldZ, boolean ignoreFluid);
/** The floors of the caves generation marked in the chunk, as positions of the floor blocks; none on a platform that
* cannot read them.