Skip to content

Fix size-related issues when printing tanks and vaults#10525

Open
Apertyotis wants to merge 1 commit into
Creators-of-Create:mc1.21.1/devfrom
Apertyotis:fix/tank-and-vault-schematic
Open

Fix size-related issues when printing tanks and vaults#10525
Apertyotis wants to merge 1 commit into
Creators-of-Create:mc1.21.1/devfrom
Apertyotis:fix/tank-and-vault-schematic

Conversation

@Apertyotis

Copy link
Copy Markdown
Contributor

The following content is machine-translated and may contain inaccuracies.

I noticed that since commit 1491ed3, the size properties of FluidTank have been treated as safe NBT. This fixed some issues, but it also introduced two new ones.

First, players can use schematics to print a single tank with a large capacity. Second, even when printing a normal 3*3 tank, obvious errors still occur if the schematic is rotated by 90°.

For context, the behavior before this commit was: printing large tanks generally worked fine, but printing a single tank block would incorrectly set its capacity to 0. Vaults suffered from the same issue. My previous PR (#10084) attempted to fix this by following the same approach as commit 1491ed3, but based on the discussion above, that does not seem to be the right solution.

The root cause is almost certainly a limitation in the multiblock structure detection code. If that code were robust enough, it would correctly identify tanks regardless of how they were printed. However, that codebase is large and complex, and I am not in a position to thoroughly investigate it. Reviewing PRs that touch such systems is also understandably difficult for the maintainers.

Because of that, I chose a different approach that is much simpler, albeit less elegant. Since the multiblock detection logic always works correctly when players place blocks manually, the idea is to make schematic placement resemble manual placement as closely as possible. The implementation is straightforward: always treat printed tank controller as a 1*1 tank.

In FluidTankBlockEntity.<init>, both width and height are initialized to 1. However, they are later overwritten by values read from NBT. Before commit 1491ed3, those values were not present in the NBT at all, causing them to default to 0, which is the direct reason of the issue.

This effectively restores the pre-1491ed3 behavior for printing large tanks while also fixing the single-tank issue.

The fix is still not perfect, however. When a tank schematic is printed with rotation, the window property can still become inconsistent.

@VoidLeech VoidLeech added pr type: fix PR fixes a bug pr flag: simple PR has minimal changes labels Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr flag: simple PR has minimal changes pr type: fix PR fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants