From 2e81c9d7b00ac031e7948333811849711a576af2 Mon Sep 17 00:00:00 2001 From: unimatrixgit <95320811+unimatrixgit@users.noreply.github.com> Date: Tue, 13 Oct 2026 07:04:28 +0200 Subject: [PATCH] Add Arrakis plateaus, Guild sighting announcements, and admin sandworm summon --- .gitignore | 2 + DuneEss/build.gradle.kts | 2 +- .../java/com/example/duneess/DuneEss.java | 7 ++ DuneEss/src/main/resources/plugin.yml | 2 +- DuneRealms-minecraft-only/README.md | 6 +- DuneRealms-minecraft-only/build.gradle.kts | 8 ++- .../dunerealms/ArrakisAnnouncements.java | 63 +++++++++++++++++ .../java/com/example/dunerealms/DuneCore.java | 70 +++++++++++++++++-- .../src/main/resources/plugin.yml | 2 +- .../dunerealms/ArrakisAnnouncementsTest.java | 67 ++++++++++++++++++ .../dunerealms/SandwormCommandTest.java | 48 +++++++++++++ DuneTerrain/README.md | 4 +- DuneTerrain/build.gradle.kts | 5 +- .../com/example/duneterrain/DuneTerrain.java | 55 ++++++++++++--- .../com/example/duneterrain/RockPlateaus.java | 18 +++++ DuneTerrain/src/main/resources/config.yml | 3 +- DuneTerrain/src/main/resources/plugin.yml | 2 +- .../example/duneterrain/RockPlateausTest.java | 36 ++++++++++ SESSION-2.md | 23 ++++++ 19 files changed, 396 insertions(+), 27 deletions(-) create mode 100644 .gitignore create mode 100644 DuneRealms-minecraft-only/src/main/java/com/example/dunerealms/ArrakisAnnouncements.java create mode 100644 DuneRealms-minecraft-only/src/test/java/com/example/dunerealms/ArrakisAnnouncementsTest.java create mode 100644 DuneRealms-minecraft-only/src/test/java/com/example/dunerealms/SandwormCommandTest.java create mode 100644 DuneTerrain/src/main/java/com/example/duneterrain/RockPlateaus.java create mode 100644 DuneTerrain/src/test/java/com/example/duneterrain/RockPlateausTest.java create mode 100644 SESSION-2.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..67bcc2f7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.gradle/ +build/ diff --git a/DuneEss/build.gradle.kts b/DuneEss/build.gradle.kts index d5913cdd..fe32f7f2 100644 --- a/DuneEss/build.gradle.kts +++ b/DuneEss/build.gradle.kts @@ -1,6 +1,6 @@ plugins { java } group = "com.example" -version = "1.0.0" +version = "1.0.1" repositories { mavenCentral() maven("https://repo.papermc.io/repository/maven-public/") diff --git a/DuneEss/src/main/java/com/example/duneess/DuneEss.java b/DuneEss/src/main/java/com/example/duneess/DuneEss.java index 3643b474..f76840d4 100644 --- a/DuneEss/src/main/java/com/example/duneess/DuneEss.java +++ b/DuneEss/src/main/java/com/example/duneess/DuneEss.java @@ -67,6 +67,7 @@ public final class DuneEss extends JavaPlugin implements CommandExecutor, TabCom new HelpEntry("/duneess admin teleport sietch", "Teleport yourself to a generated sietch.", Material.CHEST), new HelpEntry("/duneess admin teleport spiceblow", "Teleport yourself to a generated spice blow.", Material.MAGMA_BLOCK), new HelpEntry("/duneess admin spicebloom", "Place an untriggered bloom about 50 blocks ahead of you.", Material.GLOWSTONE), + new HelpEntry("/dune summon sandworm", "Admin: summon on Arrakis; optionally supply x y z.", Material.HUSK_SPAWN_EGG), new HelpEntry("/dune guireload", "Reload DuneCore's configurable Navigator menu.", Material.COMPARATOR) ) ); @@ -514,6 +515,12 @@ public final class DuneEss extends JavaPlugin implements CommandExecutor, TabCom } if(center==null){sender.sendMessage(ChatColor.RED+"No clear sand patch was found 50 blocks ahead.");return;} int x=center.getX(),y=center.getY(),z=center.getZ();for(int dx=-1;dx<=1;dx++)for(int dz=-1;dz<=1;dz++)world.getBlockAt(x+dx,y,z+dz).setType(Material.MAGMA_BLOCK,false);world.getBlockAt(x,y+1,z).setType(Material.MAGMA_BLOCK,false); + org.bukkit.plugin.Plugin core = Bukkit.getPluginManager().getPlugin("DuneCore"); + if (core != null && core.isEnabled()) try { + Location bloom = new Location(world, x, y + 1, z); + core.getClass().getMethod("announceArrakisEvent", String.class, Location.class, String.class) + .invoke(core, "spicebloom", bloom, "bloom:" + world.getUID() + ":" + x + ":" + (y + 1) + ":" + z); + } catch (ReflectiveOperationException ex) { getLogger().warning("Spice bloom announcement failed: " + ex.getMessage()); } sender.sendMessage(ChatColor.GREEN+"Placed a spice bloom near "+x+", "+z+".");target.sendMessage(ChatColor.GOLD+"A spice bloom appeared about 50 blocks ahead."); } diff --git a/DuneEss/src/main/resources/plugin.yml b/DuneEss/src/main/resources/plugin.yml index d0635173..789f875f 100644 --- a/DuneEss/src/main/resources/plugin.yml +++ b/DuneEss/src/main/resources/plugin.yml @@ -1,5 +1,5 @@ name: DuneEss -version: 1.0.0 +version: 1.0.1 main: com.example.duneess.DuneEss api-version: '1.21' depend: [Vault] diff --git a/DuneRealms-minecraft-only/README.md b/DuneRealms-minecraft-only/README.md index fe8e92be..b704f380 100644 --- a/DuneRealms-minecraft-only/README.md +++ b/DuneRealms-minecraft-only/README.md @@ -8,13 +8,13 @@ For proxy travel, configure `network.local-planet` for this backend and the `net Suspicious sand on Arrakis is harvestable spice. Use the tagged netherite spice shovel from `/dune kit`. Spice can be sold with `/duneess sell` and Solaris spent through Guild travel. Each faction has a passive perk; Fremen harvest double spice. Faction data persists in `plugins/DuneCore/players.yml`; DuneEss imports legacy balances from old Dune player files and stores them in its own balances file or shared economy table. -Limitations: this is a gameplay prototype, not a fully polished mod. Custom equipment uses vanilla items and colored names, not resource-pack models. Worlds have themed terrain, but no cities, unique buildings, or detailed biome decorations. Guild NPCs are placed by operators. No permissions-based faction change for ordinary players. The plugin has not been compiled or tested against a running Paper server in this environment. +Limitations: this is a gameplay prototype, not a fully polished mod. Custom equipment uses vanilla items and colored names, not resource-pack models. Worlds have themed terrain, but no cities, unique buildings, or detailed biome decorations. Guild NPCs are placed by operators. No permissions-based faction change for ordinary players. The plugins compile with Java 21; live Paper/Velocity gameplay verification remains pending. Admins with `dune.admin` can force teleport to Arrakis or generated landmarks with `/duneess admin teleport [player]`. Omit the player name to teleport yourself. From console, specify an online player. These commands require the Arrakis world to be loaded on that backend. ## Sandworms (Shai-Hulud) -Hostile oversized Sniffers representing sandworms spawn on sandy surfaces near players **only on Arrakis**, at most once per hour serverwide by default. The successful spawn time is saved in the plugin config, so a restart does not reset the cooldown. They have 500 health and 8 melee damage, and play a Warden roar when emerging. Their default movement attribute is 0.12 with a 1.0 pathfinding speed modifier, making them slightly faster than the Sniffer baseline while leaving sprinting as a way to escape. Settings are under `sandworms` in `config.yml`. `DuneResourcePack.zip` adds a sandworm texture, haunted Fremen husk texture, and distinct spice-gold suspicious sand. Vanilla resource packs change textures, not Sniffer geometry. +Hostile oversized Husks representing sandworms spawn on sandy surfaces near players **only on Arrakis**, at most once per hour serverwide by default. The successful spawn time is saved in the plugin config, so a restart does not reset the cooldown. They have 500 health, 8 melee damage, a movement attribute of 0.33, and scale 3.5, and play a Warden roar when emerging. Settings are under `sandworms` in `config.yml`. Admins can use `/dune summon sandworm [x y z]` to summon one explicitly. Arrakis sightings include coordinates and a fifteen-minute warning before the Spacing Guild informs the network. See [Session 2](../SESSION-2.md) for timer persistence, proxy delivery, and plateau settings. ## Spice contracts and sandworm blooms - On Arrakis, defeating a sandworm generates a broad patch of suspicious-sand spice deposits with a target base harvest value of 100,000 Solaris (actual value depends on available sandy terrain and faction bonuses). @@ -26,7 +26,7 @@ Hostile oversized Sniffers representing sandworms spawn on sandy surfaces near p - `/dune job finish` leaves a job; `/dune job cancel` cancels an unclaimed listing. - A sponsor's job remains listed across restarts, but active worker assignments must be reaccepted after restart. -This is source code, not a tested compiled JAR. +Session 2 builds all three plugin JARs and runs automated terrain, announcement, and command-validation tests. ## Hourly server-issued CHOAM jobs Edit `plugins/DuneCore/server-jobs.yml` to configure job `title`, `spice-required`, `pay`, and `time-limit-minutes`. `offers-per-hour` controls how many are randomly selected. Listings rotate every hour at UTC hour boundaries. Existing accepted contracts persist through restarts, including their original deadlines; if a definition is removed while active, that contract expires without a fine. diff --git a/DuneRealms-minecraft-only/build.gradle.kts b/DuneRealms-minecraft-only/build.gradle.kts index f1ea332f..a5dafa34 100644 --- a/DuneRealms-minecraft-only/build.gradle.kts +++ b/DuneRealms-minecraft-only/build.gradle.kts @@ -1,6 +1,6 @@ plugins { java } group = "com.example" -version = "1.0.3" +version = "1.0.4" repositories { mavenCentral(); maven("https://repo.papermc.io/repository/maven-public/"); maven("https://jitpack.io") } dependencies { compileOnly("io.papermc.paper:paper-api:1.21.4-R0.1-SNAPSHOT") @@ -8,6 +8,11 @@ dependencies { exclude(group = "org.bukkit", module = "bukkit") } implementation("org.postgresql:postgresql:42.7.4") + testImplementation("io.papermc.paper:paper-api:1.21.4-R0.1-SNAPSHOT") + testImplementation("org.junit.jupiter:junit-jupiter:5.11.4") + testImplementation("org.mockito:mockito-core:5.15.2") + testRuntimeOnly("com.github.MilkBowl:VaultAPI:1.7") { exclude(group = "org.bukkit", module = "bukkit") } + testRuntimeOnly("org.junit.platform:junit-platform-launcher") } tasks.jar { archiveBaseName.set("DuneCore") @@ -16,3 +21,4 @@ tasks.jar { } java { toolchain.languageVersion.set(JavaLanguageVersion.of(21)) } tasks.withType { options.encoding = "UTF-8" } +tasks.test { useJUnitPlatform() } diff --git a/DuneRealms-minecraft-only/src/main/java/com/example/dunerealms/ArrakisAnnouncements.java b/DuneRealms-minecraft-only/src/main/java/com/example/dunerealms/ArrakisAnnouncements.java new file mode 100644 index 00000000..7cd8f844 --- /dev/null +++ b/DuneRealms-minecraft-only/src/main/java/com/example/dunerealms/ArrakisAnnouncements.java @@ -0,0 +1,63 @@ +package com.example.dunerealms; + +import org.bukkit.*; +import org.bukkit.configuration.file.YamlConfiguration; +import org.bukkit.entity.Player; +import java.io.*; +import java.util.*; + +/** Durable fifteen-minute embargo; BungeeCord Message ALL reaches every backend. */ +final class ArrakisAnnouncements { + private final DuneCore plugin; + private final File file; + private final YamlConfiguration state; + private final Set pending = new HashSet<>(); + + ArrakisAnnouncements(DuneCore plugin) { + this.plugin = plugin; + file = new File(plugin.getDataFolder(), "arrakis-announcements.yml"); + state = YamlConfiguration.loadConfiguration(file); + for (String key : state.getKeys(false)) if (!state.getBoolean(key + ".sent")) pending.add(key); + plugin.getServer().getMessenger().registerOutgoingPluginChannel(plugin, "BungeeCord"); + Bukkit.getScheduler().runTaskTimer(plugin, this::deliver, 20L, 20L); + } + + void announce(String kind, Location location, String identity) { + if (location.getWorld() == null || !location.getWorld().getName().equalsIgnoreCase("arrakis")) return; + String key = UUID.nameUUIDFromBytes(identity.getBytes(java.nio.charset.StandardCharsets.UTF_8)).toString(); + if (state.contains(key)) return; + String coordinates = "Arrakis [X " + location.getBlockX() + ", Y " + location.getBlockY() + ", Z " + location.getBlockZ() + "]"; + String sighting = kind.equals("sandworm") ? "Shai-Hulud stirs beneath the sands at " : "The desert reveals a melange spice bloom at "; + String message = sighting + coordinates + "."; + state.set(key + ".message", ChatColor.GOLD + "[Spacing Guild] Our Navigators have detected: " + message + " The Guild now informs all worlds. The spice must flow!"); + state.set(key + ".due", System.currentTimeMillis() + 15L * 60L * 1000L); + pending.add(key); + save(); + Bukkit.broadcastMessage(ChatColor.GOLD + "[Arrakis] " + message + " You have 15 minutes before the Spacing Guild notices and informs all other servers."); + } + + private void deliver() { + for (String key : new ArrayList<>(pending)) { + if (state.getBoolean(key + ".sent") || state.getLong(key + ".due") > System.currentTimeMillis()) continue; + String message = state.getString(key + ".message", ""); + if (plugin.getConfig().getBoolean("network.enabled", true)) { + Player carrier = Bukkit.getOnlinePlayers().stream().findFirst().orElse(null); + if (carrier == null) continue; // Plugin messaging needs a player connection; keep pending. + try { + ByteArrayOutputStream bytes = new ByteArrayOutputStream(); + DataOutputStream out = new DataOutputStream(bytes); + out.writeUTF("Message"); out.writeUTF("ALL"); out.writeUTF(message); + carrier.sendPluginMessage(plugin, "BungeeCord", bytes.toByteArray()); + } catch (IOException ex) { plugin.getLogger().warning("Guild announcement failed: " + ex.getMessage()); continue; } + } else Bukkit.broadcastMessage(message); + state.set(key + ".sent", true); + pending.remove(key); + save(); + } + } + + private void save() { + try { state.save(file); } + catch (IOException ex) { plugin.getLogger().severe("Cannot save Guild announcements: " + ex.getMessage()); } + } +} diff --git a/DuneRealms-minecraft-only/src/main/java/com/example/dunerealms/DuneCore.java b/DuneRealms-minecraft-only/src/main/java/com/example/dunerealms/DuneCore.java index 3a4244c4..8c0d76d1 100644 --- a/DuneRealms-minecraft-only/src/main/java/com/example/dunerealms/DuneCore.java +++ b/DuneRealms-minecraft-only/src/main/java/com/example/dunerealms/DuneCore.java @@ -64,6 +64,11 @@ public final class DuneCore extends JavaPlugin implements Listener, CommandExecu public String factionOf(Player player){return selected.getOrDefault(player.getUniqueId(),"");} public void persistPlayers(){savePlayers();} private ArrakisWater arrakisWater; + private ArrakisAnnouncements announcements; + + public void announceArrakisEvent(String kind, Location location, String identity) { + if (announcements != null) announcements.announce(kind, location, identity); + } @Override public void onEnable() { migrateLegacyData(); @@ -99,6 +104,10 @@ public final class DuneCore extends JavaPlugin implements Listener, CommandExecu duneCommand.setExecutor(this); duneCommand.setTabCompleter(this); Bukkit.getPluginManager().registerEvents(this, this); + announcements = new ArrakisAnnouncements(this); + World loadedArrakis = Bukkit.getWorld("arrakis"); + if (loadedArrakis != null) for (Entity entity : loadedArrakis.getEntities()) + if (isWorm(entity)) announceArrakisEvent("sandworm", entity.getLocation(), "worm:" + entity.getUniqueId()); Bukkit.getScheduler().runTaskTimer(this, this::spawnSandworms, 200L, 200L); Bukkit.getScheduler().runTaskTimer(this, this::spawnSpiceRaiders, 200L, 200L); getLogger().info("DuneCore enabled. Gameplay, faction travel, Arrakis threats, and spice raiders ready."); @@ -434,6 +443,10 @@ public final class DuneCore extends JavaPlugin implements Listener, CommandExecu try{ess.getClass().getMethod("factionArrival",Player.class,String.class).invoke(ess,p,planet);}catch(ReflectiveOperationException ex){getLogger().warning("Faction arrival failed: "+ex.getMessage());} } @Override public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { + if (args.length > 0 && args[0].equalsIgnoreCase("summon")) { + summonSandworm(sender, args); + return true; + } if (args.length > 0 && args[0].equalsIgnoreCase("help")) { if (sender instanceof Player player) Bukkit.dispatchCommand(player, "duneess help"); else sendHelp(sender); return true; @@ -523,6 +536,7 @@ public final class DuneCore extends JavaPlugin implements Listener, CommandExecu helpLine(sender, "/dune guireload", "Reload the configurable Navigator menu."); helpLine(sender, "/dune guildnpc", "Spawn a Spacing Guild Navigator at your location."); helpLine(sender, "/dune givespice", "Give yourself one spice item."); + helpLine(sender, "/dune summon sandworm [x y z]", "Summon Shai-Hulud on Arrakis at your position or explicit coordinates."); helpLine(sender, "/duneess admin teleport arrakis [player]", "Teleport a player to the loaded Arrakis spawn."); helpLine(sender, "/duneess admin teleport sietch [player]", "Teleport a player to a generated Arrakis sietch."); helpLine(sender, "/duneess admin teleport spiceblow [player]", "Teleport a player to the nearest generated spice blow."); @@ -546,11 +560,12 @@ public final class DuneCore extends JavaPlugin implements Listener, CommandExecu if (args.length == 1) { List commands = new ArrayList<>(List.of("help", "choose", "elytra", "kit", "politics", "trust", "water", "menu", "gui", "menuitem", "exchange", "serverjobs", "job")); - if (sender.hasPermission("dune.admin")) commands.addAll(List.of("guireload", "guildnpc", "givespice")); + if (sender.hasPermission("dune.admin")) commands.addAll(List.of("guireload", "guildnpc", "givespice", "summon")); return matching(commands, args[0]); } if (root.equals("choose") && args.length == 2) return matching(Arrays.asList(factions), args[1]); + if (root.equals("summon") && args.length == 2 && sender.hasPermission("dune.admin")) return matching(List.of("sandworm"), args[1]); if ((root.equals("politics") || root.equals("trust")) && args.length == 2) return matching(List.of("status", "deposit", "vote", "emperorvote", "leader", "invasion", "defend", "steward", "houseofwater"), args[1]); if ((root.equals("politics") || root.equals("trust")) && args.length == 3) { @@ -763,6 +778,9 @@ public final class DuneCore extends JavaPlugin implements Listener, CommandExecu private boolean isWorm(Entity entity) { return entity.getPersistentDataContainer().has(wormKey, PersistentDataType.BYTE); } + @EventHandler public void onWormLoaded(com.destroystokyo.paper.event.entity.EntityAddToWorldEvent event) { + if (isWorm(event.getEntity())) announceArrakisEvent("sandworm", event.getEntity().getLocation(), "worm:" + event.getEntity().getUniqueId()); + } private boolean isSpiceRaider(Entity entity) { return entity.getPersistentDataContainer().has(raiderKey, PersistentDataType.BYTE); } @@ -852,6 +870,16 @@ public final class DuneCore extends JavaPlugin implements Listener, CommandExecu Material surface = world.getBlockAt(x, y, z).getType(); if (surface != Material.SAND && surface != Material.RED_SAND) continue; Location location = new Location(world, x + 0.5, y + 1, z + 0.5); + spawnSandworm(location, player); + long interval = Math.max(60L, getConfig().getLong("sandworms.spawn-interval-seconds", 3600L)); + getConfig().set("sandworms.next-spawn-at", now + interval * 1000L); + saveConfig(); + return; + } + } + + private Husk spawnSandworm(Location location, Player target) { + World world = Objects.requireNonNull(location.getWorld()); Husk worm = world.spawn(location, Husk.class, h -> { h.getPersistentDataContainer().set(wormKey, PersistentDataType.BYTE, (byte)1); h.setCustomName(ChatColor.GOLD + "Shai-Hulud | Sandworm"); h.setCustomNameVisible(true); h.setRemoveWhenFarAway(true); h.setAdult(); h.setCanPickupItems(false); @@ -859,15 +887,42 @@ public final class DuneCore extends JavaPlugin implements Listener, CommandExecu h.getAttribute(Attribute.ATTACK_DAMAGE).setBaseValue(getConfig().getDouble("sandworms.attack-damage", 8.0)); h.getAttribute(Attribute.MOVEMENT_SPEED).setBaseValue(getConfig().getDouble("sandworms.movement-speed", 0.33)); h.getAttribute(Attribute.SCALE).setBaseValue(getConfig().getDouble("sandworms.scale", 3.5)); - h.setTarget(player); + if (target != null) h.setTarget(target); }); world.spawnParticle(Particle.CLOUD, location, 45, 2, 1, 2, 0.1); world.playSound(location, Sound.ENTITY_WARDEN_ROAR, 2f, 0.6f); - long interval = Math.max(60L, getConfig().getLong("sandworms.spawn-interval-seconds", 3600L)); - getConfig().set("sandworms.next-spawn-at", now + interval * 1000L); - saveConfig(); - return; + announceArrakisEvent("sandworm", location, "worm:" + worm.getUniqueId()); + return worm; + } + + private void summonSandworm(CommandSender sender, String[] args) { + if (!sender.hasPermission("dune.admin")) { sender.sendMessage(ChatColor.RED + "You need dune.admin to summon Shai-Hulud."); return; } + if ((args.length != 2 && args.length != 5) || !args[1].equalsIgnoreCase("sandworm")) { + sender.sendMessage("Usage: /dune summon sandworm [x y z]"); return; } + World world = Bukkit.getWorld("arrakis"); + if (world == null) { sender.sendMessage(ChatColor.RED + "Arrakis is not loaded on this server."); return; } + Location location; + if (args.length == 2) { + if (!(sender instanceof Player player) || !player.getWorld().equals(world)) { + sender.sendMessage("On Arrakis, omit coordinates to summon at your position; otherwise supply x y z."); return; + } + location = player.getLocation().clone(); + } else { + try { location = new Location(world, Double.parseDouble(args[2]), Double.parseDouble(args[3]), Double.parseDouble(args[4])); } + catch (NumberFormatException ex) { sender.sendMessage(ChatColor.RED + "Coordinates must be numbers."); return; } + } + if (!Double.isFinite(location.getX()) || !Double.isFinite(location.getY()) || !Double.isFinite(location.getZ()) + || location.getY() < world.getMinHeight() || location.getY() + 2 >= world.getMaxHeight() + || Math.abs(location.getX()) > 29999984 || Math.abs(location.getZ()) > 29999984 + || !world.getWorldBorder().isInside(location)) { + sender.sendMessage(ChatColor.RED + "Coordinates must be inside Arrakis' world border and build height."); return; + } + if (!location.getBlock().isPassable() || !location.clone().add(0, 1, 0).getBlock().isPassable()) { + sender.sendMessage(ChatColor.RED + "Choose an open space for the sandworm."); return; + } + spawnSandworm(location, sender instanceof Player player && player.getWorld().equals(world) ? player : null); + sender.sendMessage(ChatColor.GREEN + "Shai-Hulud summoned at " + location.getBlockX() + ", " + location.getBlockY() + ", " + location.getBlockZ() + "."); } @EventHandler public void onRaiderCombust(EntityCombustEvent e) { if (isSpiceRaider(e.getEntity())) e.setCancelled(true); @@ -904,7 +959,8 @@ public final class DuneCore extends JavaPlugin implements Listener, CommandExecu } } w.strikeLightningEffect(center); - Bukkit.broadcastMessage(ChatColor.GOLD + "Shai-Hulud has fallen! A spice bloom has appeared on Arrakis (" + placed + " deposits, up to " + (placed * price) + " Solaris at base yield)."); + if (placed > 0) announceArrakisEvent("spicebloom", center, "worm-bloom:" + UUID.randomUUID()); + for (Player player : w.getPlayers()) player.sendMessage(ChatColor.GOLD + "Shai-Hulud has fallen at X " + center.getBlockX() + ", Y " + center.getBlockY() + ", Z " + center.getBlockZ() + "! " + placed + " spice deposits surfaced, worth up to " + (placed * price) + " Solaris at base yield."); } @EventHandler public void onCombat(EntityDamageByEntityEvent e) { if (e.getDamager() instanceof Player p && selected.getOrDefault(p.getUniqueId(), "").equals("Harkonnen")) e.setDamage(e.getDamage() * 1.15); diff --git a/DuneRealms-minecraft-only/src/main/resources/plugin.yml b/DuneRealms-minecraft-only/src/main/resources/plugin.yml index 9f8c35ce..d4944c90 100644 --- a/DuneRealms-minecraft-only/src/main/resources/plugin.yml +++ b/DuneRealms-minecraft-only/src/main/resources/plugin.yml @@ -1,5 +1,5 @@ name: DuneCore -version: 1.0.3 +version: 1.0.4 main: com.example.dunerealms.DuneCore api-version: '1.21' depend: [Vault, DuneEss] diff --git a/DuneRealms-minecraft-only/src/test/java/com/example/dunerealms/ArrakisAnnouncementsTest.java b/DuneRealms-minecraft-only/src/test/java/com/example/dunerealms/ArrakisAnnouncementsTest.java new file mode 100644 index 00000000..32e7fa33 --- /dev/null +++ b/DuneRealms-minecraft-only/src/test/java/com/example/dunerealms/ArrakisAnnouncementsTest.java @@ -0,0 +1,67 @@ +package com.example.dunerealms; + +import org.bukkit.*; +import org.bukkit.configuration.file.YamlConfiguration; +import org.bukkit.entity.Player; +import org.bukkit.plugin.messaging.Messenger; +import org.bukkit.scheduler.BukkitScheduler; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; +import org.mockito.MockedStatic; +import java.io.*; +import java.nio.file.Path; +import java.util.*; +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.ArgumentMatchers.*; +import static org.mockito.Mockito.*; + +class ArrakisAnnouncementsTest { + @TempDir Path directory; + + @Test void embargoSurvivesRestartAndRetriesWhenNoPlayerCanCarryMessage() throws Exception { + DuneCore plugin = mock(DuneCore.class); + Server server = mock(Server.class); + BukkitScheduler scheduler = mock(BukkitScheduler.class); + when(plugin.getDataFolder()).thenReturn(directory.toFile()); + when(plugin.getServer()).thenReturn(server); + when(server.getMessenger()).thenReturn(mock(Messenger.class)); + YamlConfiguration config = new YamlConfiguration(); config.set("network.enabled", true); + when(plugin.getConfig()).thenReturn(config); + World world = mock(World.class); when(world.getName()).thenReturn("arrakis"); + Player carrier = mock(Player.class); + try (MockedStatic bukkit = mockStatic(Bukkit.class)) { + bukkit.when(Bukkit::getScheduler).thenReturn(scheduler); + bukkit.when(Bukkit::getOnlinePlayers).thenReturn(List.of(carrier)); + ArrakisAnnouncements announcements = new ArrakisAnnouncements(plugin); + Location location = new Location(world, -123, 76, 456); + long before = System.currentTimeMillis(); + announcements.announce("spicebloom", location, "same-bloom"); + announcements.announce("spicebloom", location, "same-bloom"); + bukkit.verify(() -> Bukkit.broadcastMessage(contains("X -123, Y 76, Z 456")), times(1)); + File file = directory.resolve("arrakis-announcements.yml").toFile(); + YamlConfiguration state = YamlConfiguration.loadConfiguration(file); + assertEquals(1, state.getKeys(false).size()); + String key = state.getKeys(false).iterator().next(); + assertTrue(state.getLong(key + ".due") >= before + 900000L); + org.mockito.ArgumentCaptor callback = org.mockito.ArgumentCaptor.forClass(Runnable.class); + verify(scheduler).runTaskTimer(eq(plugin), callback.capture(), eq(20L), eq(20L)); + callback.getValue().run(); + verify(carrier, never()).sendPluginMessage(any(), anyString(), any()); + state.set(key + ".due", 0L); state.save(file); + new ArrakisAnnouncements(plugin).announce("spicebloom", location, "same-bloom"); + verify(scheduler, times(2)).runTaskTimer(eq(plugin), callback.capture(), eq(20L), eq(20L)); + Runnable restarted = callback.getValue(); + bukkit.when(Bukkit::getOnlinePlayers).thenReturn(List.of()); + restarted.run(); + assertFalse(YamlConfiguration.loadConfiguration(file).getBoolean(key + ".sent")); + bukkit.when(Bukkit::getOnlinePlayers).thenReturn(List.of(carrier)); + restarted.run(); restarted.run(); + org.mockito.ArgumentCaptor packet = org.mockito.ArgumentCaptor.forClass(byte[].class); + verify(carrier, times(1)).sendPluginMessage(eq(plugin), eq("BungeeCord"), packet.capture()); + DataInputStream input = new DataInputStream(new ByteArrayInputStream(packet.getValue())); + assertEquals("Message", input.readUTF()); assertEquals("ALL", input.readUTF()); + assertTrue(input.readUTF().contains("Spacing Guild")); + assertTrue(YamlConfiguration.loadConfiguration(file).getBoolean(key + ".sent")); + } + } +} diff --git a/DuneRealms-minecraft-only/src/test/java/com/example/dunerealms/SandwormCommandTest.java b/DuneRealms-minecraft-only/src/test/java/com/example/dunerealms/SandwormCommandTest.java new file mode 100644 index 00000000..c1517875 --- /dev/null +++ b/DuneRealms-minecraft-only/src/test/java/com/example/dunerealms/SandwormCommandTest.java @@ -0,0 +1,48 @@ +package com.example.dunerealms; + +import org.bukkit.*; +import org.bukkit.command.CommandSender; +import org.junit.jupiter.api.Test; +import org.mockito.MockedStatic; +import static org.mockito.ArgumentMatchers.*; +import static org.mockito.Mockito.*; + +class SandwormCommandTest { + @Test void permissionIsRequiredBeforeLookingUpArrakis() { + DuneCore plugin = mock(DuneCore.class); + CommandSender sender = mock(CommandSender.class); + when(plugin.onCommand(any(), any(), anyString(), any())).thenCallRealMethod(); + try (MockedStatic bukkit = mockStatic(Bukkit.class)) { + plugin.onCommand(sender, null, "dune", new String[]{"summon", "sandworm"}); + verify(sender).sendMessage(contains("dune.admin")); + bukkit.verifyNoInteractions(); + } + } + + @Test void invalidArgumentsAndNonFiniteCoordinatesNeverSpawnAnEntity() { + DuneCore plugin = mock(DuneCore.class); + CommandSender sender = mock(CommandSender.class); + when(sender.hasPermission("dune.admin")).thenReturn(true); + when(plugin.onCommand(any(), any(), anyString(), any())).thenCallRealMethod(); + World world = mock(World.class); + when(world.getMinHeight()).thenReturn(-64); + when(world.getMaxHeight()).thenReturn(320); + try (MockedStatic bukkit = mockStatic(Bukkit.class)) { + bukkit.when(() -> Bukkit.getWorld("arrakis")).thenReturn(world); + for (String[] args : new String[][]{ + {"summon"}, {"summon", "other"}, {"summon", "sandworm", "1"}, + {"summon", "sandworm", "NaN", "70", "0"}, + {"summon", "sandworm", "Infinity", "70", "0"}, + {"summon", "sandworm", "0", "320", "0"}, + {"summon", "sandworm", "0", "-65", "0"}, + {"summon", "sandworm", "not-a-number", "70", "0"}, + {"summon", "sandworm"} + }) plugin.onCommand(sender, null, "dune", args); + verify(sender, atLeastOnce()).sendMessage(contains("Usage:")); + verify(sender, times(4)).sendMessage(contains("world border and build height")); + verify(sender).sendMessage(contains("Coordinates must be numbers")); + verify(sender).sendMessage(contains("otherwise supply x y z")); + verify(world, never()).spawn(any(Location.class), any(Class.class), any(java.util.function.Consumer.class)); + } + } +} diff --git a/DuneTerrain/README.md b/DuneTerrain/README.md index a804c2f9..522ea05e 100644 --- a/DuneTerrain/README.md +++ b/DuneTerrain/README.md @@ -2,6 +2,8 @@ DuneTerrain is a standalone Paper plugin that generates one Dune planet world per server. It includes the five planet profiles, terrain and ore generation, Arrakis spice deposits and sietches, safe world spawn setup, and a protected Spacing Guild navigator. +New darkstone formations now have up to three flat plateaus with at most five blocks between levels. With DuneCore installed, loaded spice blooms announce coordinates on Arrakis and start a fifteen-minute countdown to a network-wide Spacing Guild announcement. See [Session 2](../SESSION-2.md). + ## Build and install Build the plugin from this directory with Java 21 and Gradle 8.14 or newer: @@ -10,7 +12,7 @@ Build the plugin from this directory with Java 21 and Gradle 8.14 or newer: gradle clean build ``` -Copy `build/libs/DuneTerrain-1.0.4.jar` into the Paper server's `plugins/` directory. Set `server.planet` in `plugins/DuneTerrain/config.yml` separately on each backend, then restart. +Copy `build/libs/DuneTerrain-1.0.5.jar` into the Paper server's `plugins/` directory. Set `server.planet` in `plugins/DuneTerrain/config.yml` separately on each backend, then restart. Valid values are `arrakis`, `giedi_prime`, `kaitain`, `caladan`, and `sigma_draconis_iv`. All five planet profiles are present in each server's config; change `server.planet` to select the world that backend creates. The generated world is named after the selected planet. Adjust its `planets.` settings for terrain, biome, surface, water, vegetation, ores, and spawn coordinates. diff --git a/DuneTerrain/build.gradle.kts b/DuneTerrain/build.gradle.kts index 4fb6b7e0..1b1c7e84 100644 --- a/DuneTerrain/build.gradle.kts +++ b/DuneTerrain/build.gradle.kts @@ -1,7 +1,7 @@ plugins { java } group = "com.example" -version = "1.0.4" +version = "1.0.5" repositories { mavenCentral() @@ -10,8 +10,11 @@ repositories { dependencies { compileOnly("io.papermc.paper:paper-api:1.21.4-R0.1-SNAPSHOT") + testImplementation("org.junit.jupiter:junit-jupiter:5.11.4") + testRuntimeOnly("org.junit.platform:junit-platform-launcher") } java { toolchain.languageVersion.set(JavaLanguageVersion.of(21)) } tasks.jar { archiveBaseName.set("DuneTerrain") } tasks.withType { options.encoding = "UTF-8" } +tasks.test { useJUnitPlatform() } diff --git a/DuneTerrain/src/main/java/com/example/duneterrain/DuneTerrain.java b/DuneTerrain/src/main/java/com/example/duneterrain/DuneTerrain.java index 7f74ee0f..f5dd1985 100644 --- a/DuneTerrain/src/main/java/com/example/duneterrain/DuneTerrain.java +++ b/DuneTerrain/src/main/java/com/example/duneterrain/DuneTerrain.java @@ -29,6 +29,7 @@ import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.server.ServerLoadEvent; +import org.bukkit.event.world.ChunkLoadEvent; import java.io.File; import java.util.*; @@ -39,6 +40,35 @@ public final class DuneTerrain extends JavaPlugin implements Listener { private final Map openSietchLoot = new HashMap<>(); private record PersonalLoot(Inventory inventory, String id) {} + public void announceSpiceBloom(Location location) { + org.bukkit.plugin.Plugin core = Bukkit.getPluginManager().getPlugin("DuneCore"); + if (core == null || !core.isEnabled()) return; + try { + String id = "bloom:" + location.getWorld().getUID() + ":" + location.getBlockX() + ":" + location.getBlockY() + ":" + location.getBlockZ(); + core.getClass().getMethod("announceArrakisEvent", String.class, Location.class, String.class) + .invoke(core, "spicebloom", location, id); + } catch (ReflectiveOperationException ex) { getLogger().warning("Spice bloom announcement failed: " + ex.getMessage()); } + } + + @EventHandler public void onBloomChunkLoad(ChunkLoadEvent event) { + if (!event.getWorld().getName().equalsIgnoreCase("arrakis")) return; + Chunk chunk = event.getChunk(); + Bukkit.getScheduler().runTask(this, () -> inspectBlooms(chunk)); + } + + private void inspectBlooms(Chunk chunk) { + World world = chunk.getWorld(); + if (!chunk.isLoaded()) return; + for (int x = 0; x < 16; x++) for (int z = 0; z < 16; z++) { + int wx = chunk.getX() * 16 + x, wz = chunk.getZ() * 16 + z; + int y = world.getHighestBlockYAt(wx, wz); + // The raised marker sits above a 3x3 magma patch; no neighbouring chunk access. + if (y > world.getMinHeight() && chunk.getBlock(x, y, z).getType() == Material.MAGMA_BLOCK + && chunk.getBlock(x, y - 1, z).getType() == Material.MAGMA_BLOCK) + announceSpiceBloom(new Location(world, wx, y, wz)); + } + } + @EventHandler public void onSpiceBlowProjectile(ProjectileHitEvent event) { if (!(event.getEntity() instanceof Arrow) && !(event.getEntity() instanceof Trident)) return; if (event.getHitBlock() != null) triggerSpiceBlowAt(event.getHitBlock().getLocation()); @@ -116,7 +146,8 @@ public final class DuneTerrain extends JavaPlugin implements Listener { block.setType(Material.SUSPICIOUS_SAND, false); placed++; } - world.getPlayers().forEach(player -> player.sendMessage(ChatColor.GOLD + "A spice blow erupted on Arrakis! A rich field has surfaced nearby.")); + announceSpiceBloom(center.getLocation()); + for (org.bukkit.entity.Player player : world.getPlayers()) player.sendMessage(ChatColor.GOLD + "A spice blow erupted at X " + x + ", Y " + center.getY() + ", Z " + z + " on Arrakis! " + placed + " deposits surfaced."); getLogger().info("Spice blow at " + x + ", " + z + " deployed " + placed + " spice deposits (target value " + targetValue + " Solaris)."); } @@ -254,6 +285,9 @@ public final class DuneTerrain extends JavaPlugin implements Listener { } @EventHandler public void onServerLoad(ServerLoadEvent event) { + World arrakis = Bukkit.getWorld("arrakis"); + if (arrakis != null) for (Chunk chunk : arrakis.getLoadedChunks()) + Bukkit.getScheduler().runTask(this, () -> inspectBlooms(chunk)); String planet = getConfig().getString("server.planet", "arrakis").toLowerCase(Locale.ROOT); World world = Bukkit.getWorld(planet); if (world == null) { @@ -422,7 +456,7 @@ public final class DuneTerrain extends JavaPlugin implements Listener { int spacing = Math.max(128, plugin.getConfig().getInt(path + "spacing", 750)); int minRadius = Math.max(6, plugin.getConfig().getInt(path + "min-radius", 10)); int maxRadius = Math.max(minRadius, plugin.getConfig().getInt(path + "max-radius", 18)); - int maxRise = Math.max(4, plugin.getConfig().getInt(path + "max-height", 14)); + int maxRise = Math.max(1, plugin.getConfig().getInt(path + "max-height", 14)); int baseHeight = plugin.getConfig().getInt("planets.arrakis.terrain.base-height", 70); double variation = plugin.getConfig().getDouble("planets.arrakis.terrain.height-variation", 11); double scale = Math.max(0.001, plugin.getConfig().getDouble("planets.arrakis.terrain.noise-scale", 0.02)); @@ -443,8 +477,9 @@ public final class DuneTerrain extends JavaPlugin implements Listener { + Math.sin(sampleX * scale * 2.7 + sampleZ * scale * 1.45) * 0.35; highestGround = Math.max(highestGround, baseHeight + (int)Math.round(noise * variation)); } - int plateauY = highestGround + maxRise; - double plateauRadius = radius * 0.58; + int plateauCount = RockPlateaus.count(seed, Math.min(maxRise, plugin.getConfig().getInt(path + "max-plateaus", 3))); + int interval = RockPlateaus.interval(plugin.getConfig().getInt(path + "plateau-interval", 5), maxRise, plateauCount); + int plateauY = highestGround + plateauCount * interval; for (int lx = 0; lx < 16; lx++) for (int lz = 0; lz < 16; lz++) { long gx = (long) worldMinX + lx, gz = (long) worldMinZ + lz; long dx = gx - centerX, dz = gz - centerZ; @@ -454,16 +489,18 @@ public final class DuneTerrain extends JavaPlugin implements Listener { if (distance > edge) continue; int baseY = heights[lx][lz]; if (plateauY + 2 >= maxY || baseY <= minY + 1) continue; - boolean plateau = distance <= plateauRadius; - double slope = Math.max(0.0, Math.min(1.0, (distance - plateauRadius) / Math.max(1.0, edge - plateauRadius))); - int sideTop = plateau ? plateauY : plateauY - (int)Math.floor(slope * maxRise); + int level = RockPlateaus.level(distance, radius, plateauCount); + boolean plateau = level > 0; + int terraceY = highestGround + level * interval; + double slope = Math.max(0.0, Math.min(1.0, (edge - distance) / Math.max(1.0, edge - radius * 0.9))); + int sideTop = highestGround + (int)Math.floor(slope * interval); Material[] darkRock = {Material.BLACKSTONE, Material.BASALT, Material.POLISHED_BLACKSTONE}; if (plateau) { - for (int y = baseY + 1; y < plateauY; y++) { + for (int y = baseY + 1; y < terraceY; y++) { int hashIndex = (int)Math.floorMod(mix64(rough + y * 0x9E3779B97F4A7C15L), darkRock.length); data.setBlock(lx, y, lz, darkRock[hashIndex]); } - data.setBlock(lx, plateauY, lz, Material.SAND); + data.setBlock(lx, terraceY, lz, Material.SAND); } else { int sideSurface = Math.max(baseY, sideTop); for (int y = baseY; y <= sideSurface; y++) { diff --git a/DuneTerrain/src/main/java/com/example/duneterrain/RockPlateaus.java b/DuneTerrain/src/main/java/com/example/duneterrain/RockPlateaus.java new file mode 100644 index 00000000..ca1ab0d8 --- /dev/null +++ b/DuneTerrain/src/main/java/com/example/duneterrain/RockPlateaus.java @@ -0,0 +1,18 @@ +package com.example.duneterrain; + +/** Deterministic nested terraces shared by every chunk intersecting a formation. */ +final class RockPlateaus { + static int count(long seed, int configuredMaximum) { + return 1 + (int)Math.floorMod(seed, Math.max(1, Math.min(3, configuredMaximum))); + } + + static int interval(int configuredInterval, int maximumHeight, int count) { + return Math.max(1, Math.min(5, Math.min(configuredInterval, Math.max(1, maximumHeight / count)))); + } + + static int level(double distance, double radius, int count) { + double fraction = distance / radius; + if (fraction > 0.9) return 0; + return Math.min(count, 1 + (int)Math.floor((0.9 - fraction) / (0.9 / count))); + } +} diff --git a/DuneTerrain/src/main/resources/config.yml b/DuneTerrain/src/main/resources/config.yml index 2e5afcb3..39d03a4f 100644 --- a/DuneTerrain/src/main/resources/config.yml +++ b/DuneTerrain/src/main/resources/config.yml @@ -39,7 +39,8 @@ planets: water: {level: 63, swamp-pools: false, coverage: 0.18} vegetation: {trees: false, tree-chance: 0.0, flowers-per-chunk: 0} oasis-trees: {enabled: true, spacing: 300, trunk-height: 7} - darkstone-islands: {enabled: true, spacing: 750, min-radius: 10, max-radius: 18, max-height: 14} + # Nested flat terraces, hard capped at 3 levels and 5 blocks between levels. + darkstone-islands: {enabled: true, spacing: 750, min-radius: 10, max-radius: 18, max-height: 14, max-plateaus: 3, plateau-interval: 5} ores: {min-y: -48, max-y: 48, vein-size: 5, COAL_ORE: 2, IRON_ORE: 2, COPPER_ORE: 1} giedi_prime: enabled: true diff --git a/DuneTerrain/src/main/resources/plugin.yml b/DuneTerrain/src/main/resources/plugin.yml index e6e3e5bb..354f0924 100644 --- a/DuneTerrain/src/main/resources/plugin.yml +++ b/DuneTerrain/src/main/resources/plugin.yml @@ -1,5 +1,5 @@ name: DuneTerrain -version: 1.0.4 +version: 1.0.5 main: com.example.duneterrain.DuneTerrain api-version: '1.21' load: STARTUP diff --git a/DuneTerrain/src/test/java/com/example/duneterrain/RockPlateausTest.java b/DuneTerrain/src/test/java/com/example/duneterrain/RockPlateausTest.java new file mode 100644 index 00000000..b76ba2db --- /dev/null +++ b/DuneTerrain/src/test/java/com/example/duneterrain/RockPlateausTest.java @@ -0,0 +1,36 @@ +package com.example.duneterrain; + +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.*; + +class RockPlateausTest { + @Test void capsHoldEvenWithInvalidConfigurationAndNegativeSeeds() { + for (int maximum : new int[]{-10, 0, 1, 2, 3, 100}) { + for (long seed = -100; seed <= 100; seed++) { + int count = RockPlateaus.count(seed, maximum); + assertTrue(count >= 1 && count <= 3); + for (int configured : new int[]{-5, 0, 1, 5, 100}) { + int interval = RockPlateaus.interval(configured, 14, count); + assertTrue(interval >= 1 && interval <= 5); + assertTrue(count * interval <= 14); + } + } + } + } + + @Test void terracesAreFlatAndStepDownTowardEdge() { + for (int count = 1; count <= 3; count++) { + assertEquals(count, RockPlateaus.level(0, 18, count)); + assertEquals(0, RockPlateaus.level(18, 18, count)); + int previous = count; + java.util.Set levels = new java.util.HashSet<>(); + for (int sample = 0; sample <= 1800; sample++) { + int level = RockPlateaus.level(sample / 100.0, 18, count); + assertTrue(level <= previous && previous - level <= 1); + levels.add(level); + previous = level; + } + assertEquals(count + 1, levels.size()); + } + } +} diff --git a/SESSION-2.md b/SESSION-2.md new file mode 100644 index 00000000..c6e2c7bc --- /dev/null +++ b/SESSION-2.md @@ -0,0 +1,23 @@ +# Project Dune — Session 2 + +The repository contains independent Gradle projects: `DuneTerrain` (world generation), `DuneRealms-minecraft-only` (DuneCore gameplay), and `DuneEss` (economy and travel). All three require Java 21 and target Paper 1.21.4. + +## Rock formations + +New Arrakis darkstone formations have one to three concentric, sand-topped flat plateaus. Heights between plateaus are at most five blocks. The count and shape are deterministic across chunk boundaries. Configure `planets.arrakis.darkstone-islands.max-plateaus` and `plateau-interval` in DuneTerrain; the hard caps still apply to larger values. The existing `max-height` also limits total rise above the surrounding high ground. Existing generated chunks retain their terrain. + +## Arrakis sightings + +Generated spice bloom markers announce when their chunk loads. Admin-placed markers, erupted blooms, sandworm spawns/loads, and worm-death spice fields use the same announcement service. Arrakis receives a lore message with X/Y/Z and a fifteen-minute warning. After fifteen real minutes, the Spacing Guild informs all online players across the proxy. A bloom already announced at those coordinates or a worm with the same UUID does not restart the countdown on chunk reload. + +Timers and sighting identities persist in `plugins/DuneCore/arrakis-announcements.yml`. Restarting the server preserves deadlines. If no player is connected to the Arrakis backend when a Guild message is due, delivery waits for a player connection. This is required by plugin messaging. Delivery uses the standard BungeeCord `Message` subchannel with recipient `ALL`; Velocity must have `bungee-plugin-message-channel = true`. With DuneCore `network.enabled: false`, the Guild message is delivered locally instead. Install DuneCore alongside DuneTerrain and DuneEss for coordinated announcements. No proxy-side custom plugin is required. + +## Admin summon + +`/dune summon sandworm` summons at your current position on Arrakis. `/dune summon sandworm ` accepts absolute numeric coordinates on the loaded Arrakis world, including from console. Both require `dune.admin` (OP by default). Invalid, non-finite, obstructed, out-of-height, and out-of-border locations are rejected. Summoned worms use the natural worm's tags, attributes, hostile AI, effects, and death spice field. An explicit admin summon bypasses the automatic population limit and does not change the automatic hourly cooldown. + +## Validation + +Run `gradle clean build` separately in each plugin directory. Terrain tests cover plateau count/spacing hard caps, flat levels, and monotonic terrace boundaries. Core tests cover the fifteen-minute deadline, coordinate messages, reload deduplication, restart persistence, offline delivery retry, and a single correctly encoded global Guild message. A live Paper/Velocity network is still required to verify gameplay appearance and actual proxy delivery. + +Protocol references: [BungeeCord plugin messaging](https://www.spigotmc.org/wiki/bukkit-bungee-plugin-messaging-channel/#message) and [Velocity channel compatibility](https://docs.papermc.io/velocity/dev/plugin-messaging/#bungeecord-channel-compatibility).