Interface PosRuleTest
- All Superinterfaces:
Wrapper
- All Known Subinterfaces:
AxisAlignedLinearPosTest, LinearPosTest, PosAlwaysTrueTest
Wraps Minecraft's PosRuleTest: a test on where a block sits within a template, used by a
processor rule to vary its chance of applying with distance from the template's origin.
- Since:
- 3.4.0
- See Also:
-
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic PosAlwaysTrueTestPasses for every position.static AxisAlignedLinearPosTestaxisAlignedLinearPos(float minChance, float maxChance, int minDist, int maxDist, Axis axis) AslinearPos(float, float, int, int), measuring distance along one axis only.static PosRuleTestReads a Minecraft position rule test.static LinearPosTestlinearPos(float minChance, float maxChance, int minDist, int maxDist) Passes with a chance that moves fromminChancetomaxChanceas the block's distance from the template's origin moves fromminDisttomaxDist.Methods inherited from interface Wrapper
asHandle, toMinecraft, unwrap
-
Method Details
-
alwaysTrue
Passes for every position. A rule without a position test uses this.- Returns:
- the always-true test
- Since:
- 3.4.0
-
linearPos
@AsOf("3.4.0") static LinearPosTest linearPos(float minChance, float maxChance, int minDist, int maxDist) Passes with a chance that moves fromminChancetomaxChanceas the block's distance from the template's origin moves fromminDisttomaxDist.- Parameters:
minChance- the chance at the minimum distancemaxChance- the chance at the maximum distanceminDist- the distance the minimum chance applies atmaxDist- the distance the maximum chance applies at- Returns:
- a linear position test
- Since:
- 3.4.0
-
axisAlignedLinearPos
@AsOf("3.4.0") static AxisAlignedLinearPosTest axisAlignedLinearPos(float minChance, float maxChance, int minDist, int maxDist, Axis axis) AslinearPos(float, float, int, int), measuring distance along one axis only.- Parameters:
minChance- the chance at the minimum distancemaxChance- the chance at the maximum distanceminDist- the distance the minimum chance applies atmaxDist- the distance the maximum chance applies ataxis- the axis distance is measured along- Returns:
- an axis-aligned linear position test
- Since:
- 3.4.0
-
decode
Reads a Minecraft position rule test.- Parameters:
minecraftTest- the test to read- Returns:
- the decoded test
- Since:
- 3.4.0
-