Minecraft - Memes, News
1.17K subscribers
40K photos
6.99K videos
4 files
35.8K links
The best channel about Minecraft. Subscribe!
Contact: @anyamyrz

Made with: @reddit2telegram and @r_channels
Download Telegram
When you don't need it, it's everywhere
https://redd.it/1xi0zfr
@minecraft_en
I wish they’d bring leaves turning white during snowfall to Java!
https://redd.it/1xhwgw1
@minecraft_en
Media is too big
VIEW IN TELEGRAM
Early state of my new world, traversable entirely with parkour

https://redd.it/1xi8zkg
@minecraft_en
I found this 1 in a billion sugarcane generation
https://redd.it/1xib1ap
@minecraft_en
Found a double portal that looks mirrored
https://redd.it/1xibqi0
@minecraft_en
While building my mod Organellium I uncovered a 16 YEARS OLD BUG that explains why cave dungeons are so incredibly rare!

I decompiled `MonsterRoomFeature` and while running some tests I got a weird result, every time it ran to check if there were places to spawn a monsterRoom, it always got 0%, so at first I thought I messed up and made a mistake, but then I went to check the code and saw this (Ignore comments):

int i = 3;
int j = randomsource.nextInt(2) + 2;
int k = -j - 1;
int l = j + 1;
int i1 = -1;
int j1 = 4;
int k1 = randomsource.nextInt(2) + 2;
int l1 = -k1 - 1;
int i2 = k1 + 1;
int j2 = 0;

for (int k2 = k; k2 <= l; k2++) {
for (int l2 = -1; l2 <= 4; l2++) {
for (int i3 = l1; i3 <= i2; i3++) {
BlockPos blockpos1 = blockpos.offset(k2, l2, i3);
boolean flag = worldgenlevel.getBlockState(blockpos1).isSolid();
if (l2 == -1 && !flag) {
return false;
}

if (l2 == 4 && !flag) {
return false;
}

if ((k2 == k || k2 == l || i3 == l1 || i3 == i2)
&& l2 == 0
&& worldgenlevel.isEmptyBlock(blockpos1)
&& worldgenlevel.isEmptyBlock(blockpos1.above())) {
j2++;
}
}
}
}

This code requires two things at the same time:

1. **The entire floor must be solid**, including the footprint under the walls.
2. **There must be 1–5 openings** (2 blocks high) in the perimeter at floor level.

The openings can only come from a cave. But a cave that leaves air at `y=0` and `y=1` of the perimeter has its floor at `y=0`. If the cave floor were at `y=-1` or lower, the solid-floor condition fails right under the opening.

**From my own testings**:

* **17,150 calls** to `MonsterRoomFeature` (15.7 per chunk). Which heavily eats performance, I already optimized it
* **0 successes** in 15,246 valid attempts.
* Average **143 world reads per call**. Full volume scan is 294–486 reads, meaning \~1/3 of all calls complete the entire scan**,** they pass the floor and ceiling checks and still die because `j2 = 0`.

If the real success rate were even 1/1,000, we’d expect \~15 dungeons. So dungeons being so rare is not actually a design decision, but rather some contradictive conditions that some Mojang employee probably wrote at 3 AM.

As far as I know I'm the first to discover and decompile this, some issues like MC-225030 have been open since 2021 asking for this exact behavior, no one answered with actual technical experiments and it says it's fixed in 21w40a but my mod is being developed in 1.21.1 and this is the exact behavior I got, therefore, as far as I could find, this is the first measured formulation of this mutual exclusion.

Has anyone measured this on other versions or mods? This is some interesting insight and Mojang has either probably ignored it or left it untouched to avoid messing with its behavior. In my case I'm fixing it to make these dungeons a little more common and also fix performance



https://redd.it/1xicqm7
@minecraft_en