package io.musician101.musicianlibrary.java.minecraft.gui.chest;

import java.util.List;

public abstract class ChestGUI<C, G extends ChestGUI<C, G, I, J, P, S>, I, J, P, S> {

    protected final List<GUIButton<C, G, I, J, P, S>> buttons;
    protected final I inventory;
    protected final int page;
    protected final P player;
    protected final J plugin;
    protected final G prevGUI;

    protected ChestGUI(I inventory, P player, int page, List<GUIButton<C, G, I, J, P, S>> buttons, G prevGUI, J plugin, boolean manualOpen) {
        this.inventory = inventory;
        this.player = player;
        this.page = page;
        this.buttons = buttons;
        this.prevGUI = prevGUI;
        this.plugin = plugin;
        if (!manualOpen) {
            open();
        }
    }

    public abstract void close();

    public abstract void open();
}

@@ -81,16 +81,83 @@
 il.List;
+%0Aimport javax.annotation.Nonnull;%0Aimport javax.annotation.Nullable;
 %0A%0Apublic
@@ -237,16 +237,29 @@
 , S%3E %7B%0A%0A
+    @Nonnull%0A
     prot
@@ -309,24 +309,37 @@
 %3E%3E buttons;%0A
+    @Nonnull%0A
     protecte
@@ -385,24 +385,37 @@
 l int page;%0A
+    @Nonnull%0A
     protecte
@@ -428,24 +428,37 @@
 l P player;%0A
+    @Nonnull%0A
     protecte
@@ -471,24 +471,38 @@
 l J plugin;%0A
+    @Nullable%0A
     protecte
@@ -544,16 +544,25 @@
 hestGUI(
+@Nonnull 
 I invent
@@ -565,16 +565,25 @@
 ventory,
+ @Nonnull
  P playe
@@ -594,16 +594,25 @@
 nt page,
+ @Nonnull
  List%3CGU
@@ -646,16 +646,26 @@
 buttons,
+ @Nullable
  G prevG
@@ -667,16 +667,25 @@
 prevGUI,
+ @Nonnull
  J plugi
@@ -959,16 +959,16 @@
 %0A    %7D%0A%0A
-
     publ
@@ -994,16 +994,93 @@
 ose();%0A%0A
+    @Nullable%0A    public G getPreviousGUI() %7B%0A        return prevGUI;%0A    %7D%0A%0A
     publ

Add a method to get the previous GUI.