9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-28 19:39:17 +00:00

remove 0 to 2 random on amount chosen

This commit is contained in:
hayanesuru
2025-06-11 14:12:25 +09:00
parent e0ff96a982
commit 3a50c012e2

View File

@@ -12,7 +12,6 @@ import java.util.OptionalLong;
public final class RandomTickSystem {
private static final long SCALE = 0x100000L;
private static final long SCALE_HALF = 0x80000L;
private static final long CHUNK_BLOCKS = 4096L;
private final LongArrayList queue = new LongArrayList();
@@ -29,11 +28,8 @@ public final class RandomTickSystem {
}
var random = world.simpleRandom;
long chosen = 0L;
if (weightsSum >= SCALE_HALF) {
chosen += boundedNextLong(random, (weightsSum / SCALE_HALF));
}
if (((weightsSum % SCALE_HALF) >= boundedNextLong(random, SCALE_HALF))) {
long chosen = weightsSum / SCALE;
if (((weightsSum % SCALE) >= boundedNextLong(random, SCALE))) {
chosen += 1L;
}
if (chosen == 0L) {