Contents
Interface BlockPriorityModifier
- All Known Implementing Classes:
CaveBlockPriorityModifier
public interface BlockPriorityModifier
Allows simple modification of the current and target block priorities used
during the
ChunkGeneratorExecution.setBlock(int, int, int, byte, int) logic to determine
whether a block can replace another at a given position.
By transforming the current, target, or both priority value(s), special logic can be applied to handle certain edge-case scenarios that the default priority comparison can't deal with - such as allowing regular caves to intersect with prefab cave-nodes (ie dungeons).
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbytemodifyCurrent(byte current, byte target) Modify the block priority value read from theBlockPriorityChunkbefore the comparison logic is performed to determine whether a block can be set at a given position.bytemodifyTarget(byte original, byte target) Modify the block priority value to be set in theBlockPriorityChunkafter the comparison logic has determined that a block can be set at a given position - ie the value that is written to the chunk.
-
Field Details
-
NONE
-
-
Method Details
-
modifyCurrent
byte modifyCurrent(byte current, byte target) Modify the block priority value read from theBlockPriorityChunkbefore the comparison logic is performed to determine whether a block can be set at a given position.- Parameters:
current- The current priority value held in the chunk.target- The new priority value attempting to be set in the chunk.- Returns:
- The modified priority value.
-
modifyTarget
byte modifyTarget(byte original, byte target) Modify the block priority value to be set in theBlockPriorityChunkafter the comparison logic has determined that a block can be set at a given position - ie the value that is written to the chunk.- Parameters:
original- The original unmodified priority value held in the chunk.target- The new priority value to be set in the chunk.- Returns:
- The modified priority value.
-