22
33import io .github .projectunified .minelib .plugin .base .Loadable ;
44import me .hsgamer .bettergui .BetterGUI ;
5- import me .hsgamer .bettergui .action .type .*;
5+ import me .hsgamer .bettergui .action .type .BackAction ;
6+ import me .hsgamer .bettergui .action .type .CloseMenuAction ;
7+ import me .hsgamer .bettergui .action .type .OpenMenuAction ;
8+ import me .hsgamer .bettergui .action .type .UpdateMenuAction ;
69import me .hsgamer .bettergui .api .element .MenuElement ;
710import me .hsgamer .hscore .action .builder .ActionInput ;
811import me .hsgamer .hscore .action .common .Action ;
912import me .hsgamer .hscore .bukkit .action .PlayerAction ;
1013import me .hsgamer .hscore .bukkit .action .builder .BukkitActionBuilder ;
1114import me .hsgamer .hscore .bukkit .utils .ColorUtils ;
1215import me .hsgamer .hscore .common .CollectionUtils ;
16+ import org .bukkit .plugin .java .JavaPlugin ;
1317
1418import java .util .List ;
1519import java .util .stream .Collectors ;
@@ -27,8 +31,8 @@ public ActionBuilder(BetterGUI plugin) {
2731 @ Override
2832 public void load () {
2933 BukkitActionBuilder .register (this , plugin , ColorUtils ::colorize );
30- register (OpenMenuAction :: new , "open-menu" , "open" , "menu" , "open-menu" );
31- register (BackAction :: new , "back-menu" , "backmenu" );
34+ register (input -> new OpenMenuAction ( plugin , input ) , "open-menu" , "open" , "menu" , "open-menu" );
35+ register (input -> new BackAction ( plugin , input ) , "back-menu" , "backmenu" );
3236 register (input -> new CloseMenuAction (input .getMenuElement ().getMenu ()), "close-menu" , "closemenu" );
3337 register (input -> new UpdateMenuAction (input .getMenuElement ().getMenu ()), "update-menu" , "updatemenu" );
3438 }
@@ -51,7 +55,7 @@ public List<Action> build(MenuElement menuElement, Object object) {
5155 .stream ()
5256 .map (input -> Input .create (menuElement , input ))
5357 .collect (Collectors .toList ());
54- return build (inputs , input -> new PlayerAction (BetterGUI . getInstance ( ), input .getOriginalValue ()));
58+ return build (inputs , input -> new PlayerAction (JavaPlugin . getPlugin ( BetterGUI . class ), input .getOriginalValue ()));
5559 }
5660
5761 public interface Input extends ActionInput {
0 commit comments