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

add enchantment abbreviations as slot text #1056

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Morazzer
Copy link

No description provided.

@LifeIsAParadox LifeIsAParadox added the reviews needed This PR needs reviews label Nov 16, 2024
@AzureAaron AzureAaron added the new feature This issue or PR is a new feature label Nov 16, 2024
Copy link
Collaborator

@kevinthegreat1 kevinthegreat1 left a comment

Choose a reason for hiding this comment

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

I feel like there should be a better way of reporting duplicates but I can't think right now.

for (Map.Entry<String, String> entry : ID_ABBREVIATION_MAP.entrySet()) {
final String put = otherDirection.put(entry.getValue(), entry.getKey());
if (put != null) {
throw new IllegalArgumentException("Duplicate key [%s, %s] for value %s".formatted(put, entry.getKey(), entry.getValue()));
Copy link
Collaborator

Choose a reason for hiding this comment

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

No need to throw here, logging an error is sufficient.

Copy link
Author

Choose a reason for hiding this comment

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

I explicitly decided to throw an exception, since you may not notice a simple log. And since the exception will only be throw in a debug/development environment I assumed it should be fine

Copy link
Collaborator

Choose a reason for hiding this comment

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

Actually, this would be more sufficient as a unit test. This way we also don't ship test code.

@x-yingcan-x
Copy link
Contributor

will this add to weapons/armors? e.g. for terminator,used to tell if it's SE or duplex
maybe need to enable through /skyblocker custom instead of globally

return Text.empty();
}

final int color;
Copy link
Collaborator

Choose a reason for hiding this comment

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

replace this with a switch

@LifeIsAParadox LifeIsAParadox added changes requested This PR need changes and removed reviews needed This PR needs reviews labels Dec 5, 2024
@AzureAaron AzureAaron added the merge conflicts This PR has merge conflicts that need solving. label Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changes requested This PR need changes merge conflicts This PR has merge conflicts that need solving. new feature This issue or PR is a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants