Skip to content

Commit

Permalink
[TS-519] Fix error when disabling TradeSystem while a trade is open
Browse files Browse the repository at this point in the history
Closes #519
  • Loading branch information
erikzimmermann committed Oct 20, 2024
1 parent bd92614 commit 0dc54a6
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1251,6 +1251,9 @@ protected final void closeInventories() {

guis().forEach(TradingGUI::destroy);

// fix schedulers to be registered when this plugin is about to be disabled
if (!TradeSystem.getInstance().isEnabled()) return;

// fix buggy inventories of other plugins that were opened while trading: close again later
// fix black screens for bedrock players: run with higher delay >10
Bukkit.getScheduler().runTask(TradeSystem.getInstance(), () -> this.getViewers().filter(FloodgateUtils::isNonBedrockPlayer).forEach(p -> {
Expand Down

0 comments on commit 0dc54a6

Please sign in to comment.