mirror of
https://github.com/Pumpkin-MC/Pumpkin.git
synced 2026-08-30 20:14:23 +00:00
* feat(command): add /locate structure Implements /locate structure <name> on top of the existing find_nearest_structure infrastructure (already used by eyes of ender), with tab-completion for the known structure sets and vanilla-style clickable [x, ~, z] teleport coordinates plus horizontal distance in the success message. Notes: - Structure names refer to the generator's structure sets (villages, desert_pyramids, ...), optionally prefixed with minecraft:. - Like the ender-eye path, stronghold (concentric-rings) lookups depend on the global structure cache being populated. Closes #2230 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * refactor(command): derive locate suggestions from generated StructureSet::NAMES Addresses review feedback: the structure set names are now emitted by pumpkin-codegen alongside StructureSet::ALL instead of being hard coded in the locate command. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * feat(command): add /locate biome and /locate poi, use ResourceOrTag arguments Addresses review feedback on the /locate PR: - New ResourceOrTagKeyArgument / ResourceOrTagArgument types mirroring vanilla's argument pair: both parse `id` or `#tag`, the latter also validates against the generated registry/tag data at parse time and raises vanilla's argument.resource(_tag).not_found errors. /locate structure now uses them instead of StringArgument. - /locate biome: vanilla-parity spiral search (6400 block radius, 32 block horizontal / 64 block vertical steps) over the dimension's noise biome source via the new find_closest_biome_3d in pumpkin-world, including the possibleBiomes short-circuit (walked from the BiomeTree) and superflat support. Runs on a blocking thread, reports the 3D distance and absolute-y clickable coordinates, and appends the concretely found biome for tag searches ("#minecraft:is_forest (minecraft:forest)"), all like vanilla. - /locate poi: searches the world's POI storage within 256 blocks via the new PoiStorage::find_closest_matching (chebyshev gather, closest by 3D distance, like PoiManager.findClosestWithType), with tag support from the generated point_of_interest_type tag data. - Suggestion matching now also treats ':' as a word separator so that e.g. "vil" completes to "minecraft:villages". Notes / limitations: - There is no generated structure tag or POI type registry data yet, so structure "#tags" resolve to the invalid-structure error and POI ids are accepted leniently (unknown ones simply report not-found); only nether portal POIs are currently recorded by the server. Closes #2230 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * refactor(command): run structure search off the async executor, drop panic on join errors Review follow-ups on the /locate PR: - /locate structure now runs its search on spawn_blocking like the biome search does; scanning up to 100 regions of placement data is just as CPU-bound as the biome spiral. - Blocking-task join errors (panic/cancellation) are mapped to a "search failed" command error instead of panicking the command task via .expect. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * chore(command): adapt /locate to upstream API changes Rebasing onto master picked up three signature changes: WorldGenerator gained a Custom variant for plugin generators, BIOME_REGISTRY became a reference, and Level::world_gen is now an ArcSwap. Plugin generators only expose biomes by generating a whole chunk, so /locate biome reports no match for them rather than pretending to search. * fix(command): report structures /locate can actually find /locate structure returned the placement grid's candidate chunk without checking whether a structure grows there. Candidates are only possible sites: the biome at one can reject every structure in the set, so the command happily pointed at empty terrain. Resolve the structure start for random-spread sets instead, over every structure the set contains, which is what explorer maps already do. Strongholds keep using the ring cache, whose positions are real and which the start lookup does not handle. Co-authored-by: Mcxiaocaibug <Mcxiaocaibug@users.noreply.github.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>