Skip to content

Fix SCore dependency name in paper-plugin.yml and onDisable NPE - #314

Merged
BlitzOffline merged 1 commit into
HelpChat:mainfrom
entity:fix/paper-plugin-score-and-disable-npe
Nov 11, 2026
Merged

BlitzOffline merged 1 commit into
HelpChat:mainfrom
entity:fix/paper-plugin-score-and-disable-npe

Conversation

@entity

@entity entity commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Two small fixes found while reviewing the Paper migration (#228).

Changes

  • paper-plugin.yml: Score → SCore. The SCore plugin is named SCore, so the old Score entry never matched anything. The ExecutableItems/ExecutableBlocks hooks still work today, because they resolve com.ssomar.score.* through the declared ExecutableItems plugin's classloader. With this fix the dependency is declared correctly, so load order and class visibility no longer depend on that fallback.
  • DeluxeMenus#onDisable: null-guard itemHooks. If onEnable stops early (for example when PlaceholderAPI is missing), itemHooks is never set and disabling throws:
    Error occurred while disabling DeluxeMenus
    java.lang.NullPointerException: Cannot invoke "java.util.Map.clear()" because "this.itemHooks" is null
    
    This bug predates the migration.

Testing

On a local Paper 26.2 (build 112) server with PlaceholderAPI 2.12.3, stub SCore/ExecutableItems plugins, and a stub Bukkit addon that depends on DeluxeMenus:

  • DeluxeMenus loads as a Paper plugin, hooks PlaceholderAPI and loads the default menus. /dm, /dm list and /dm reload work from the console.
  • The executableitems item hook resolves SCore classes and builds an item, both before and after the rename.
  • A Bukkit addon can listen to DeluxeMenusOpenMenuEvent and call DeluxeMenus#getItemHook.
  • With PlaceholderAPI removed, DeluxeMenus disables cleanly without the NPE.

- paper-plugin.yml declared the SCore dependency as 'Score', which does not
  match the plugin's actual name ('SCore'), so the dependency entry was never
  resolved.
- onDisable() called itemHooks.clear() unconditionally. When onEnable() bails
  out early (e.g. PlaceholderAPI missing), itemHooks is still null and
  disabling throws a NullPointerException.
@BlitzOffline
BlitzOffline merged commit bac8d8d into HelpChat:main Nov 11, 2026
2 checks passed
Namnarak added a commit to CyoriaSMP-Team/DeluxeMenus-Folia that referenced this pull request Nov 12, 2026
Namnarak added a commit to CyoriaSMP-Team/DeluxeMenus-Folia that referenced this pull request Nov 12, 2026
Namnarak added a commit to CyoriaSMP-Team/DeluxeMenus-Folia that referenced this pull request Nov 12, 2026
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