Flint and steel lights nether portals only in the Overworld and the Nether

BaseFireBlock.inPortalDimension: a frame lit in the End stays a fire.
The world code's fire placement already checked it; the flint-and-steel
path (Game::try_light_portal) didn't, so a portal could be lit and used
in the End in every mode.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Ludovic Marie
2026-10-25 14:52:17 +01:00
parent 6a065fa489
commit a2fccf0205
+5 -1
View File
@@ -7879,8 +7879,12 @@ impl Game<'_> {
(0..width).all(|i| frame([left[0] + d[0] * i, left[1] + height, left[2] + d[2] * i]));
((3..=21).contains(&height) && top_ok).then_some((left, width, height))
}
/// BaseFireBlock.onPlace: lighting fire inside a frame creates a portal.
/// BaseFireBlock.onPlace: lighting fire inside a frame creates a portal,
/// only in the Overworld and the Nether (`inPortalDimension`).
fn try_light_portal(&mut self, at: [i32; 3]) -> Result<bool> {
if !matches!(self.dim, Dim::Overworld | Dim::Nether) {
return Ok(false);
}
for x_axis in [true, false] {
if let Some((origin, width, height)) = self.portal_shape(at, x_axis) {
let d = if x_axis { [1, 0, 0] } else { [0, 0, 1] };