Skip to content

Conversation

@fluffyloafie
Copy link
Member

@fluffyloafie fluffyloafie commented Apr 15, 2025

As of today, the Nether Portal can only be built as a 4x5 full frame (with corners), and ignited from a bottom block of the inner frame.

This PR strives to optimize what can be optimized for the portal building algorithm, as well as adding the possibility to build a portal whatever its size, within the bounds set by Mojang (4x5 to 23x23)

It will also try to add corner-less portals support

And support all of that in negative & positive coordinates
image

EDIT 04-15-2025 (commit): At the moment, the Portal can only be ignited when a bottom obsidian block is lit. If any other block of the frame is ignited, it does nothing (except lighting a fire and... burning things ?)

EDIT 04-16-2025: At the moment, the portal can only be opened with a Flint&Steel (fire igniting the portal in any other way won't open it, only burn your feet)

EDIT 04-17-2025 (commit): with a partial rework of what was done during the previous days, the ignited block can be anywhere within the frame (in theory) by following this method of computation:

First computing which block within the frame was ignited

Then, after computing where the _bottomLeftCorner is, computing the direction & size of the frame, with the only step left being the filling of the portal frame if no obstruction is detected

Also, by only computing everything within the frame, the corners are never taken into account, allowing corner-less portals to be built.

- Change the size computation algorithm
- Start working on the direction computation
@fluffyloafie fluffyloafie added enhancement Enhance the code or enhance functioning old_version Related to the pre-rewrite version labels Apr 15, 2025
@fluffyloafie fluffyloafie self-assigned this Apr 15, 2025
@fluffyloafie

This comment was marked as duplicate.

- Add detection of the bottom-left corner of the inner frame
- Add direction computation
- Add size of the inner frame computation
- Add openning of the portal if no obstruction within the frame

* None of these additions were tested yet, WIP
@fluffyloafie fluffyloafie force-pushed the tests-nether-portal-optimizations branch from 22c9116 to d9cdd56 Compare April 17, 2025 17:11
- Fixed by hand, some might be missing
@fluffyloafie fluffyloafie force-pushed the tests-nether-portal-optimizations branch from ac8b962 to 7a5b602 Compare April 17, 2025 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Enhance the code or enhance functioning old_version Related to the pre-rewrite version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants