Feature: Custoimizable icons for Companies in GUIs#60
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request adds support for customizable company icons in the Blockstreet Minecraft plugin, allowing administrators and players to specify a Bukkit Material as an icon when creating companies. The feature maintains backward compatibility by using the previously hardcoded materials (DIAMOND for investments, EMERALD for companies) as defaults when no custom icon is specified.
- Added
iconfield to data model (CompanyDao and CompanyEntity) with proper nullable handling - Extended company creation commands to accept an optional Material parameter
- Created MaterialArgumentParser for validating Material arguments
- Updated migration to set EMERALD as the default icon for legacy companies
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/java/dev/hugog/minecraft/blockstreet/data/entities/CompanyEntity.java | Added Material icon field to entity model |
| src/main/java/dev/hugog/minecraft/blockstreet/data/dao/CompanyDao.java | Added nullable Material icon field with proper mapping in toEntity/fromEntity methods |
| src/main/java/dev/hugog/minecraft/blockstreet/data/services/CompaniesService.java | Extended createPlayerCompany and createAdminCompany to accept Material icon parameter |
| src/main/java/dev/hugog/minecraft/blockstreet/ui/items/CompanyItem.java | Updated to use custom icon with EMERALD fallback |
| src/main/java/dev/hugog/minecraft/blockstreet/ui/items/InvestmentItem.java | Updated to use custom icon with DIAMOND fallback |
| src/main/java/dev/hugog/minecraft/blockstreet/commands/CreateCommand.java | Added optional icon argument with Material tab completion |
| src/main/java/dev/hugog/minecraft/blockstreet/commands/AdminCreateCommand.java | Added optional icon argument with Material tab completion |
| src/main/java/dev/hugog/minecraft/blockstreet/commands/validators/MaterialArgumentParser.java | New argument parser for validating Bukkit Material values |
| src/main/java/dev/hugog/minecraft/blockstreet/migration/v110/CompaniesMigrator.java | Sets EMERALD as default icon for migrated companies; minor formatting fix |
| pom.xml | Updated invui dependency from version 1.46 to 1.47 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/main/java/dev/hugog/minecraft/blockstreet/commands/validators/MaterialArgumentParser.java
Show resolved
Hide resolved
src/main/java/dev/hugog/minecraft/blockstreet/commands/CreateCommand.java
Show resolved
Hide resolved
src/main/java/dev/hugog/minecraft/blockstreet/commands/AdminCreateCommand.java
Show resolved
Hide resolved
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 adds support for custom company icons in the Blockstreet plugin, allowing both administrators and players to specify a Bukkit
Materialas an icon when creating a company. For existing companies, the icons can be changed through the companies' data files.