Skip to content

Fix AttributeModifier serialization, download exception handling, selector nullability, and relocation package naming - #27

Merged
srnyx merged 7 commits into
srnyx:mainfrom
Spagles:main
Aug 1, 2026
Merged

srnyx merged 7 commits into
srnyx:mainfrom
Spagles:main

Conversation

@Spagles

@Spagles Spagles commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Description

  • AttributeModifier Serialization: Added ATTRIBUTE_MODIFIER_GET_AMOUNT_METHOD to RefAttributeModifier and updated AttributeModifierSerializer#serialize to write the required "amount" field during serialization.
  • Dependency Downloader Fail-Safe: Updated AnnoyingDownload#downloadFile to catch IOException during stream operations, properly invoking fail(dependency, platform) to attempt fallback platforms instead of logging false success and loading corrupt/empty files.
  • Selector Optional Null Safety: Added raw == null checks to SelectorOptional#orElse, orElseSingle, and orElseFlat to prevent passing null to @NotNull Function arguments when no input is supplied.
  • Relocation Package Parsing: Updated AnnoyingPlugin#getRelocation to safely compute package name indices when standard dot-separated package strings (without {} delimiters) are provided.

Motivation and Context

  • Deserializing AttributeModifier objects failed with IllegalArgumentException("Missing required field: amount") due to missing serialization output.
  • Failed network requests or interrupted downloads in AnnoyingDownload were swallowed silently, causing invalid JARs to be passed to Bukkit's plugin manager.
  • Command selector resolution threw NullPointerException when evaluating default functions for absent command arguments.
  • Standard package strings passed to getRelocation resulted in corrupted package target paths (e.g. "org.reflections" becoming "rg.reflections").

How Has This Been Tested?

  • Executed unit test suite (./gradlew test) including AttributeModifierSerializerTest, ConfigMigrationTest, and storage dialect tests using MockBukkit.
  • Verified round-trip serialization of AttributeModifier and valid handling of dependency download fallbacks.

Media:

N/A

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have read the CONTRIBUTING document.
  • All new and existing tests passed.

@srnyx
srnyx merged commit a94f930 into srnyx:main Aug 1, 2026
2 checks passed
@srnyx

srnyx commented Aug 1, 2026

Copy link
Copy Markdown
Owner

thanks

@srnyx srnyx added the bug Something isn't working label Aug 1, 2026
@srnyx srnyx added this to the 6.0.0 milestone Aug 1, 2026
@StormCode-dev

Copy link
Copy Markdown

Hey. Just wanted to give you a heads up that the account activity for Spagles is incredibly odd, and of the four commits they added to my forked repo, proved to be flat-out wrong or generally avoided practice. I'd probably double check the account's changes again, just in case.

@srnyx

srnyx commented Aug 2, 2026 •

Copy link
Copy Markdown
Owner

Hey. Just wanted to give you a heads up that the account activity for Spagles is incredibly odd, and of the four commits they added to my forked repo, proved to be flat-out wrong or generally avoided practice. I'd probably double check the account's changes again, just in case.

hi, thanks. yeah i can tell this entire PR was AI-generated (would be nice if they said that) so i triple-checked everything and discussed with some other ppl. the changes here are super minimal and all okay. appreciate the heads up.

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants