
Crash during Whalefall structure generation: Illegal `facing=up` on `smooth_bone_stairs`
Closed this issue · 2 comments
When generating the “Whalefall” feature, the server attempts to place a smooth_bone_stairs
block with facing=up
, but StairBlock
only accepts [north, south, west, east]
. This causes a hard crash in the chunk‐generation phase.
To Reproduce
- Minecraft 1.20.1, Forge 47.4.0, Alex’s Caves v2.0.2
- Create or load a world with the default Alex’s Caves features.
- Travel (or
/locate structure alexscaves:whalefall
) to approximately X=103, Z=–26 in the Overworld. - As the chunk loads, the server throws an IllegalArgumentException and crashes.
Expected behavior
The feature generator should never set facing=up
on a stair block. Instead it should choose one of the four horizontal directions or skip placing the block.
Mod & Environment
- Alex’s Caves: 2.0.2
- Minecraft: 1.20.1 (
server-1.20.1-20230612.114412-srg.jar
) - Forge: net.minecraftforge:47.4.0
- Seed:
-4997362238323014790
- Coordinates: chunk at
CenterX=103
,CenterZ=–26
Relevant stack trace
java.lang.IllegalArgumentException: Cannot set property DirectionProperty{name=facing, … values=[north, south, west, east]} to up on Block{alexscaves:smooth_bone_stairs}
at net.minecraft.world.level.block.state.StateHolder.m_61124_(StateHolder.java:130)
at net.minecraft.world.level.block.StairBlock.m_6843_(StairBlock.java:221)
at com.github.alexmodguy.alexscaves.server.level.feature.WhalefallFeature.generateStructurePiece(WhalefallFeature.java:67)
…
Workarounds
- Disable the Whalefall feature in the config or via a world‐gen script.
- Manually patch
WhalefallFeature.generateStructurePiece
to filter outup
before setting the block state.
Additional context
This is blocking world generation on any new chunk containing a Whalefall structure. A check for valid horizontal facings (or a default fallback) would prevent the crash.
Thank you for looking into this! Any guidance on a proper patch or config flag would be much appreciated.
Crash log attached:
crash-2025-05-15_19.45.38-server.txt
I’m seeing a second, related crash in the same WhalefallFeature
logic. This one happens at line 48 when the code tries to rotate a non-horizontal direction:
java.lang.IllegalStateException: Unable to get CCW facing of up
at net.minecraft.core.Direction.m_122428_(Direction.java:232)
at com.github.alexmodguy.alexscaves.server.level.feature.WhalefallFeature.m_142674_(WhalefallFeature.java:48)
…
-
What’s happening:
After placing a stair withfacing=up
, the generator callsDirection.getCounterClockWise()
(aka “rotate Y-CCW”) on thatUP
value. SinceUP
isn’t on the horizontal plane, that method throwsIllegalStateException
. -
Where it occurs:
- First crash was at
generateStructurePiece(...)
line 67 (IllegalArgumentException settingfacing=up
). - This second crash is earlier in the same class (obfuscated to
m_142674_
) at line 48 during a CCW rotation onUP
.
- First crash was at
-
Suggested fix:
-
Clamp orientations to horizontal before any rotation or placement.
-
In pseudo-code:
// before rotateY() or setValue(FACING, …): if (!facing.getAxis().isHorizontal()) { facing = Direction.NORTH; // or pick randomly from horizonal values }
-
This guard will prevent both the “invalid facing” and the “unable to rotate UP” crashes in one go.
-
Crash log attached for reference:
crash-2025-05-15_20.50.41-server.txt