diff --git a/paper/src/main/java/com/badbones69/crazycrates/api/builders/types/features/CrateSpinMenu.java b/paper/src/main/java/com/badbones69/crazycrates/api/builders/types/features/CrateSpinMenu.java index 5892ee143..266c164b9 100644 --- a/paper/src/main/java/com/badbones69/crazycrates/api/builders/types/features/CrateSpinMenu.java +++ b/paper/src/main/java/com/badbones69/crazycrates/api/builders/types/features/CrateSpinMenu.java @@ -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);