Add environment-based icons for region protection#38
Merged
Conversation
- introduce iconByEnvironment map to associate environments with item types - update createRegionItem function to use environment-specific icons - change default protectListItem icon to GRASS_BLOCK
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the region-protection UI to support environment-specific display icons via configuration, and updates a couple of menu item visuals for consistency, alongside a patch version bump.
Changes:
- Add
ProtectionConfig.protection.iconByEnvironmentto mapWorld.Environment→ItemTypewith sensible defaults. - Update
createRegionItemto choose its baseItemStackbased on the region world’s environment (with a grass-block fallback). - Tweak the main protection menu list item icon (dirt → grass block) and bump version to
3.2.10.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/main/kotlin/dev/slne/surf/protect/paper/menu/view/ProtectionMainView.kt | Switches the “Meine Grundstücke” menu icon to a grass block for improved consistency. |
| src/main/kotlin/dev/slne/surf/protect/paper/menu/util/view-util.kt | Makes createRegionItem select an icon based on the region’s world environment via config (fallback to grass). |
| src/main/kotlin/dev/slne/surf/protect/paper/config/ProtectionConfig.kt | Introduces iconByEnvironment configuration with defaults for Overworld/Nether/End. |
| gradle.properties | Bumps project version from 3.2.9 to 3.2.10. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
This pull request updates the region protection system to allow configurable display icons for protected regions based on the world environment, and makes several related improvements to item selection in the UI. It also includes a minor version bump.
Configurable region icons:
iconByEnvironmentproperty toProtectionConfig, allowing configuration of the display item (ItemType) for eachWorld.Environment(Overworld, Nether, End). Default values are provided.ItemTypefor use in configuration.Menu and UI improvements:
createRegionItemto select the base item stack according to the region's world environment using the new config, defaulting to grass block if not specified. The function now accepts an optionalbaseItemStackparameter.protectListItemin the main protection menu from dirt to grass block for improved visual consistency.configto support access to the new configuration in menu utilities.Versioning:
3.2.9to3.2.10.