Fix /kit view not closing.
Fixes
@@ -84,6 +84,7 @@ public class KitListener implements Reloadable, ListenerBase {
gds.save();
player.sendMessage(Nucleus.getNucleus().getMessageProvider().getTextMessageWithFormat("command.kit.edit.success", x.getFirst().getName()));
handler.removeKitInventoryFromListener(inventory);
+ return;
}
} catch (Exception e) {
if (Nucleus.getNucleus().isDebugMode()) {
@@ -95,9 +96,13 @@ public class KitListener implements Reloadable, ListenerBase {
});
if (handler.isViewer(inventory)) {
+ if (event instanceof InteractInventoryEvent.Close) {
+ this.handler.removeViewer(inventory);
+ } else {
event.setCancelled(true);
}
}
+ }
private String fixup(List<Text> texts) {
return getCommand(texts.stream().map(x -> {
