Skip to content

Commit

Permalink
on gui close, end tasks just in case
Browse files Browse the repository at this point in the history
  • Loading branch information
ryderbelserion committed Sep 30, 2024
1 parent 965f919 commit 8580322
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ public void open() {

this.gui.setOpenGuiAction(action -> this.userManager.addRespinPrize(this.player.getUniqueId(), this.crate.getFileName(), this.settings.getPrize().getSectionName()));

this.gui.setCloseGuiAction(action -> {
this.crateManager.removePlayerFromOpeningList(this.player);
this.crateManager.removeCrateInUse(this.player);
this.crateManager.removeCrateTask(this.player);
this.crateManager.endCrate(this.player);
});

this.gui.setItem(this.settings.getSlot(), new GuiItem(this.settings.getPrize().getDisplayItem(this.player, this.crate)));

this.gui.open(this.player);
Expand Down

0 comments on commit 8580322

Please sign in to comment.