Skip to content

Comments

Fix Grown Tardis Item crashing the game if Valkyrien Skies is installed.#579

Open
Acuadragon100 wants to merge 4 commits intoWhoCraft:dev/1.20.1from
Acuadragon100:dev/1.20.1-fix-create-item-vs
Open

Fix Grown Tardis Item crashing the game if Valkyrien Skies is installed.#579
Acuadragon100 wants to merge 4 commits intoWhoCraft:dev/1.20.1from
Acuadragon100:dev/1.20.1-fix-create-item-vs

Conversation

@Acuadragon100
Copy link
Contributor

Right now, using the Grown Tardis Item (or the dev create command) while Valkyrien Skies is installed crashes the game with the following error:

org.valkyrienskies.core.impl.shadow.Gb: Constraints failed. Stages since last reset: [PRE_TICK, GET_LAST_TICK_CHANGES, UPDATE_CHUNKS, UPDATE_CHUNKS, UPDATE_CHUNKS, POST_TICK_START, POST_TICK_GENERATED, POST_TICK_FINISH, GET_CURRENT_TICK_CHANGES, CLEAR_FOR_RESET, UPDATE_DIMENSIONS]
Required stages matching predicate in the following order: [PRE_TICK, oneOf[UPDATE_DIMENSIONS, UPDATE_BLOCKS, UPDATE_CHUNKS], POST_TICK_START, POST_TICK_GENERATED, POST_TICK_FINISH, CLEAR_FOR_RESET, UPDATE_PLAYERS]

Note that this does not happen when using the Root Shell.

This patch solves this by creating the dimension during the tick loop (the same way as the Root Shell does it) whenever Valkyrien Skies is installed. I decided to make this change directly in the TardisHelper::createTardis function to future-proof it, but that also means that the return value can't be used to tell if the creation was successful or not anymore (I added some optional lambdas instead). I actually wanted to remove the boolean return value entirely, but decided to leave it alone in case any addons were using it.

private boolean hasPotentialToBeRemoved = false;
private boolean placedByOtherMod = false; // We don't serialize this by design, because other mods might still create duplicates.

private SetupState setupData = null;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It has been a while since I've been in here. Interesting use of the record here. Does this need to be serialized in any way?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just felt that a record was a nice and compact way to keep all parameters in one place.
I did consider serialising it as well, but thought it was unnecessary considering it will only exist for a single game tick, especially since it's only used when Valkyrien Skies is installed. Also, the Grown TARDIS item is a bit of a creative-mode quality of life item, it even has infinite uses in survival mode (is this a bug?).

The main potential concern I could see is that the shell won't re-trigger the setup on it's own when right-clicked (unlike the root shell), so if the server shuts down after using the grown TARDIS item before the next game tick (very unlikely) it will create an unbreakable (even in creative mode, although it can removed with /setblock) and unusable TARDIS shell without an interior.

Serialising it would solve this, but another solution could be to just have the shell delete itself if it doesn't have a valid TARDIS_ID (which it probably should do anyway in my opinion). Let me know which approach you prefer, I'd probably serialise it if you want to future proof things for a potential survival-mode-friendly way to create a TARDIS directly without the root shell.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, on second thought I decided it would probably be best to serialise it to future-proof the mod.
This also makes it possible to create a TARDIS manually by just placing the shell block with a command, which could be useful.

@Acuadragon100 Acuadragon100 force-pushed the dev/1.20.1-fix-create-item-vs branch from 03a21f6 to 8742a65 Compare January 23, 2026 12:20
# Conflicts:
#	changelog.md
#	common/src/main/java/whocraft/tardis_refined/common/blockentity/shell/ShellBaseBlockEntity.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants