Restore retained native menu facade and safe service navigation

This commit is contained in:
unimatrixgit 2026-11-29 12:39:38 +01:00
commit ea16e0e93d

View file

@ -239,6 +239,11 @@ public final class DuneGUI extends JavaPlugin implements Listener,CommandExecuto
if(id.equals(selection(data))&&data.has("keyId")&&!data.get("keyId").isJsonNull()){mentat(p,data);return;}
fetch(p,id,data.get("version").getAsInt(),UUID.randomUUID(),saved->{p.sendMessage(Component.text("House allegiance confirmed in J.A.R.V.I.S.",NamedTextColor.GREEN));mentat(p,saved);});
}
public void openNativeMenu(Player player,String id){
if(!Bukkit.isPrimaryThread()||!player.isOnline())throw new IllegalStateException("Native menus require an online player on the server thread");
switch(id){case "hub"->organisations.console(player);case "exchange"->exchange.open(player);case "spice"->spice.open(player);case "travel"->openGuild(player,null);case "clan"->organisations.open(player,"clans");case "company"->organisations.open(player,"companies");case "politics"->organisations.open(player,"offices");case "missions"->quests.open(player);case "war"->warMenus.open(player);case "lore"->organisations.lore(player);case "mentat"->fetch(player,null,0,null,data->mentat(player,data));case "house"->fetch(player,null,0,null,data->select(player,data,selection(data)));case "equipment"->quests.quartermaster(player,()->exchange.open(player),()->exchange.openKits(player));default->throw new IllegalArgumentException("Unknown native menu");}
}
public void closeSuppliedMenu(Player player){MCGUIMenus.dismiss(player);}
public void openExchangeMenu(Player player){if(!Bukkit.isPrimaryThread()||!player.isOnline())throw new IllegalStateException("Exchange entry requires an online player on the server thread");exchange.open(player);}
private void mentat(Player p,JsonObject data){
String house=selection(data);if(house==null){select(p,data,null);return;}