Skip to content

Add environment-based icons for region protection#38

Merged
twisti-dev merged 2 commits into
version/26.1from
refactor/change-icons
Jun 6, 2026
Merged

Add environment-based icons for region protection#38
twisti-dev merged 2 commits into
version/26.1from
refactor/change-icons

Conversation

@twisti-dev

Copy link
Copy Markdown
Contributor

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:

  • Added a new iconByEnvironment property to ProtectionConfig, allowing configuration of the display item (ItemType) for each World.Environment (Overworld, Nether, End). Default values are provided.
  • Updated imports to include ItemType for use in configuration.

Menu and UI improvements:

  • Modified createRegionItem to 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 optional baseItemStack parameter.
  • Changed the default item for protectListItem in the main protection menu from dirt to grass block for improved visual consistency.
  • Added import for config to support access to the new configuration in menu utilities.

Versioning:

  • Bumped the project version from 3.2.9 to 3.2.10.

- introduce iconByEnvironment map to associate environments with item types
- update createRegionItem function to use environment-specific icons
- change default protectListItem icon to GRASS_BLOCK
@twisti-dev twisti-dev self-assigned this Jun 6, 2026
Copilot AI review requested due to automatic review settings June 6, 2026 21:33
@twisti-dev twisti-dev merged commit 15b6f46 into version/26.1 Jun 6, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.iconByEnvironment to map World.EnvironmentItemType with sensible defaults.
  • Update createRegionItem to choose its base ItemStack based 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants