Minecraft 26.4 snapshot 2
Original ChangelogThe first 26.4 snapshot after Minecraft LIVE is out, no ice caves yet.
Table of Contents
World Generation
Mushrooms now only generate underneath motion-blocking blocks, fixing MC-312046 .
Data Packs
Number Providers
Changed the sin and cos float number providers to fix
MC-311780
:
- The input now rounds towards the nearest quantized angle, with ties rounding towards zero, instead of always rounding towards zero.
- Negative inputs use the
sin(-x) = -sin(x)andcos(-x) = cos(x)identities. - The sine of
0,pi/2,pi, and3pi/2radians is exactly 0, 1, 0, and -1 respectively. - The cosine of
0,pi/2,pi, and3pi/2radians is exactly 1, 0, -1, and 0 respectively.
Uses the following code:
int NUM_ANGLES = 65536;
int QUADRANT_OFFSET = NUM_ANGLES / 4;
double ANGLES_PER_RADIAN = NUM_ANGLES / (2 * Math.PI);
float[] SIN = new float[NUM_ANGLES];
for (int i = 0; i < SIN.length; i++) {
SIN[i] = (float) Math.sin(i / ANGLES_PER_RADIAN);
}
SIN[0 * QUADRANT_OFFSET] = 0.0f;
SIN[1 * QUADRANT_OFFSET] = 1.0f;
SIN[2 * QUADRANT_OFFSET] = 0.0f
SIN[3 * QUADRANT_OFFSET] = -1.0f;
float sin(float f) {
double d = (double) f;
return d >= 0.0
? SIN[(int) ((long) (d * ANGLES_PER_RADIAN + 0.5) & (long) (NUM_ANGLES - 1))]
: -SIN[(int) ((long) (-d * ANGLES_PER_RADIAN + 0.5) & (long) (NUM_ANGLES - 1))];
}
float cos(float f) {
double d = (double) f;
return d >= 0.0
? SIN[(int) ((long) (d * ANGLES_PER_RADIAN + (double) QUADRANT_OFFSET + 0.5) & (long) (NUM_ANGLES - 1))]
: SIN[(int) ((long) (-d * ANGLES_PER_RADIAN + (double) QUADRANT_OFFSET + 0.5) & (long) (NUM_ANGLES - 1))];
}