Repository navigation
Grant structure advancements for villages, ocean ruins and mansions - #162
Merged
Merged
Conversation
Boxed grants the advancements for being in a structure itself, because the game does not see a structure that was placed piece by piece. It matched the piece's name against the name the advancement uses, which only worked where the two start the same. A village piece is called village/plains/... and the advancement asks for village_plains, so villages, ocean ruins, mansions and beached shipwrecks never counted. - StructureIds turns a piece's name into the names advancements use. - Boxed's own advancements name their criteria anything, so they are now found by the structure they ask for, not by the criterion's name. - The check runs on every step a player takes inside a structure and went through every advancement on the server each time. It is done once for each player and structure now. Also corrects the model's monster sizes: a monster spawns more than 24 blocks from the player in any direction, so a small box has them as soon as its player digs down. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HBXcjZkd22rGNW5ZyL1git
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HBXcjZkd22rGNW5ZyL1git
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Merge #161 first. This is built on it.
The bug
The game cannot tell that a player is in a structure that was placed piece by piece, so Boxed grants "be in this structure" advancements itself when a player steps into a placed piece. It decided which advancement by checking whether the piece's name started with the name the advancement uses.
That only works where the two happen to start the same, such as
igloo/topandigloo. A village piece is calledvillage/plains/houses/...and the advancement asks forvillage_plains. So these never counted:underwater_ruin/...againstocean_ruin_coldandocean_ruin_warm),woodland_mansion/...againstmansion),bastion_remnant.Separately, 22 criteria in Boxed's own advancements have names of their own, such as
plains, so they were never found whatever the piece was called.The fix
StructureIdsturns a piece's name into the names advancements use.Also
The reach model's monster sizes are corrected. A monster spawns more than 24 blocks from the nearest player in any direction, so a small box has them as soon as its player digs down. They were set to need a box of 16; they are now 3 or 4.
Testing
5 new unit tests, 466 in total, all pass. Not tried in game: it needs a player to walk into a placed village or ocean ruin.
🤖 Generated with Claude Code
https://claude.ai/code/session_01HBXcjZkd22rGNW5ZyL1git