forked from unimatrix/web
Add admin Arrakis teleport command
This commit is contained in:
parent
bc6c32e599
commit
480c093699
2 changed files with 22 additions and 1 deletions
|
|
@ -10,6 +10,8 @@ Suspicious sand on Arrakis is harvestable spice. Use the tagged netherite spice
|
|||
|
||||
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.
|
||||
|
||||
Admins with `dune.admin` can force a local teleport to the loaded Arrakis world with `/dune admin arrakis [player]`. Omit the player name to teleport yourself. From console, specify an online player. This bypasses normal faction and proxy travel routing and requires Arrakis to be loaded on that backend.
|
||||
|
||||
## Sandworms (Shai-Hulud)
|
||||
|
||||
Hostile, oversized husks representing sandworms spawn on sandy surfaces near players **only on Arrakis**, roughly every 10 seconds with a configurable chance. They target players, have 500 health and 30 base melee attack damage (Warden-level values), and play a Warden roar when emerging. They cannot teleport to other worlds. Settings are under `sandworms` in `config.yml`. The worm is represented by a scaled vanilla husk; a true animated worm model would require a resource pack or model plugin.
|
||||
|
|
|
|||
|
|
@ -404,10 +404,29 @@ public final class DuneCore extends JavaPlugin implements Listener, CommandExecu
|
|||
p.openInventory(inv);
|
||||
}
|
||||
@Override public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
|
||||
if (args.length > 0 && args[0].equalsIgnoreCase("admin")) {
|
||||
if (!sender.hasPermission("dune.admin")) { sender.sendMessage(ChatColor.RED + "Admin only."); return true; }
|
||||
if (args.length < 2 || !args[1].equalsIgnoreCase("arrakis")) {
|
||||
sender.sendMessage(ChatColor.YELLOW + "Usage: /dune admin arrakis [player]"); return true;
|
||||
}
|
||||
Player target;
|
||||
if (args.length >= 3) {
|
||||
target = Bukkit.getPlayerExact(args[2]);
|
||||
if (target == null) { sender.sendMessage(ChatColor.RED + "That player is not online."); return true; }
|
||||
} else if (sender instanceof Player player) target = player;
|
||||
else { sender.sendMessage(ChatColor.YELLOW + "From console, specify an online player: /dune admin arrakis <player>"); return true; }
|
||||
World arrakis = Bukkit.getWorld("arrakis");
|
||||
if (arrakis == null) { sender.sendMessage(ChatColor.RED + "Arrakis is not loaded on this server. Set DuneTerrain's server.planet to arrakis and restart this backend."); return true; }
|
||||
if (target.teleport(arrakis.getSpawnLocation())) {
|
||||
target.sendMessage(ChatColor.AQUA + "An admin sent you to Arrakis.");
|
||||
sender.sendMessage(ChatColor.GREEN + "Teleported " + target.getName() + " to Arrakis.");
|
||||
} else sender.sendMessage(ChatColor.RED + "Teleport to Arrakis failed.");
|
||||
return true;
|
||||
}
|
||||
if (!(sender instanceof Player p)) { sender.sendMessage("Run this command in-game."); return true; }
|
||||
if (args.length == 0) { gui.open(p, "main"); return true; }
|
||||
if (args[0].equalsIgnoreCase("help")) {
|
||||
p.sendMessage(ChatColor.GOLD + "/dune choose <fremen|harkonnen|corrino|atreides>, kit, balance, sell, water, travel, politics, exchange, serverjobs, serverjobs accept <id>, job post <spice>, job accept <player>, job finish, guildnpc (admin)"); return true;
|
||||
p.sendMessage(ChatColor.GOLD + "/dune choose <fremen|harkonnen|corrino|atreides>, kit, balance, sell, water, travel, politics, exchange, serverjobs, serverjobs accept <id>, job post <spice>, job accept <player>, job finish, guildnpc (admin), admin arrakis [player]"); return true;
|
||||
}
|
||||
switch (args[0].toLowerCase(Locale.ROOT)) {
|
||||
case "choose" -> {
|
||||
|
|
|
|||
Loading…
Reference in a new issue

Staff