Skip to content

Conversation

@Machine-Maker
Copy link
Member

@Machine-Maker Machine-Maker commented Mar 18, 2023

You can create TagUpdates on the Registry instance, which you can then send to a single player or apply to the whole server to affect all players.

// createTagUpdate will throw UOE on all non-CraftRegistry impls
TagUpdate<?> update = Registry.STRUCTURE.createTagUpdate(map -> { 
    // map is a mutable Map<Key, Set<Structure>>
    map.put(Key.key("eye_of_ender_located"), Collections.emptySet()); // will prevent eye of enders from finding strongholds
});

Bukkit.getServer().applyTagUpdate(update);
- [ ] https://github.com/PaperMC/Paper/pull/8920

@Machine-Maker Machine-Maker force-pushed the feature/tag-modification-api branch from c22fbe7 to 57f3d26 Compare March 19, 2023 18:40
@Machine-Maker Machine-Maker marked this pull request as ready for review March 19, 2023 18:40
@Machine-Maker Machine-Maker requested a review from a team as a code owner March 19, 2023 18:40
@Machine-Maker
Copy link
Member Author

Added a method to edit a single registry's tags directly. Also added improved javadocs listing the 2 registries this works with and that its best to group changes to multiple registries.

@Machine-Maker Machine-Maker force-pushed the feature/tag-modification-api branch from 57f3d26 to 521e9cf Compare March 19, 2023 19:04
@Warriorrrr Warriorrrr moved this from Awaiting review to Waiting For Author in Paper PR Queue Mar 5, 2025
@kennytv kennytv added the pre-softspoon: never rebased Pre-hardfork pull requests that were not re-opened with the new main branch label Mar 23, 2025
@kennytv kennytv deleted the branch master March 23, 2025 19:15
@kennytv kennytv closed this Mar 23, 2025
@kennytv kennytv deleted the feature/tag-modification-api branch March 23, 2025 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pre-softspoon: never rebased Pre-hardfork pull requests that were not re-opened with the new main branch pre-softspoon

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants