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

Fixes ItemParser. #2257

Merged
merged 3 commits into from
Jan 4, 2024
Merged

Fixes ItemParser. #2257

merged 3 commits into from
Jan 4, 2024

Conversation

BONNe
Copy link
Member

@BONNe BONNe commented Jan 3, 2024

Implements new Potion and Skull parsing.
Fixes custom model data parsing.
Implements ItemFactory#createItemStack parsing that parses item using /give syntax.

Solves some issues mentioned in #2198

Implements new Potion and Skull parsing.
Fixes custom model data parsing.
Implements ItemFactory#createItemStack parsing that parses item using `/give` syntax.

Solves some issues mentioned in #2198
@BONNe BONNe requested a review from tastybento January 4, 2024 07:41
@tastybento
Copy link
Member

There's one test that's failing, which is world.bentobox.bentobox.api.localization.BentoBoxLocaleTest#testGetBanner.

This is a pretty simple test that should be able to generate a banner from Yaml.

        YamlConfiguration config = new YamlConfiguration();
        config.set("meta.banner", "WHITE_BANNER:1:STRIPE_SMALL:RED:SQUARE_TOP_RIGHT:CYAN:SQUARE_TOP_RIGHT:BLUE");

The issue is that right now, when this class runs it tries:

        // Load the banner from the configuration
        banner = ItemParser.parse(config.getString("meta.banner"));

But the return is null. Any idea what?

In runTime ItemFactory#createItemStack from invalid text would throw IllegalArgumentException.
@BONNe
Copy link
Member Author

BONNe commented Jan 4, 2024

I solved it. The issue was that IllegalArgumentException was not thrown because of mocked class.

Copy link

sonarcloud bot commented Jan 4, 2024

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

5 New issues
0 Security Hotspots
58.6% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

@tastybento tastybento merged commit caade1a into develop Jan 4, 2024
2 checks passed
@tastybento tastybento deleted the fix-item-parser branch January 4, 2024 12:30
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