Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tag Modification API #9002

Closed
wants to merge 5 commits into from
Closed

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);

Tasks

Preview Give feedback
  1. 15 of 16

@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
@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.

3 participants