Preserve JARVIS menus while porting gameplay, Citizens NPCs and plugin-only CI

This commit is contained in:
unimatrixgit 2026-11-29 01:54:16 +01:00
commit dbf4bb25ff

View file

@ -41,7 +41,7 @@ public final class DuneLobby extends JavaPlugin implements Listener, CommandExec
@Override public boolean shouldGenerateStructures() { return false; }
}
@Override public void onEnable() {
saveDefaultConfig(); roleKey=new NamespacedKey(this,"role");
saveDefaultConfig(); roleKey=new NamespacedKey(this,"role"); com.dunerealms.npc.CitizensBridge.start(this,roleKey);
getCommand("lobby").setExecutor(this); getCommand("dunelobby").setExecutor(this);
Bukkit.getPluginManager().registerEvents(this,this);
Bukkit.getMessenger().registerOutgoingPluginChannel(this,"BungeeCord");
@ -92,7 +92,7 @@ public final class DuneLobby extends JavaPlugin implements Listener, CommandExec
npc("spice","Discreet Spice Seller",-54,81,110,Villager.Profession.LEATHERWORKER);
}
private void npc(String role,String name,int x,int y,int z,Villager.Profession profession) {
for(Villager entity:lobby.getEntitiesByClass(Villager.class)) if(role.equals(entity.getPersistentDataContainer().get(roleKey,PersistentDataType.STRING))) return;
for(LivingEntity entity:lobby.getEntitiesByClass(LivingEntity.class)) if(role.equals(entity.getPersistentDataContainer().get(roleKey,PersistentDataType.STRING))) return;
lobby.spawn(new Location(lobby,x+.5,y,z+.5,180,0),Villager.class,v->{
v.setCustomName(ChatColor.GOLD+name); v.setCustomNameVisible(true); v.setAI(false); v.setSilent(true);
v.setInvulnerable(true); v.setPersistent(true); v.setRemoveWhenFarAway(false); v.setProfession(profession);
@ -147,7 +147,7 @@ public final class DuneLobby extends JavaPlugin implements Listener, CommandExec
if(!lobby.getBlockAt(p[0],128,p[1]).getType().isOccluding()) failures.add("missing flat ceiling "+Arrays.toString(p));
for(int y:new int[]{81,96,120}) for(int[] p:new int[][]{{-126,0},{96,0},{0,-98},{0,130}})
if(!lobby.getBlockAt(p[0],y,p[1]).getType().isOccluding()) failures.add("visible sky boundary "+Arrays.toString(p));
for(String role:List.of("liaison","exchange","water","spice")) if(lobby.getEntitiesByClass(Villager.class).stream().noneMatch(v->role.equals(v.getPersistentDataContainer().get(roleKey,PersistentDataType.STRING)))) failures.add("missing NPC "+role);
for(String role:List.of("liaison","exchange","water","spice")) if(lobby.getEntitiesByClass(LivingEntity.class).stream().noneMatch(v->role.equals(v.getPersistentDataContainer().get(roleKey,PersistentDataType.STRING)))) failures.add("missing NPC "+role);
long art=lobby.getEntitiesByClass(ItemFrame.class).stream().filter(v->v.getPersistentDataContainer().has(new NamespacedKey(this,"art"),PersistentDataType.STRING)).count();
if(art!=LobbyArtwork.tileCount()) failures.add("art frames "+art+" != "+LobbyArtwork.tileCount());
String result="GUILD_VERIFY "+(failures.isEmpty()?"PASS":"FAIL")+" walkable="+seen.size()+" artwork="+art+" "+failures;