mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2025-01-23 16:51:28 +01:00
Add a bunch of examples, add loadworld to the plugin.yml
This commit is contained in:
parent
c7c73e7094
commit
3e10f18079
@ -23,6 +23,7 @@ public class ConfirmCommand extends MultiverseCommand {
|
||||
this.setArgRange(0, 0);
|
||||
this.addKey("mvconfirm");
|
||||
this.addKey("mv confirm");
|
||||
this.addCommandExample("/mv confirm");
|
||||
this.setPermission("multiverse.core.confirm", "If you have not been prompted to use this, it will not do anything.", PermissionDefault.OP);
|
||||
|
||||
}
|
||||
|
@ -32,6 +32,7 @@ public class CoordCommand extends MultiverseCommand {
|
||||
this.addKey("mv coord");
|
||||
this.addKey("mvcoord");
|
||||
this.addKey("mvco");
|
||||
this.addCommandExample("/mv coord");
|
||||
this.setPermission("multiverse.core.coord", "Returns detailed information on the Players where abouts.", PermissionDefault.OP);
|
||||
this.worldManager = this.plugin.getMVWorldManager();
|
||||
}
|
||||
|
@ -25,6 +25,7 @@ public class DebugCommand extends MultiverseCommand {
|
||||
this.addKey("mv debug");
|
||||
this.addKey("mv d");
|
||||
this.addKey("mvdebug");
|
||||
this.addCommandExample("/mv debug " + ChatColor.GOLD + "2");
|
||||
this.setPermission("multiverse.core.debug", "Spams the console a bunch.", PermissionDefault.OP);
|
||||
}
|
||||
|
||||
|
@ -24,6 +24,7 @@ public class DeleteCommand extends MultiverseCommand {
|
||||
this.setArgRange(1, 1);
|
||||
this.addKey("mvdelete");
|
||||
this.addKey("mv delete");
|
||||
this.addCommandExample("/mv create " + ChatColor.GOLD + "MyWorld");
|
||||
this.setPermission("multiverse.core.delete", "Deletes a world on your server. " + ChatColor.RED + "PERMANENTLY.", PermissionDefault.OP);
|
||||
}
|
||||
|
||||
|
@ -25,6 +25,7 @@ public class EnvironmentCommand extends MultiverseCommand {
|
||||
this.addKey("mv env");
|
||||
this.addKey("mv environment");
|
||||
this.addKey("mv environments");
|
||||
this.addCommandExample("/mv env");
|
||||
this.setPermission("multiverse.core.list.environments", "Lists valid known environments.", PermissionDefault.OP);
|
||||
}
|
||||
|
||||
|
@ -28,6 +28,7 @@ public class GeneratorCommand extends MultiverseCommand {
|
||||
this.addKey("mvgenerators");
|
||||
this.addKey("mv gens");
|
||||
this.addKey("mvgens");
|
||||
this.addCommandExample("/mv generators");
|
||||
this.setPermission("multiverse.core.generator", "Returns a list of Loaded Generator Plugins.", PermissionDefault.OP);
|
||||
}
|
||||
|
||||
|
@ -32,6 +32,7 @@ public class HelpCommand extends MultiverseCommand {
|
||||
this.addKey("mv help");
|
||||
this.addKey("mvsearch");
|
||||
this.addKey("mv search");
|
||||
this.addCommandExample("/mv help ?");
|
||||
this.setPermission("multiverse.help", "Displays a nice help menu.", PermissionDefault.TRUE);
|
||||
}
|
||||
|
||||
|
@ -28,6 +28,9 @@ public class ImportCommand extends MultiverseCommand {
|
||||
this.addKey("mvimport");
|
||||
this.addKey("mvim");
|
||||
this.addKey("mv import");
|
||||
this.addCommandExample("/mv import " + ChatColor.GOLD + "gargamel" + ChatColor.GREEN + " normal");
|
||||
this.addCommandExample("/mv import " + ChatColor.GOLD + "hell_world" + ChatColor.GREEN + " nether");
|
||||
this.addCommandExample("/mv import " + ChatColor.GOLD + "CleanRoom" + ChatColor.GREEN + " normal" + ChatColor.DARK_AQUA + " CleanRoomGenerator");
|
||||
this.setPermission("multiverse.core.import", "Imports a new world of the specified type.", PermissionDefault.OP);
|
||||
this.worldManager = this.plugin.getMVWorldManager();
|
||||
}
|
||||
|
@ -34,6 +34,8 @@ public class InfoCommand extends MultiverseCommand {
|
||||
this.addKey("mvinfo");
|
||||
this.addKey("mvi");
|
||||
this.addKey("mv info");
|
||||
this.addCommandExample("/mv info " + ChatColor.GOLD + "1");
|
||||
this.addCommandExample("/mv info " + ChatColor.GOLD + "3");
|
||||
this.setPermission("multiverse.core.info", "Returns detailed information on the world.", PermissionDefault.OP);
|
||||
this.worldManager = this.plugin.getMVWorldManager();
|
||||
}
|
||||
|
@ -40,9 +40,7 @@ public class ListCommand extends MultiverseCommand {
|
||||
String output = ChatColor.LIGHT_PURPLE + "Worlds which you can view:\n";
|
||||
for (MultiverseWorld world : this.plugin.getMVWorldManager().getMVWorlds()) {
|
||||
|
||||
if (world.isHidden()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (p != null && (!this.plugin.getMVPerms().canEnterWorld(p, world))) {
|
||||
continue;
|
||||
}
|
||||
@ -56,7 +54,16 @@ public class ListCommand extends MultiverseCommand {
|
||||
} else if (env == Environment.SKYLANDS) {
|
||||
color = ChatColor.AQUA;
|
||||
}
|
||||
output += world.getColoredWorldString() + ChatColor.WHITE + " - " + color + world.getEnvironment() + " \n";
|
||||
String outputCache = world.getColoredWorldString() + ChatColor.WHITE + " - " + color + world.getEnvironment() + " \n";
|
||||
if (world.isHidden()) {
|
||||
// TODO: Add an actual permission for this.
|
||||
if (p != null && !p.isOp()) {
|
||||
continue;
|
||||
}
|
||||
// Prefix hidden worlds with an "[H]"
|
||||
outputCache = ChatColor.GRAY + "[H]" + outputCache;
|
||||
}
|
||||
output += outputCache;
|
||||
|
||||
}
|
||||
String[] response = output.split("\n");
|
||||
|
@ -23,6 +23,7 @@ public class LoadCommand extends MultiverseCommand {
|
||||
this.setArgRange(1, 1);
|
||||
this.addKey("mvload");
|
||||
this.addKey("mv load");
|
||||
this.addCommandExample("/mv load " + ChatColor.GREEN + "MyUnloadedWorld");
|
||||
this.setPermission("multiverse.core.load", "Loads a world into Multiverse.", PermissionDefault.OP);
|
||||
}
|
||||
|
||||
|
@ -33,6 +33,9 @@ public class ModifyAddCommand extends MultiverseCommand {
|
||||
this.addKey("mvmadd");
|
||||
this.addKey("mv modify add");
|
||||
this.addKey("mvmodify add");
|
||||
this.addCommandExample("/mvm " + ChatColor.GOLD + "add " + ChatColor.GREEN + "sheep " + ChatColor.RED + "animals");
|
||||
this.addCommandExample("/mvm " + ChatColor.GOLD + "add " + ChatColor.GREEN + "creeper " + ChatColor.RED + "monsters");
|
||||
this.addCommandExample("/mvm " + ChatColor.GOLD + "add " + ChatColor.GREEN + "MyWorld " + ChatColor.RED + "worldblacklist");
|
||||
this.setPermission("multiverse.core.modify.add", "Modify various aspects of worlds. See the help wiki for how to use this command properly. If you do not include a world, the current world will be used.", PermissionDefault.OP);
|
||||
this.worldManager = this.plugin.getMVWorldManager();
|
||||
}
|
||||
|
@ -30,6 +30,9 @@ public class ModifyClearCommand extends MultiverseCommand {
|
||||
this.addKey("mvmclear");
|
||||
this.addKey("mv modify clear");
|
||||
this.addKey("mvmodify clear");
|
||||
this.addCommandExample("/mvm " + ChatColor.GOLD + "clear " + ChatColor.RED + "animals");
|
||||
this.addCommandExample("/mvm " + ChatColor.GOLD + "clear " + ChatColor.RED + "monsters");
|
||||
this.addCommandExample("/mvm " + ChatColor.GOLD + "clear " + ChatColor.RED + "worldblacklist");
|
||||
this.setPermission("multiverse.core.modify.clear", "Removes all values from a property. This will work on properties that contain lists.", PermissionDefault.OP);
|
||||
this.worldManager = this.plugin.getMVWorldManager();
|
||||
}
|
||||
|
@ -34,6 +34,9 @@ public class ModifyRemoveCommand extends MultiverseCommand {
|
||||
this.addKey("mvmdelete");
|
||||
this.addKey("mv modify delete");
|
||||
this.addKey("mvmodify delete");
|
||||
this.addCommandExample("/mvm " + ChatColor.GOLD + "remove " + ChatColor.GREEN + "sheep " + ChatColor.RED + "animals");
|
||||
this.addCommandExample("/mvm " + ChatColor.GOLD + "remove " + ChatColor.GREEN + "creeper " + ChatColor.RED + "monsters");
|
||||
this.addCommandExample("/mvm " + ChatColor.GOLD + "remove " + ChatColor.GREEN + "MyWorld " + ChatColor.RED + "worldblacklist");
|
||||
this.setPermission("multiverse.core.modify.remove", "Modify various aspects of worlds. See the help wiki for how to use this command properly. If you do not include a world, the current world will be used.", PermissionDefault.OP);
|
||||
this.worldManager = this.plugin.getMVWorldManager();
|
||||
}
|
||||
|
@ -25,17 +25,43 @@ public class ModifySetCommand extends MultiverseCommand {
|
||||
super(plugin);
|
||||
this.setName("Modify a World (Set a value)");
|
||||
this.setCommandUsage("/mv modify" + ChatColor.GREEN + " set {PROPERTY} {VALUE}" + ChatColor.GOLD + " [WORLD]");
|
||||
this.setArgRange(2, 3);
|
||||
this.setArgRange(1, 3);
|
||||
this.addKey("mvm set");
|
||||
this.addKey("mvmset");
|
||||
this.addKey("mv modify set");
|
||||
this.addKey("mvmodify set");
|
||||
this.addCommandExample("/mvm " + ChatColor.GOLD + "set " + ChatColor.GREEN + "mode " + ChatColor.RED + "creative");
|
||||
this.addCommandExample("/mvm " + ChatColor.GOLD + "set " + ChatColor.GREEN + "animals " + ChatColor.RED + "false");
|
||||
this.addCommandExample("/mvm " + ChatColor.GOLD + "set " + ChatColor.GREEN + "monsters " + ChatColor.RED + "false");
|
||||
this.addCommandExample("/mvm " + ChatColor.GOLD + "set " + ChatColor.GREEN + "alias " + ChatColor.RED + "MyWorld");
|
||||
this.addCommandExample("/mvm " + ChatColor.GOLD + "set " + ChatColor.GREEN + "color " + ChatColor.RED + "green");
|
||||
this.addCommandExample("/mvm " + ChatColor.GOLD + "set " + ChatColor.GREEN + "curr " + ChatColor.RED + "3");
|
||||
this.addCommandExample("/mvm " + ChatColor.GOLD + "set " + ChatColor.GREEN + "price " + ChatColor.RED + "5");
|
||||
this.addCommandExample("/mvm " + ChatColor.GOLD + "set " + ChatColor.GREEN + "scale " + ChatColor.RED + "1.2");
|
||||
this.addCommandExample("/mvm " + ChatColor.GOLD + "set " + ChatColor.GREEN + "memory " + ChatColor.RED + "true");
|
||||
this.addCommandExample("/mvm " + ChatColor.GOLD + "set " + ChatColor.GREEN + "diff " + ChatColor.RED + "hard");
|
||||
this.addCommandExample("/mvm " + ChatColor.GOLD + "set " + ChatColor.GREEN + "hunger " + ChatColor.RED + "false");
|
||||
this.addCommandExample("/mvm " + ChatColor.GOLD + "set " + ChatColor.GREEN + "hidden " + ChatColor.RED + "true");
|
||||
this.addCommandExample("/mvm " + ChatColor.GOLD + "set " + ChatColor.GREEN + "pvp " + ChatColor.RED + "false");
|
||||
this.addCommandExample("/mvm " + ChatColor.GOLD + "set " + ChatColor.GREEN + "spawn");
|
||||
this.setPermission("multiverse.core.modify.set", "Modify various aspects of worlds. See the help wiki for how to use this command properly. If you do not include a world, the current world will be used.", PermissionDefault.OP);
|
||||
this.worldManager = this.plugin.getMVWorldManager();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void runCommand(CommandSender sender, List<String> args) {
|
||||
// Special case for spawn:
|
||||
if (args.size() == 1) {
|
||||
if (args.get(0).equalsIgnoreCase("spawn")) {
|
||||
SetSpawnCommand c = new SetSpawnCommand(this.plugin);
|
||||
c.setWorldSpawn(sender);
|
||||
|
||||
} else {
|
||||
sender.sendMessage("Spawn is the only param with no" + ChatColor.GREEN + " VALUE");
|
||||
sender.sendMessage("Type " + ChatColor.GREEN + "/mv modify ?" + ChatColor.WHITE + " For help.");
|
||||
}
|
||||
return;
|
||||
}
|
||||
// We NEED a world from the command line
|
||||
Player p = null;
|
||||
if (sender instanceof Player) {
|
||||
|
@ -30,6 +30,12 @@ public class PurgeCommand extends MultiverseCommand {
|
||||
this.setArgRange(1, 2);
|
||||
this.addKey("mvpurge");
|
||||
this.addKey("mv purge");
|
||||
this.addCommandExample("/mv purge " + ChatColor.GREEN + "all");
|
||||
this.addCommandExample("/mv purge " + ChatColor.GOLD + "all " + ChatColor.GREEN + "all");
|
||||
this.addCommandExample("/mv purge " + ChatColor.GREEN + "monsters");
|
||||
this.addCommandExample("/mv purge " + ChatColor.GOLD + "all " + ChatColor.GREEN + "animals");
|
||||
this.addCommandExample("/mv purge " + ChatColor.GOLD + "MyWorld " + ChatColor.GREEN + "squid");
|
||||
this.addCommandExample("/mv purge " + ChatColor.GOLD + "MyWorld_nether " + ChatColor.GREEN + "ghast");
|
||||
this.setPermission("multiverse.core.purge", "Removed the specified type of mob from the specified world.", PermissionDefault.OP);
|
||||
this.worldManager = this.plugin.getMVWorldManager();
|
||||
}
|
||||
|
@ -25,6 +25,7 @@ public class ReloadCommand extends MultiverseCommand {
|
||||
this.setArgRange(0, 0);
|
||||
this.addKey("mvreload");
|
||||
this.addKey("mv reload");
|
||||
this.addCommandExample("/mv reload");
|
||||
this.setPermission("multiverse.core.reload", "Reloads worlds.yml and config.yml.", PermissionDefault.OP);
|
||||
}
|
||||
|
||||
@ -34,11 +35,12 @@ public class ReloadCommand extends MultiverseCommand {
|
||||
this.plugin.loadConfigs();
|
||||
this.plugin.getMVWorldManager().loadWorlds(true);
|
||||
|
||||
// Create the event
|
||||
List<String> configsLoaded = new ArrayList<String>();
|
||||
configsLoaded.add("Multiverse-Core - config.yml");
|
||||
configsLoaded.add("Multiverse-Core - worlds.yml");
|
||||
// Create the event
|
||||
MVConfigReloadEvent configReload = new MVConfigReloadEvent(configsLoaded);
|
||||
// Fire it off
|
||||
this.plugin.getServer().getPluginManager().callEvent(configReload);
|
||||
for (String s : configReload.getAllConfigsLoaded()) {
|
||||
sender.sendMessage(s);
|
||||
|
@ -23,7 +23,8 @@ public class RemoveCommand extends MultiverseCommand {
|
||||
this.setArgRange(1, 1);
|
||||
this.addKey("mvremove");
|
||||
this.addKey("mv remove");
|
||||
this.setPermission("multiverse.core.remove", "Unloads a world from Multiverse and removes it from worlds.yml, this does NOT remove the world folder.", PermissionDefault.OP);
|
||||
this.addCommandExample("/mv remove " + ChatColor.GREEN + "MyWorld");
|
||||
this.setPermission("multiverse.core.remove", "Unloads a world from Multiverse and removes it from worlds.yml, this does NOT DELETE the world folder.", PermissionDefault.OP);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -30,11 +30,16 @@ public class SetSpawnCommand extends MultiverseCommand {
|
||||
this.addKey("mv set spawn");
|
||||
this.addKey("mv setspawn");
|
||||
this.addKey("mvset spawn");
|
||||
this.addCommandExample("/mv set spawn");
|
||||
this.setPermission("multiverse.core.spawn.set", "Sets the spawn for the current world.", PermissionDefault.OP);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void runCommand(CommandSender sender, List<String> args) {
|
||||
setWorldSpawn(sender);
|
||||
}
|
||||
|
||||
protected void setWorldSpawn(CommandSender sender) {
|
||||
if (sender instanceof Player) {
|
||||
Player p = (Player) sender;
|
||||
Location l = p.getLocation();
|
||||
@ -45,7 +50,7 @@ public class SetSpawnCommand extends MultiverseCommand {
|
||||
sender.sendMessage("Spawn was set to: " + LocationManipulation.strCoords(p.getLocation()));
|
||||
} else {
|
||||
w.setSpawnLocation(l.getBlockX(), l.getBlockY(), l.getBlockZ());
|
||||
sender.sendMessage("Multiverse does not know about this world, only X,Y and Z set. Please import it to set the spawn fully.");
|
||||
sender.sendMessage("Multiverse does not know about this world, only X,Y and Z set. Please import it to set the spawn fully (Pitch/Yaws).");
|
||||
}
|
||||
|
||||
} else {
|
||||
|
@ -13,5 +13,5 @@ package com.onarandombox.MultiverseCore.enums;
|
||||
* @author fernferret
|
||||
*/
|
||||
public enum AddProperties {
|
||||
blockblacklist, playerwhitelist, playerblacklist, worldblacklist, animals, monsters
|
||||
worldblacklist, animals, monsters
|
||||
}
|
||||
|
@ -15,5 +15,5 @@ package com.onarandombox.MultiverseCore.enums;
|
||||
public enum SetProperties {
|
||||
alias, animals, monsters, pvp, scaling, aliascolor, color, respawn,
|
||||
currency, curr, price, scale, spawnmemory, memory, weather, storm,
|
||||
gamemode, mode, hunger, difficulty, diff, hidden
|
||||
gamemode, mode, hunger, difficulty, diff, hidden, spawn
|
||||
}
|
||||
|
@ -155,31 +155,31 @@ commands:
|
||||
usage: |
|
||||
/<command> [world]
|
||||
mvenv:
|
||||
description: Tells the user all possible world types.
|
||||
description: Tells the user all possible environment types.
|
||||
usage: |
|
||||
/<command>
|
||||
mvv:
|
||||
description: Prints out version invo.
|
||||
description: Prints out version info.
|
||||
usage: |
|
||||
/<command>
|
||||
mvversion:
|
||||
description: Prints out version invo.
|
||||
description: Prints out version info.
|
||||
usage: |
|
||||
/<command>
|
||||
mvco:
|
||||
description: Prints out version invo.
|
||||
description: Displays the player's coordinates.
|
||||
usage: |
|
||||
/<command>
|
||||
mvh:
|
||||
description: Prints out version invo.
|
||||
description: Displays the Multiverse Help.
|
||||
usage: |
|
||||
/<command>
|
||||
mvsearch:
|
||||
description: Prints out version invo.
|
||||
description: Displays the Multiverse Help.
|
||||
usage: |
|
||||
/<command>
|
||||
mvhelp:
|
||||
description: Prints out version invo.
|
||||
description: Displays the Multiverse Help.
|
||||
usage: |
|
||||
/<command>
|
||||
mvdebug:
|
||||
@ -187,10 +187,14 @@ commands:
|
||||
usage: |
|
||||
/<command>
|
||||
mvgenerators:
|
||||
description: Turns on debugging.
|
||||
description: Displays all found world generators.
|
||||
usage: |
|
||||
/<command>
|
||||
mvgens:
|
||||
description: Turns on debugging.
|
||||
description: Displays all found world generators.
|
||||
usage: |
|
||||
/<command>
|
||||
mvload:
|
||||
description: Loads a world into Multiverse.
|
||||
usage: |
|
||||
/<command>
|
Loading…
Reference in New Issue
Block a user