dev.aurelium.slate.menu.LoadedMenu Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of slate Show documentation
Show all versions of slate Show documentation
API for building user-configurable GUI menus
The newest version!
package dev.aurelium.slate.menu;
import dev.aurelium.slate.action.Action;
import dev.aurelium.slate.action.trigger.MenuTrigger;
import dev.aurelium.slate.component.MenuComponent;
import dev.aurelium.slate.fill.FillData;
import dev.aurelium.slate.item.MenuItem;
import org.bukkit.entity.Player;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
public record LoadedMenu(
String name,
String title,
int size,
Map items,
Map components,
Map formats,
FillData fillData,
Map options,
Map> actions
) {
public void executeActions(MenuTrigger trigger, Player player, MenuInventory menuInventory) {
List actionList = actions.getOrDefault(trigger, new ArrayList<>());
for (Action action : actionList) {
action.execute(player, menuInventory, menuInventory.getContents());
}
}
}