Skip to content

Commit

Permalink
menu input on InventoryBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
HSGamer committed Jan 9, 2023
1 parent 89a436e commit acba0aa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package me.hsgamer.bettergui.builder;

import me.hsgamer.bettergui.api.menu.Menu;
import me.hsgamer.hscore.builder.Builder;
import me.hsgamer.hscore.bukkit.gui.GUIDisplay;
import me.hsgamer.hscore.bukkit.gui.GUIHolder;
import me.hsgamer.hscore.bukkit.gui.GUIUtils;
import me.hsgamer.hscore.common.Pair;
import org.bukkit.Bukkit;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
Expand All @@ -15,7 +17,7 @@
/**
* A builder to get the creator to build the {@link Inventory} for any {@link me.hsgamer.bettergui.menu.BaseInventoryMenu} implementation
*/
public class InventoryBuilder extends Builder<Map<String, Object>, BiFunction<GUIDisplay, UUID, Inventory>> {
public class InventoryBuilder extends Builder<Pair<Menu, Map<String, Object>>, BiFunction<GUIDisplay, UUID, Inventory>> {
/**
* The singleton instance
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import me.hsgamer.hscore.bukkit.utils.MessageUtils;
import me.hsgamer.hscore.collections.map.CaseInsensitiveStringMap;
import me.hsgamer.hscore.common.CollectionUtils;
import me.hsgamer.hscore.common.Pair;
import me.hsgamer.hscore.common.Validate;
import me.hsgamer.hscore.config.Config;
import org.bukkit.Bukkit;
Expand Down Expand Up @@ -180,7 +181,7 @@ protected void onClose(InventoryCloseEvent event) {

Optional.ofNullable(values.get("creator"))
.map(String::valueOf)
.flatMap(s -> InventoryBuilder.INSTANCE.build(s, values))
.flatMap(s -> InventoryBuilder.INSTANCE.build(s, Pair.of(this, values)))
.ifPresent(guiHolder::setInventoryFunction);
}
}
Expand Down

0 comments on commit acba0aa

Please sign in to comment.