Skip to content

fix: resolve WorthPacketListener compilation failure due to field shadowing in anonymous class - #15

Merged
Faboit1 merged 3 commits into
mainfrom
copilot/add-sellworth-feature
Jun 3, 2026
Merged

fix: resolve WorthPacketListener compilation failure due to field shadowing in anonymous class#15
Faboit1 merged 3 commits into
mainfrom
copilot/add-sellworth-feature

Conversation

Copilot AI commented Jun 3, 2026

Copy link
Copy Markdown

CI was failing to compile because inside the anonymous PacketAdapter subclass, the unqualified plugin reference resolved to PacketAdapter's own plugin field (type org.bukkit.plugin.Plugin) rather than WorthPacketListener's field (type SellPlugin), making getConfigManager() unavailable.

Change

  • WorthPacketListener.java: Qualify plugin as WorthPacketListener.this.plugin inside the anonymous PacketAdapter to explicitly target the outer class's SellPlugin field.
// Before — resolves to PacketAdapter.plugin (type Plugin), no getConfigManager()
if (!plugin.getConfigManager().isWorthEnabled()) return;

// After — resolves to WorthPacketListener.plugin (type SellPlugin)
if (!WorthPacketListener.this.plugin.getConfigManager().isWorthEnabled()) return;

Copilot AI changed the title Add packet-based sell worth tooltips, fast sell-all, and sell GUI flow fixes fix: resolve WorthPacketListener compilation failure due to field shadowing in anonymous class Jun 3, 2026
Copilot AI requested a review from Faboit1 June 3, 2026 03:41
@Faboit1
Faboit1 marked this pull request as ready for review June 3, 2026 03:43
@Faboit1
Faboit1 merged commit aea3f85 into main Jun 3, 2026
1 check passed
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