diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml
new file mode 100644
index 00000000..b4635048
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug-report.yml
@@ -0,0 +1,77 @@
+name: 🐛 Report a Bug
+description: Report a problem with Multiverse-Core.
+title: "[Bug]: "
+labels: ["Bug: Unconfirmed"]
+body:
+ - type: markdown
+ attributes:
+ value: |
+ Thanks for taking the time to fill out this bug report!
+
+ If you are having issues with other submodules of Multiverse, please go to their respective git repo:
+ Multiverse-Portals: https://github.com/Multiverse/Multiverse-Portals/issues/new/choose
+ Multiverse-NetherPortals: https://github.com/Multiverse/Multiverse-NetherPortals/issues/new/choose
+ Multiverse-Inventories: https://github.com/Multiverse/Multiverse-Inventories/issues/new/choose
+ Multiverse-SignPortals: https://github.com/Multiverse/Multiverse-SignPortals/issues/new/choose
+
+ Not sure if this is a bug with Multiverse-Core? Feel free to ask on our Discord server: https://discord.gg/NZtfKky
+
+ When completing the report, please ensure all fields are filled with the correct details requested. Failure to do so will result in your issue being closed.
+ - type: input
+ id: mutliverse-version-info
+ attributes:
+ label: '`/mv version -p` output'
+ description: Run `/mv version -p` in the console, then copy and paste the link from the output of the command into this box.
+ validations:
+ required: true
+ - type: input
+ id: server-logs
+ attributes:
+ label: Server logs
+ description: >
+ Include full startup log and console error (if any). upload all relevant logs to either https://paste.gg
+ or https://gist.github.com, save and the paste the link in this box.
+ validations:
+ required: true
+ - type: textarea
+ id: server-version
+ attributes:
+ label: Server Version
+ description: Output of `/version` command.
+ placeholder: server version info
+ render: shell
+ validations:
+ required: true
+ - type: textarea
+ id: bug-description
+ attributes:
+ label: Bug Description
+ description: Describe in detail what the bug is about. Include the expected behaviour and actual behaviour.
+ placeholder: "Example: When running `/mv` it cause the server to crash..."
+ validations:
+ required: true
+ - type: textarea
+ id: reproduce-steps
+ attributes:
+ label: Steps to reproduce
+ description: Provide detailed intructions to trigger the bug.
+ placeholder: |
+ Example:
+ 1. Start a server with only multiverse installed.
+ 2. Run `/mv` command.
+ 3. Players all get kicked with a "server closed" message.
+ ...
+ validations:
+ required: true
+ - type: checkboxes
+ id: agreements
+ attributes:
+ label: Agreements
+ description: Ensure you have done the following being submitting this issue.
+ options:
+ - label: I have searched for and ensured there isn't already an open or resolved issue(s) regarding this.
+ required: true
+ - label: >
+ I was able to reproduce my issue on a freshly setup and up-to-date server with the latest
+ version of Multiverse plugins with no other plugins and with no kinds of other server or client mods.
+ required: true
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
new file mode 100644
index 00000000..9ae1a0fc
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -0,0 +1,5 @@
+blank_issues_enabled: false
+contact_links:
+ - name: 💬 Multiverse Discord Server
+ url: https://discord.gg/NZtfKky
+ about: Need help with using Multiverse-Core or just want to chat with the devs? Join the Multiverse Discord Server for help!
diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml
new file mode 100644
index 00000000..d51ef22d
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature-request.yml
@@ -0,0 +1,41 @@
+name: 💡 Request a Feature
+description: Suggest a feature you want to see in Multiverse-Core!
+title: "[Idea]: "
+labels: ["Type: Idea"]
+body:
+ - type: markdown
+ attributes:
+ value: |
+ Thanks for taking the time to share your ideas!
+
+ If you are look for other submodules of Multiverse, go to their respective git repo:
+ Multiverse-Portals: https://github.com/Multiverse/Multiverse-Portals/issues/new/choose
+ Multiverse-NetherPortals: https://github.com/Multiverse/Multiverse-NetherPortals/issues/new/choose
+ Multiverse-Inventories: https://github.com/Multiverse/Multiverse-Inventories/issues/new/choose
+ Multiverse-SignPortals: https://github.com/Multiverse/Multiverse-SignPortals/issues/new/choose
+
+ Not sure if your feature fits in Multiverse-Core? Feel free to ask on our Discord server: https://discord.gg/NZtfKky
+ - type: textarea
+ id: feature-description
+ attributes:
+ label: Describe the feature
+ description: What feature are you suggesting?
+ placeholder: "Example: I hope multiverse can implement random teleport feature..."
+ validations:
+ required: true
+ - type: textarea
+ id: feature-reasoning
+ attributes:
+ label: How is the feature useful to all Multiverse users?
+ description: How is the feature useful to all players, server owners and/or developers?
+ placeholder: "Example: Random teleporting can be integrated into many multiverse modules such as mv-portals..."
+ validations:
+ required: true
+ - type: checkboxes
+ id: agreements
+ attributes:
+ label: Agreements
+ description: Ensure you have done the following being submitting this issue.
+ options:
+ - label: I have searched for and ensured there isn't already an open issue regarding this.
+ required: true
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644
index 00000000..983d12cc
--- /dev/null
+++ b/.github/workflows/build.yml
@@ -0,0 +1,22 @@
+name: Maven CI/CD
+
+on:
+ push:
+ branches: [ main ]
+ pull_request:
+ branches: [ main ]
+
+jobs:
+ build_and_test:
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v2
+ - name: Set up JDK 8
+ uses: actions/setup-java@v1
+ with:
+ java-version: 1.8
+
+ - name: Build with Maven
+ run: mvn -B package --file pom.xml
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 2e7dbb32..00000000
--- a/.travis.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-language: java
-jdk:
- - oraclejdk8
-notifications:
- email: false
-dist: trusty
diff --git a/LICENSE.md b/LICENSE.md
new file mode 100644
index 00000000..a5dc3a8b
--- /dev/null
+++ b/LICENSE.md
@@ -0,0 +1,6 @@
+Copyright (c) 2011, The Multiverse Team All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of the The Multiverse Team nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
diff --git a/README.md b/README.md
index 3d4af1fc..f163c5e6 100644
--- a/README.md
+++ b/README.md
@@ -1,16 +1,44 @@
+![Multiverse 2](config/multiverse2-long.png)
+
+[![Maven CI/CD](https://github.com/Multiverse/Multiverse-Core/actions/workflows/build.yml/badge.svg)](https://github.com/Multiverse/Multiverse-Core/actions/workflows/build.yml)
+[![Release](https://img.shields.io/nexus/r/com.onarandombox.multiversecore/Multiverse-Core?label=release&server=https%3A%2F%2Frepo.onarandombox.com%2F)](https://dev.bukkit.org/projects/multiverse-core)
+[![Dev builds](https://img.shields.io/nexus/s/com.onarandombox.multiversecore/Multiverse-Core?label=dev%20builds&server=http%3A%2F%2Frepo.onarandombox.com%2F)](https://ci.onarandombox.com/job/Multiverse-Core/)
+[![Discord](https://img.shields.io/discord/325459248047980545?label=discord&logo=discord)](https://discord.gg/NZtfKky)
+[![Support me on Patreon](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Fshieldsio-patreon.vercel.app%2Fapi%3Fusername%3Ddumptruckman%26type%3Dpatrons&style=flat)](https://patreon.com/dumptruckman)
+[![License](https://img.shields.io/github/license/Multiverse/Multiverse-Core)](LICENSE.md)
+
+About
+========
+[Multiverse](https://dev.bukkit.org/projects/multiverse-core) was created at the dawn of Bukkit multiworld support. It has since then grown into a **complete world management solution!** Multiverse provides the easiest to use world management solution for your Minecraft server, big or small, and with great addons like [Portals](https://dev.bukkit.org/projects/multiverse-portals) and [NetherPortals](https://dev.bukkit.org/projects/multiverse-netherportals/), what's not to love!
+
+Now it's time to create your very own Multiverse server, do check out our [Wiki](https://github.com/Multiverse/Multiverse-Core/wiki) and [Usage Guide](https://github.com/Multiverse/Multiverse-Core/wiki/Basics) to get started. Feel free to hop onto our [Discord](https://discord.gg/NZtfKky) if you have any question or just want to have a chat with us!
+
+### Amazing sub-modules available:
+* [Multiverse-NetherPortals](https://github.com/Multiverse/Multiverse-NetherPortals) -> Have separate nether and end worlds for each of your overworlds!
+* [Multiverse-Portals](https://github.com/Multiverse/Multiverse-Portals) -> Make custom portals to go to any destination!
+* [Multiverse-Inventories](https://github.com/Multiverse/Multiverse-Inventories) -> Have separated players stats and inventories per world or per group of worlds.
+* [Multiverse-SignPortals](https://github.com/Multiverse/Multiverse-SignPortals) -> Signs as teleprompters!
+
Building
========
Simply build the source with maven:
-
- $ mvn install
-
+```
+$ mvn install
+```
More details are available on the [build instructions wiki page](https://github.com/Multiverse/Multiverse-Core/wiki/Building).
+
+Contributing
+=======
+**Want to help improve Multiverse?** There are several ways you can support and contribute to the project.
+* Take a look at our "Bug: Unconfirmed" issues, where you can find issues that need extra testing and investigation.
+* Want others to love Multiverse too? You can join the [Multiverse Discord community](https://discord.gg/NZtfKky) and help others with issues and setup!
+* A Multiverse guru? You can update our [Wiki](https://github.com/Multiverse/Multiverse-Core/wiki) with your latest tip, tricks and guides! The wiki open for all to edit and improve.
+* Love coding? You could look at ["State: Open to PR"](https://github.com/Multiverse/Multiverse-Core/labels/State%3A%20Open%20to%20PR) and ["Resolution: Accepted"](https://github.com/Multiverse/Multiverse-Core/labels/Resolution%3A%20Accepted) issues. We're always happy to receive bug fixes and feature additions as [pull requests](https://www.freecodecamp.org/news/how-to-make-your-first-pull-request-on-github-3/).
+* If you'd like to make a financial contribution to the project, do consider joining our [patreon](https://www.patreon.com/dumptruckman) or make a one-time donation [here](https://paypal.me/dumptruckman)!
+
+Additionally, we would like to give a big thanks to everyone that has supported Multiverse over the years, as well as those in the years to come. Thank you!
+
License
=======
-Copyright (c) 2011, The Multiverse Team All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-
-Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of the The Multiverse Team nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
+Multiverse-Core is licensed under BSD-3-Clause License. Please see [LICENSE.md](LICENSE.md) for more info.
diff --git a/config/mv_checks.xml b/config/mv_checks.xml
index 0c660d8d..2048eff5 100644
--- a/config/mv_checks.xml
+++ b/config/mv_checks.xml
@@ -69,7 +69,7 @@
-
+
diff --git a/pom.xml b/pom.xml
index 0949061f..2628624a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,12 +3,13 @@
4.0.0com.onarandombox.multiversecoreMultiverse-Core
- 4.1.1-SNAPSHOT
+ 5.0.0-SNAPSHOTMultiverse-CoreWorld Management PluginUTF-8UNKNOWN
+ bitly-access-token
@@ -19,23 +20,23 @@
onarandombox
- http://repo.onarandombox.com/content/groups/public
+ https://repo.onarandombox.com/content/groups/publicspigothttps://hub.spigotmc.org/nexus/content/groups/public/
- vault-repo
- http://nexus.hc.to/content/repositories/pub_releases
+ jitpack.io
+ https://jitpack.iominebench-repohttps://repo.minebench.de/
- CodeMC
- https://repo.codemc.org/repository/maven-public
+ aikar
+ https://repo.aikar.co/content/groups/aikar/
@@ -43,7 +44,7 @@
doodleproject-repoDoodleProject Maven 2 Repository
- http://doodleproject.sourceforge.net/maven2/release
+ https://doodleproject.sourceforge.net/maven2/releasetrue
@@ -52,7 +53,7 @@
jenkins
- http://ci.onarandombox.com
+ https://ci.onarandombox.com
@@ -123,8 +158,7 @@
maven-surefire-plugin3.0.0-M3
- methods
- 10
+ true**/TestCommandSender.java**/TestInstanceCreator.java
@@ -180,7 +214,7 @@
org.apache.maven.pluginsmaven-shade-plugin
- 3.1.1
+ 3.2.4package
@@ -188,6 +222,7 @@
shade
+ trueme.main__.util
@@ -221,6 +256,14 @@
de.themoep.idconvertercom.onarandombox.idconverter
+
+ co.aikar.commands
+ com.onarandombox.acf
+
+
+ co.aikar.locales
+ com.onarandombox.locales
+
@@ -229,13 +272,19 @@
se.erisnotnull-instrumenter-maven-plugin
- 0.6.8
+ 1.1.1instrumenttests-instrument
+
+
+ org.jetbrains.annotations.NotNull
+ javax.validation.constraints.NotNull
+
+
@@ -244,10 +293,10 @@
- org.bukkit
- bukkit
- 1.13.2-R0.1-SNAPSHOT
- provided
+ org.spigotmc
+ spigot-api
+ 1.16.5-R0.1-SNAPSHOT
+ provided
@@ -264,18 +313,29 @@
- net.milkbowl.vault
+ com.github.MilkBowlVaultAPI1.7provided
+
+ co.aikar
+ acf-paper
+ 0.5.1-SNAPSHOT
+ com.pneumaticraft.commandhandlerCommandHandler11
+
+
+ net.minidev
+ json-smart
+ 2.4.1
+ com.dumptruckman.minecraftbuscript
@@ -284,13 +344,7 @@
org.bstatsbstats-bukkit
- 1.7
-
-
- org.bukkit
- bukkit
-
-
+ 2.2.1com.dumptruckman.minecraft
@@ -316,30 +370,9 @@
test
- org.powermock
- powermock-module-junit4
- 2.0.0
- jar
- test
-
-
- org.powermock
- powermock-api-easymock
- 2.0.0
- jar
- test
-
-
- org.powermock
- powermock-api-mockito2
- 2.0.0
- jar
- test
-
-
- org.easymock
- easymock
- 4.0.2
+ org.mockito
+ mockito-core
+ 3.11.2test
@@ -352,11 +385,11 @@
OnARandomBox
- http://repo.onarandombox.com/content/repositories/multiverse
+ https://repo.onarandombox.com/content/repositories/multiverseOnARandomBox
- http://repo.onarandombox.com/content/repositories/multiverse-snapshots/
+ https://repo.onarandombox.com/content/repositories/multiverse-snapshots/
diff --git a/src/main/java/com/onarandombox/MultiverseCore/MVWorld.java b/src/main/java/com/onarandombox/MultiverseCore/MVWorld.java
index 485a75ae..50a3f415 100644
--- a/src/main/java/com/onarandombox/MultiverseCore/MVWorld.java
+++ b/src/main/java/com/onarandombox/MultiverseCore/MVWorld.java
@@ -213,7 +213,7 @@ public class MVWorld implements MultiverseWorld {
public Double validateChange(String property, Double newValue, Double oldValue,
MVWorld object) throws ChangeDeniedException {
if (newValue <= 0) {
- plugin.log(Level.FINE, "Someone tried to set a scale <= 0, aborting!");
+ Logging.fine("Someone tried to set a scale <= 0, aborting!");
throw new ChangeDeniedException();
}
return super.validateChange(property, newValue, oldValue, object);
@@ -296,7 +296,7 @@ public class MVWorld implements MultiverseWorld {
public GameMode validateChange(String property, GameMode newValue, GameMode oldValue,
MVWorld object) throws ChangeDeniedException {
for (Player p : plugin.getServer().getWorld(getName()).getPlayers()) {
- plugin.log(Level.FINER, String.format("Setting %s's GameMode to %s",
+ Logging.finer(String.format("Setting %s's GameMode to %s",
p.getName(), newValue.toString()));
plugin.getPlayerListener().handleGameModeAndFlight(p, MVWorld.this);
}
@@ -318,16 +318,16 @@ public class MVWorld implements MultiverseWorld {
// verify that the location is safe
if (!bs.playerCanSpawnHereSafely(newValue)) {
// it's not ==> find a better one!
- plugin.log(Level.WARNING, String.format("Somebody tried to set the spawn location for '%s' to an unsafe value! Adjusting...", getAlias()));
- plugin.log(Level.WARNING, "Old Location: " + plugin.getLocationManipulation().strCoordsRaw(oldValue));
- plugin.log(Level.WARNING, "New (unsafe) Location: " + plugin.getLocationManipulation().strCoordsRaw(newValue));
+ Logging.warning(String.format("Somebody tried to set the spawn location for '%s' to an unsafe value! Adjusting...", getAlias()));
+ Logging.warning("Old Location: " + plugin.getLocationManipulation().strCoordsRaw(oldValue));
+ Logging.warning("New (unsafe) Location: " + plugin.getLocationManipulation().strCoordsRaw(newValue));
SafeTTeleporter teleporter = plugin.getSafeTTeleporter();
newValue = teleporter.getSafeLocation(newValue, SPAWN_LOCATION_SEARCH_TOLERANCE, SPAWN_LOCATION_SEARCH_RADIUS);
if (newValue == null) {
- plugin.log(Level.WARNING, "Couldn't fix the location. I have to abort the spawn location-change :/");
+ Logging.warning("Couldn't fix the location. I have to abort the spawn location-change :/");
throw new ChangeDeniedException();
}
- plugin.log(Level.WARNING, "New (safe) Location: " + plugin.getLocationManipulation().strCoordsRaw(newValue));
+ Logging.warning("New (safe) Location: " + plugin.getLocationManipulation().strCoordsRaw(newValue));
}
}
return super.validateChange(property, newValue, oldValue, object);
@@ -355,7 +355,7 @@ public class MVWorld implements MultiverseWorld {
@Override
public Map serialize() {
- return Collections.EMPTY_MAP;
+ return Collections.emptyMap();
}
/**
@@ -410,7 +410,7 @@ public class MVWorld implements MultiverseWorld {
// Add limit bypass to it's parent
this.limitbypassperm.addParent("mv.bypass.playerlimit.*", true);
} catch (IllegalArgumentException e) {
- this.plugin.log(Level.FINER, "Permissions nodes were already added for " + this.name);
+ Logging.finer("Permissions nodes were already added for " + this.name);
}
}
@@ -421,16 +421,16 @@ public class MVWorld implements MultiverseWorld {
// Verify that location was safe
if (!bs.playerCanSpawnHereSafely(location)) {
if (!this.getAdjustSpawn()) {
- this.plugin.log(Level.FINE, "Spawn location from world.dat file was unsafe!!");
- this.plugin.log(Level.FINE, "NOT adjusting spawn for '" + this.getAlias() + "' because you told me not to.");
- this.plugin.log(Level.FINE, "To turn on spawn adjustment for this world simply type:");
- this.plugin.log(Level.FINE, "/mvm set adjustspawn true " + this.getAlias());
+ Logging.fine("Spawn location from world.dat file was unsafe!!");
+ Logging.fine("NOT adjusting spawn for '" + this.getAlias() + "' because you told me not to.");
+ Logging.fine("To turn on spawn adjustment for this world simply type:");
+ Logging.fine("/mvm set adjustspawn true " + this.getAlias());
return location;
}
// If it's not, find a better one.
SafeTTeleporter teleporter = this.plugin.getSafeTTeleporter();
- this.plugin.log(Level.WARNING, "Spawn location from world.dat file was unsafe. Adjusting...");
- this.plugin.log(Level.WARNING, "Original Location: " + plugin.getLocationManipulation().strCoordsRaw(location));
+ Logging.warning("Spawn location from world.dat file was unsafe. Adjusting...");
+ Logging.warning("Original Location: " + plugin.getLocationManipulation().strCoordsRaw(location));
Location newSpawn = teleporter.getSafeLocation(location,
SPAWN_LOCATION_SEARCH_TOLERANCE, SPAWN_LOCATION_SEARCH_RADIUS);
// I think we could also do this, as I think this is what Notch does.
@@ -449,7 +449,7 @@ public class MVWorld implements MultiverseWorld {
this.getName(), plugin.getLocationManipulation().locationToString(newerSpawn));
return newerSpawn;
} else {
- this.plugin.log(Level.SEVERE, "Safe spawn NOT found!!!");
+ Logging.severe("Safe spawn NOT found!!!");
}
}
}
diff --git a/src/main/java/com/onarandombox/MultiverseCore/MultiverseCore.java b/src/main/java/com/onarandombox/MultiverseCore/MultiverseCore.java
index 43820a5a..a4e44b6a 100644
--- a/src/main/java/com/onarandombox/MultiverseCore/MultiverseCore.java
+++ b/src/main/java/com/onarandombox/MultiverseCore/MultiverseCore.java
@@ -7,21 +7,6 @@
package com.onarandombox.MultiverseCore;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.UnsupportedEncodingException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.logging.Level;
-
import buscript.Buscript;
import com.dumptruckman.minecraft.util.Logging;
import com.onarandombox.MultiverseCore.MVWorld.NullLocation;
@@ -33,41 +18,43 @@ import com.onarandombox.MultiverseCore.api.MVWorldManager;
import com.onarandombox.MultiverseCore.api.MultiverseCoreConfig;
import com.onarandombox.MultiverseCore.api.MultiverseMessaging;
import com.onarandombox.MultiverseCore.api.SafeTTeleporter;
-import com.onarandombox.MultiverseCore.commands.AnchorCommand;
-import com.onarandombox.MultiverseCore.commands.CheckCommand;
-import com.onarandombox.MultiverseCore.commands.CloneCommand;
-import com.onarandombox.MultiverseCore.commands.ConfigCommand;
-import com.onarandombox.MultiverseCore.commands.ConfirmCommand;
-import com.onarandombox.MultiverseCore.commands.CoordCommand;
-import com.onarandombox.MultiverseCore.commands.CreateCommand;
import com.onarandombox.MultiverseCore.commands.DebugCommand;
-import com.onarandombox.MultiverseCore.commands.DeleteCommand;
-import com.onarandombox.MultiverseCore.commands.EnvironmentCommand;
-import com.onarandombox.MultiverseCore.commands.GameruleCommand;
-import com.onarandombox.MultiverseCore.commands.GamerulesCommand;
-import com.onarandombox.MultiverseCore.commands.GeneratorCommand;
-import com.onarandombox.MultiverseCore.commands.HelpCommand;
-import com.onarandombox.MultiverseCore.commands.ImportCommand;
-import com.onarandombox.MultiverseCore.commands.InfoCommand;
-import com.onarandombox.MultiverseCore.commands.ListCommand;
-import com.onarandombox.MultiverseCore.commands.LoadCommand;
-import com.onarandombox.MultiverseCore.commands.ModifyAddCommand;
-import com.onarandombox.MultiverseCore.commands.ModifyClearCommand;
-import com.onarandombox.MultiverseCore.commands.ModifyCommand;
-import com.onarandombox.MultiverseCore.commands.ModifyRemoveCommand;
-import com.onarandombox.MultiverseCore.commands.ModifySetCommand;
-import com.onarandombox.MultiverseCore.commands.PurgeCommand;
-import com.onarandombox.MultiverseCore.commands.RegenCommand;
-import com.onarandombox.MultiverseCore.commands.ReloadCommand;
-import com.onarandombox.MultiverseCore.commands.RemoveCommand;
-import com.onarandombox.MultiverseCore.commands.ScriptCommand;
-import com.onarandombox.MultiverseCore.commands.SetSpawnCommand;
-import com.onarandombox.MultiverseCore.commands.SilentCommand;
-import com.onarandombox.MultiverseCore.commands.SpawnCommand;
-import com.onarandombox.MultiverseCore.commands.TeleportCommand;
-import com.onarandombox.MultiverseCore.commands.UnloadCommand;
-import com.onarandombox.MultiverseCore.commands.VersionCommand;
-import com.onarandombox.MultiverseCore.commands.WhoCommand;
+import com.onarandombox.MultiverseCore.commandsold.AnchorCommand;
+import com.onarandombox.MultiverseCore.commandsold.CheckCommand;
+import com.onarandombox.MultiverseCore.commandsold.CloneCommand;
+import com.onarandombox.MultiverseCore.commandsold.ConfigCommand;
+import com.onarandombox.MultiverseCore.commandsold.ConfirmCommand;
+import com.onarandombox.MultiverseCore.commandsold.CoordCommand;
+import com.onarandombox.MultiverseCore.commandsold.CreateCommand;
+import com.onarandombox.MultiverseCore.commandsold.DeleteCommand;
+import com.onarandombox.MultiverseCore.commandsold.EnvironmentCommand;
+import com.onarandombox.MultiverseCore.commandsold.GameruleCommand;
+import com.onarandombox.MultiverseCore.commandsold.GamerulesCommand;
+import com.onarandombox.MultiverseCore.commandsold.GeneratorCommand;
+import com.onarandombox.MultiverseCore.commandsold.HelpCommand;
+import com.onarandombox.MultiverseCore.commandsold.ImportCommand;
+import com.onarandombox.MultiverseCore.commandsold.InfoCommand;
+import com.onarandombox.MultiverseCore.commandsold.ListCommand;
+import com.onarandombox.MultiverseCore.commandsold.LoadCommand;
+import com.onarandombox.MultiverseCore.commandsold.ModifyAddCommand;
+import com.onarandombox.MultiverseCore.commandsold.ModifyClearCommand;
+import com.onarandombox.MultiverseCore.commandsold.ModifyCommand;
+import com.onarandombox.MultiverseCore.commandsold.ModifyRemoveCommand;
+import com.onarandombox.MultiverseCore.commandsold.ModifySetCommand;
+import com.onarandombox.MultiverseCore.commandsold.PurgeCommand;
+import com.onarandombox.MultiverseCore.commandsold.RegenCommand;
+import com.onarandombox.MultiverseCore.commandsold.ReloadCommand;
+import com.onarandombox.MultiverseCore.commandsold.RemoveCommand;
+import com.onarandombox.MultiverseCore.commandsold.ScriptCommand;
+import com.onarandombox.MultiverseCore.commandsold.SetSpawnCommand;
+import com.onarandombox.MultiverseCore.commandsold.SilentCommand;
+import com.onarandombox.MultiverseCore.commandsold.SpawnCommand;
+import com.onarandombox.MultiverseCore.commandsold.TeleportCommand;
+import com.onarandombox.MultiverseCore.commandsold.UnloadCommand;
+import com.onarandombox.MultiverseCore.commandsold.VersionCommand;
+import com.onarandombox.MultiverseCore.commandsold.WhoCommand;
+import com.onarandombox.MultiverseCore.commandtools.MVCommandManager;
+import com.onarandombox.MultiverseCore.commandtools.queue.CommandQueueManager;
import com.onarandombox.MultiverseCore.destination.AnchorDestination;
import com.onarandombox.MultiverseCore.destination.BedDestination;
import com.onarandombox.MultiverseCore.destination.CannonDestination;
@@ -77,11 +64,8 @@ import com.onarandombox.MultiverseCore.destination.PlayerDestination;
import com.onarandombox.MultiverseCore.destination.WorldDestination;
import com.onarandombox.MultiverseCore.event.MVDebugModeEvent;
import com.onarandombox.MultiverseCore.event.MVVersionEvent;
-import com.onarandombox.MultiverseCore.listeners.MVAsyncPlayerChatListener;
import com.onarandombox.MultiverseCore.listeners.MVChatListener;
import com.onarandombox.MultiverseCore.listeners.MVEntityListener;
-import com.onarandombox.MultiverseCore.listeners.MVMapListener;
-import com.onarandombox.MultiverseCore.listeners.MVPlayerChatListener;
import com.onarandombox.MultiverseCore.listeners.MVPlayerListener;
import com.onarandombox.MultiverseCore.listeners.MVPortalListener;
import com.onarandombox.MultiverseCore.listeners.MVWeatherListener;
@@ -93,13 +77,14 @@ import com.onarandombox.MultiverseCore.utils.MVMessaging;
import com.onarandombox.MultiverseCore.utils.MVPermissions;
import com.onarandombox.MultiverseCore.utils.MVPlayerSession;
import com.onarandombox.MultiverseCore.utils.MaterialConverter;
-import com.onarandombox.MultiverseCore.utils.metrics.MetricsConfigurator;
import com.onarandombox.MultiverseCore.utils.SimpleBlockSafety;
import com.onarandombox.MultiverseCore.utils.SimpleLocationManipulation;
import com.onarandombox.MultiverseCore.utils.SimpleSafeTTeleporter;
+import com.onarandombox.MultiverseCore.utils.TestingMode;
import com.onarandombox.MultiverseCore.utils.UnsafeCallWrapper;
import com.onarandombox.MultiverseCore.utils.VaultHandler;
import com.onarandombox.MultiverseCore.utils.WorldManager;
+import com.onarandombox.MultiverseCore.utils.metrics.MetricsConfigurator;
import com.pneumaticraft.commandhandler.CommandHandler;
import me.main__.util.SerializationConfig.NoSuchPropertyException;
import me.main__.util.SerializationConfig.SerializationConfig;
@@ -120,6 +105,20 @@ import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.plugin.java.JavaPluginLoader;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.UnsupportedEncodingException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
/**
* The implementation of the Multiverse-{@link Core}.
*/
@@ -202,6 +201,8 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
// Setup our Map for our Commands using the CommandHandler.
private CommandHandler commandHandler;
+ private MVCommandManager commandManager;
+ private CommandQueueManager commandQueueManager;
private static final String LOG_TAG = "[Multiverse-Core]";
@@ -284,6 +285,8 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
// Setup the command manager
this.commandHandler = new CommandHandler(this, this.ph);
+ this.commandManager = new MVCommandManager(this);
+ this.commandQueueManager = new CommandQueueManager(this);
// Call the Function to assign all the Commands to their Class.
this.registerCommands();
@@ -305,7 +308,7 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
this.worldManager.loadDefaultWorlds();
this.worldManager.loadWorlds(true);
} else {
- this.log(Level.SEVERE, "Your configs were not loaded. Very little will function in Multiverse.");
+ Logging.severe("Your configs were not loaded. Very little will function in Multiverse.");
}
this.anchorManager.loadAnchors();
@@ -317,17 +320,8 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
// A test that had no worlds loaded was being run. This should never happen in production
}
this.saveMVConfig();
- // Register async or sync player chat according to config
- try {
- Class.forName("org.bukkit.event.player.AsyncPlayerChatEvent");
- } catch (ClassNotFoundException e) {
- getMVConfig().setUseAsyncChat(false);
- }
- if (getMVConfig().getUseAsyncChat()) {
- this.chatListener = new MVAsyncPlayerChatListener(this, this.playerListener);
- } else {
- this.chatListener = new MVPlayerChatListener(this, this.playerListener);
- }
+
+ this.chatListener = new MVChatListener(this, this.playerListener);
getServer().getPluginManager().registerEvents(this.chatListener, this);
this.initializeBuscript();
@@ -343,16 +337,28 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
}
private void setupMetrics() {
- MetricsConfigurator.configureMetrics(this);
+ if (TestingMode.isDisabled()) {
+ MetricsConfigurator.configureMetrics(this);
+ }
}
/**
* Initializes the buscript javascript library.
*/
private void initializeBuscript() {
- buscript = new Buscript(this);
- // Add global variable "multiverse" to javascript environment
- buscript.setScriptVariable("multiverse", this);
+ buscript = null;
+
+ if (this.getMVConfig().getEnableBuscript()) {
+ try {
+ buscript = new Buscript(this);
+ // Add global variable "multiverse" to javascript environment
+ buscript.setScriptVariable("multiverse", this);
+ } catch (NullPointerException e) {
+ Logging.warning("Buscript failed to load! The script command will be disabled! " +
+ "If you would like not to see this message, " +
+ "use `/mv conf enablebuscript false` to disable Buscript from loading.");
+ }
+ }
}
private void initializeDestinationFactory() {
@@ -375,9 +381,7 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
pm.registerEvents(this.entityListener, this);
pm.registerEvents(this.weatherListener, this);
pm.registerEvents(this.portalListener, this);
- log(Level.INFO, "We are aware of the warning about the deprecated event. There is no alternative that allows us to do what we need to do. The performance impact is negligible.");
pm.registerEvents(this.worldListener, this);
- pm.registerEvents(new MVMapListener(this), this);
}
/**
@@ -494,13 +498,13 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
try {
wconf.load(worldsFile);
} catch (IOException e) {
- log(Level.WARNING, "Cannot load worlds.yml");
+ Logging.warning("Cannot load worlds.yml");
} catch (InvalidConfigurationException e) {
- log(Level.WARNING, "Your worlds.yml is invalid!");
+ Logging.warning("Your worlds.yml is invalid!");
}
if (!wconf.isConfigurationSection("worlds")) { // empty config
- this.log(Level.FINE, "No worlds to migrate!");
+ Logging.fine("No worlds to migrate!");
return;
}
@@ -513,9 +517,9 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
// fine
newValues.put(entry.getKey(), entry.getValue());
} else if (entry.getValue() instanceof ConfigurationSection) {
- this.log(Level.FINE, "Migrating: " + entry.getKey());
+ Logging.fine("Migrating: " + entry.getKey());
// we have to migrate this
- WorldProperties world = new WorldProperties(Collections.EMPTY_MAP);
+ WorldProperties world = new WorldProperties(Collections.emptyMap());
ConfigurationSection section = (ConfigurationSection) entry.getValue();
// migrate animals and monsters
@@ -679,8 +683,8 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
try {
difficulty = Difficulty.valueOf(section.getString("difficulty").toUpperCase());
} catch (IllegalArgumentException e) {
- this.log(Level.WARNING, "Could not parse difficulty: " + section.getString("difficulty"));
- this.log(Level.WARNING, "Setting world " + entry.getKey() + " difficulty to NORMAL");
+ Logging.warning("Could not parse difficulty: " + section.getString("difficulty"));
+ Logging.warning("Setting world " + entry.getKey() + " difficulty to NORMAL");
difficulty = Difficulty.NORMAL;
}
if (difficulty != null) {
@@ -697,7 +701,7 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
wasChanged = true;
} else {
// huh?
- this.log(Level.WARNING, "Removing unknown entry in the config: " + entry);
+ Logging.warning("Removing unknown entry in the config: " + entry);
// just don't add to newValues
wasChanged = true;
}
@@ -766,13 +770,16 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
this.commandHandler.registerCommand(new AnchorCommand(this));
// Misc Commands
this.commandHandler.registerCommand(new EnvironmentCommand(this));
- this.commandHandler.registerCommand(new DebugCommand(this));
+ // this.commandHandler.registerCommand(new DebugCommand(this));
this.commandHandler.registerCommand(new SilentCommand(this));
this.commandHandler.registerCommand(new GeneratorCommand(this));
this.commandHandler.registerCommand(new CheckCommand(this));
this.commandHandler.registerCommand(new ScriptCommand(this));
this.commandHandler.registerCommand(new GameruleCommand(this));
this.commandHandler.registerCommand(new GamerulesCommand(this));
+
+ //**NEW ACF COMMAND HANDLER**
+ this.commandManager.registerCommand(new DebugCommand(this));
}
/**
@@ -829,43 +836,6 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
}
}
- /**
- * {@inheritDoc}
- */
- @Override
- public void log(Level level, String msg) {
- Logging.log(level, msg);
- }
-
- /**
- * Logs a message at the specified level.
- *
- * @param level The Log-{@link Level}.
- * @param msg The message to log.
- *
- * @deprecated Replaced by {@link Logging}. Please refrain from using this from a third party plugin as the
- * messages will appear to originate from Multiverse-Core.
- */
- @Deprecated
- public static void staticLog(Level level, String msg) {
- Logging.log(level, msg);
- }
-
- /**
- * Print messages to the Debug Log, if the servers in Debug Mode then we also want to print the messages to the
- * standard Server Console.
- *
- * @param level The Log-{@link Level}
- * @param msg The message
- *
- * @deprecated Replaced by {@link Logging}. Please refrain from using this from a third party plugin as the
- * messages will appear to originate from Multiverse-Core.
- */
- @Deprecated
- public static void staticDebugLog(Level level, String msg) {
- Logging.log(level, msg);
- }
-
/**
* {@inheritDoc}
*/
@@ -900,13 +870,20 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
}
/**
- * Gets the log-tag.
- *
- * @return The log-tag
+ * {@inheritDoc}
*/
- // TODO this should be static!
- public String getTag() {
- return MultiverseCore.LOG_TAG;
+ @Override
+ public MVCommandManager getCommandManager() {
+ return this.commandManager;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ @Deprecated
+ public CommandQueueManager getCommandQueueManager() {
+ return commandQueueManager;
}
/**
@@ -1051,7 +1028,7 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
this.multiverseConfig.save(new File(getDataFolder(), "config.yml"));
return true;
} catch (IOException e) {
- this.log(Level.SEVERE, "Could not save Multiverse config.yml config. Please check your file permissions.");
+ Logging.severe("Could not save Multiverse config.yml config. Please check your file permissions.");
return false;
}
}
@@ -1094,17 +1071,27 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
* @return True if success, false if fail.
*/
public Boolean cloneWorld(String oldName, String newName, String generator) {
- return this.worldManager.cloneWorld(oldName, newName, generator);
+ return this.worldManager.cloneWorld(oldName, newName);
}
/**
* {@inheritDoc}
- * @deprecated This is deprecated!
+ * @deprecated This is deprecated! Do not use!
*/
@Override
@Deprecated
public Boolean regenWorld(String name, Boolean useNewSeed, Boolean randomSeed, String seed) {
- return this.worldManager.regenWorld(name, useNewSeed, randomSeed, seed);
+ return this.worldManager.regenWorld(name, useNewSeed, randomSeed, seed, false);
+ }
+
+ /**
+ * {@inheritDoc}
+ * @deprecated This is deprecated! Do not use!
+ */
+ @Override
+ @Deprecated
+ public Boolean regenWorld(String name, Boolean useNewSeed, Boolean randomSeed, String seed, Boolean keepGameRules) {
+ return this.worldManager.regenWorld(name, useNewSeed, randomSeed, seed, keepGameRules);
}
/**
@@ -1174,17 +1161,6 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
return config;
}
- /**
- * This method is currently used by other plugins.
- * It will be removed in 2.4
- * @return The Multiverse config.
- * @deprecated This is deprecated.
- */
- @Deprecated
- public static MultiverseCoreConfiguration getStaticConfig() {
- return MultiverseCoreConfiguration.getInstance();
- }
-
@Override
public Buscript getScriptAPI() {
return buscript;
diff --git a/src/main/java/com/onarandombox/MultiverseCore/MultiverseCoreConfiguration.java b/src/main/java/com/onarandombox/MultiverseCore/MultiverseCoreConfiguration.java
index a04a6651..cc9b5fce 100644
--- a/src/main/java/com/onarandombox/MultiverseCore/MultiverseCoreConfiguration.java
+++ b/src/main/java/com/onarandombox/MultiverseCore/MultiverseCoreConfiguration.java
@@ -48,14 +48,14 @@ public class MultiverseCoreConfiguration extends SerializationConfig implements
@Property
private volatile String prefixchatformat;
@Property
- private volatile boolean useasyncchat;
- @Property
private volatile boolean teleportintercept;
@Property
private volatile boolean firstspawnoverride;
@Property
private volatile boolean displaypermerrors;
@Property
+ private volatile boolean enablebuscript;
+ @Property
private volatile int globaldebug;
@Property
private volatile boolean silentstart;
@@ -93,18 +93,18 @@ public class MultiverseCoreConfiguration extends SerializationConfig implements
protected void setDefaults() {
// BEGIN CHECKSTYLE-SUPPRESSION: MagicNumberCheck
enforceaccess = false;
- useasyncchat = true;
- prefixchat = true;
+ prefixchat = false;
prefixchatformat = "[%world%]%chat%";
teleportintercept = true;
firstspawnoverride = true;
displaypermerrors = true;
+ enablebuscript = true;
globaldebug = 0;
messagecooldown = 5000;
teleportcooldown = 1000;
this.version = 2.9;
silentstart = false;
- defaultportalsearch = false;
+ defaultportalsearch = true;
portalsearchradius = 128;
autopurge = true;
idonotwanttodonate = false;
@@ -213,6 +213,22 @@ public class MultiverseCoreConfiguration extends SerializationConfig implements
return this.displaypermerrors;
}
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean getEnableBuscript() {
+ return this.enablebuscript;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void setEnableBuscript(boolean enableBuscript) {
+ this.enablebuscript = enableBuscript;
+ }
+
/**
* {@inheritDoc}
*/
@@ -303,16 +319,6 @@ public class MultiverseCoreConfiguration extends SerializationConfig implements
this.teleportcooldown = teleportCooldown;
}
- @Override
- public void setUseAsyncChat(boolean useAsyncChat) {
- this.useasyncchat = useAsyncChat;
- }
-
- @Override
- public boolean getUseAsyncChat() {
- return this.useasyncchat;
- }
-
@Override
public void setSilentStart(boolean silentStart) {
Logging.setShowingConfig(!silentStart);
diff --git a/src/main/java/com/onarandombox/MultiverseCore/api/Core.java b/src/main/java/com/onarandombox/MultiverseCore/api/Core.java
index ff8513d4..d1d4e9e8 100644
--- a/src/main/java/com/onarandombox/MultiverseCore/api/Core.java
+++ b/src/main/java/com/onarandombox/MultiverseCore/api/Core.java
@@ -8,6 +8,8 @@
package com.onarandombox.MultiverseCore.api;
import buscript.Buscript;
+import com.onarandombox.MultiverseCore.commandtools.MVCommandManager;
+import com.onarandombox.MultiverseCore.commandtools.queue.CommandQueueManager;
import com.onarandombox.MultiverseCore.destination.DestinationFactory;
import com.onarandombox.MultiverseCore.utils.AnchorManager;
import com.onarandombox.MultiverseCore.utils.MVEconomist;
@@ -86,6 +88,23 @@ public interface Core {
*/
CommandHandler getCommandHandler();
+ /**
+ * Multiverse uses {@link MVCommandManager} to make adding and using commands
+ * a piece of cake.
+ *
+ * @return A non-null {@link MVCommandManager}.
+ */
+ MVCommandManager getCommandManager();
+
+ /**
+ * Manager for command that requires /mv confirm before execution.
+ *
+ * @return A non-null {@link CommandQueueManager}.
+ * @deprecated To be moved to new command manager in 5.0.0
+ */
+ @Deprecated
+ CommandQueueManager getCommandQueueManager();
+
/**
* Gets the factory class responsible for loading many different destinations
* on demand.
@@ -116,20 +135,38 @@ public interface Core {
AnchorManager getAnchorManager();
/**
- * Used by queued commands to regenerate a world on a delay.
+ * Previously used by queued commands to regenerate a world on a delay.
+ * Do not use api method for any other purpose.
*
- * @param name Name of the world to regenerate
- * @param useNewSeed If a new seed should be used
- * @param randomSeed IF the new seed should be random
- * @param seed The seed of the world.
+ * @param name Name of the world to regenerate
+ * @param useNewSeed If a new seed should be used
+ * @param randomSeed If the new seed should be random
+ * @param seed The seed of the world.
*
* @return True if success, false if fail.
*
- * @deprecated Use {@link MVWorldManager#regenWorld(String, boolean, boolean, String)} instead.
+ * @deprecated Use {@link MVWorldManager#regenWorld(String, boolean, boolean, String, boolean)} instead.
*/
@Deprecated
Boolean regenWorld(String name, Boolean useNewSeed, Boolean randomSeed, String seed);
+ /**
+ * Used by queued commands to regenerate a world on a delay.
+ * Do not use api method for any other purpose.
+ *
+ * @param name Name of the world to regenerate
+ * @param useNewSeed If a new seed should be used
+ * @param randomSeed If the new seed should be random
+ * @param seed The seed of the world.
+ * @param keepGameRules If GameRules should be kept on world regen.
+ *
+ * @return True if success, false if fail.
+ *
+ * @deprecated Use {@link MVWorldManager#regenWorld(String, boolean, boolean, String, boolean)} instead.
+ */
+ @Deprecated
+ Boolean regenWorld(String name, Boolean useNewSeed, Boolean randomSeed, String seed, Boolean keepGameRules);
+
/**
* Decrements the number of plugins that have specifically hooked into core.
*/
diff --git a/src/main/java/com/onarandombox/MultiverseCore/api/LoggablePlugin.java b/src/main/java/com/onarandombox/MultiverseCore/api/LoggablePlugin.java
deleted file mode 100644
index f37ef788..00000000
--- a/src/main/java/com/onarandombox/MultiverseCore/api/LoggablePlugin.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/******************************************************************************
- * Multiverse 2 Copyright (c) the Multiverse Team 2011. *
- * Multiverse 2 is licensed under the BSD License. *
- * For more information please check the README.md file included *
- * with this project. *
- ******************************************************************************/
-
-package com.onarandombox.MultiverseCore.api;
-
-import org.bukkit.Server;
-
-import java.util.logging.Level;
-
-/** A simple API to require plugins to have a log method. */
-public interface LoggablePlugin {
- /**
- * Logs a message at the specified level.
- *
- * @param level The Log-{@link Level}.
- * @param msg The message to log.
- */
- void log(Level level, String msg);
-
- /**
- * Gets the server instance that this plugin is attached to.
- *
- * @return A {@link Server} instance.
- */
- Server getServer();
-}
diff --git a/src/main/java/com/onarandombox/MultiverseCore/api/MVPlugin.java b/src/main/java/com/onarandombox/MultiverseCore/api/MVPlugin.java
index e70cd35d..a9582edf 100644
--- a/src/main/java/com/onarandombox/MultiverseCore/api/MVPlugin.java
+++ b/src/main/java/com/onarandombox/MultiverseCore/api/MVPlugin.java
@@ -13,7 +13,7 @@ import com.onarandombox.MultiverseCore.event.MVVersionEvent;
/**
* This interface is implemented by every official Multiverse-plugin.
*/
-public interface MVPlugin extends LoggablePlugin {
+public interface MVPlugin {
/**
* Adds This plugin's version information to the buffer and returns the new string.
*
diff --git a/src/main/java/com/onarandombox/MultiverseCore/api/MVWorldManager.java b/src/main/java/com/onarandombox/MultiverseCore/api/MVWorldManager.java
index 3eb96e2d..3c835c8d 100644
--- a/src/main/java/com/onarandombox/MultiverseCore/api/MVWorldManager.java
+++ b/src/main/java/com/onarandombox/MultiverseCore/api/MVWorldManager.java
@@ -59,18 +59,6 @@ public interface MVWorldManager {
boolean addWorld(String name, Environment env, String seedString, WorldType type, Boolean generateStructures,
String generator, boolean useSpawnAdjust);
- /**
- * Make a copy of a world.
- *
- * @param oldName Name of world to be copied
- * @param newName Name of world to be created
- * @param generator The Custom generator plugin to use. Ignored.
- * @return True if the world is copied successfully, false if not.
- * @deprecated Use {@link #cloneWorld(String, String)} instead.
- */
- @Deprecated
- boolean cloneWorld(String oldName, String newName, String generator);
-
/**
* Make a copy of a world.
*
@@ -174,6 +162,16 @@ public interface MVWorldManager {
*/
MultiverseWorld getMVWorld(String name);
+ /**
+ * Returns a {@link MultiverseWorld} if the world with name given exists, and null if it does not.
+ * This will search optionally for alias names.
+ *
+ * @param name The name or optionally the alias of the world to get.
+ * @param checkAliases Indicates whether to check for world alias name.
+ * @return A {@link MultiverseWorld} or null.
+ */
+ MultiverseWorld getMVWorld(String name, boolean checkAliases);
+
/**
* Returns a {@link MultiverseWorld} if it exists, and null if it does not.
*
@@ -183,13 +181,24 @@ public interface MVWorldManager {
MultiverseWorld getMVWorld(World world);
/**
- * Checks to see if the given name is a valid {@link MultiverseWorld}.
+ * Checks to see if the given name is a valid {@link MultiverseWorld}
+ * Searches based on world name AND alias.
*
* @param name The name or alias of the world to check.
* @return True if the world exists, false if not.
*/
boolean isMVWorld(String name);
+ /**
+ * Checks to see if the given name is a valid {@link MultiverseWorld}.
+ * Optionally searches by alias is specified.
+ *
+ * @param name The name or alias of the world to check.
+ * @param checkAliases Indicates whether to check for world alias name.
+ * @return True if the world exists, false if not.
+ */
+ boolean isMVWorld(String name, boolean checkAliases);
+
/**
* Checks to see if the given world is a valid {@link MultiverseWorld}.
*
@@ -213,19 +222,9 @@ public interface MVWorldManager {
*/
void loadDefaultWorlds();
- /**
- * Return the World Purger.
- *
- * @return A valid {@link PurgeWorlds}.
- * @deprecated {@link PurgeWorlds} is deprecated!
- */
- @Deprecated
- PurgeWorlds getWorldPurger();
-
/**
* Gets the {@link WorldPurger}.
*
- * TODO: Remove {@link #getWorldPurger()} and replace it with this method.
* @return The {@link WorldPurger} this {@link MVWorldManager} is using.
* @see WorldPurger
* @see SimpleWorldPurger
@@ -292,15 +291,28 @@ public interface MVWorldManager {
/**
* Regenerates a world.
*
- * @param name Name of the world to regenerate
- * @param useNewSeed If a new seed should be used
- * @param randomSeed IF the new seed should be random
- * @param seed The seed of the world.
+ * @param name Name of the world to regenerate
+ * @param useNewSeed If a new seed should be used
+ * @param randomSeed If the new seed should be random
+ * @param seed The seed of the world.
*
* @return True if success, false if fail.
*/
boolean regenWorld(String name, boolean useNewSeed, boolean randomSeed, String seed);
+ /**
+ * Regenerates a world.
+ *
+ * @param name Name of the world to regenerate
+ * @param useNewSeed If a new seed should be used
+ * @param randomSeed If the new seed should be random
+ * @param seed The seed of the world.
+ * @param keepGameRules If GameRules should be kept on world regen.
+ *
+ * @return True if success, false if fail.
+ */
+ boolean regenWorld(String name, boolean useNewSeed, boolean randomSeed, String seed, boolean keepGameRules);
+
boolean isKeepingSpawnInMemory(World world);
/**
@@ -314,4 +326,11 @@ public interface MVWorldManager {
* does not exist. {@code includeLoaded} if the world exists and is loaded.
*/
boolean hasUnloadedWorld(String name, boolean includeLoaded);
+
+ /**
+ * Get all the possible worlds that Multiverse has detected to be importable.
+ *
+ * @return A collection of world names that are deemed importable.
+ */
+ Collection getPotentialWorlds();
}
diff --git a/src/main/java/com/onarandombox/MultiverseCore/api/MultiverseCoreConfig.java b/src/main/java/com/onarandombox/MultiverseCore/api/MultiverseCoreConfig.java
index b5574ff2..ee8d0b16 100644
--- a/src/main/java/com/onarandombox/MultiverseCore/api/MultiverseCoreConfig.java
+++ b/src/main/java/com/onarandombox/MultiverseCore/api/MultiverseCoreConfig.java
@@ -86,6 +86,18 @@ public interface MultiverseCoreConfig extends ConfigurationSerializable {
*/
boolean getDisplayPermErrors();
+ /**
+ * Sets enableBuscript.
+ * @param enableBuscript The new value.
+ */
+ void setEnableBuscript(boolean enableBuscript);
+
+ /**
+ * Gets enableBuscript.
+ * @return enableBuscript.
+ */
+ boolean getEnableBuscript();
+
/**
* Sets firstSpawnOverride.
* @param firstSpawnOverride The new value.
@@ -146,18 +158,6 @@ public interface MultiverseCoreConfig extends ConfigurationSerializable {
*/
boolean getEnforceAccess();
- /**
- * Sets useasyncchat.
- * @param useAsyncChat The new value.
- */
- void setUseAsyncChat(boolean useAsyncChat);
-
- /**
- * Gets useasyncchat.
- * @return useasyncchat.
- */
- boolean getUseAsyncChat();
-
/**
* Sets whether to suppress startup messages.
*
diff --git a/src/main/java/com/onarandombox/MultiverseCore/api/MultiversePlugin.java b/src/main/java/com/onarandombox/MultiverseCore/api/MultiversePlugin.java
index a6a064b8..28bbc919 100644
--- a/src/main/java/com/onarandombox/MultiverseCore/api/MultiversePlugin.java
+++ b/src/main/java/com/onarandombox/MultiverseCore/api/MultiversePlugin.java
@@ -115,33 +115,6 @@ public abstract class MultiversePlugin extends JavaPlugin implements MVPlugin {
return this.getCore().getCommandHandler().locateAndRunCommand(sender, allArgs);
}
- @Override
- public void log(Level level, String msg) {
- int debugLevel = this.getCore().getMVConfig().getGlobalDebug();
- if ((level == Level.FINE && debugLevel >= 1) || (level == Level.FINER && debugLevel >= 2)
- || (level == Level.FINEST && debugLevel >= 3)) {
- debugLog.log(level, msg);
- } else if (level != Level.FINE && level != Level.FINER && level != Level.FINEST) {
- String message = new StringBuilder(getLogTag()).append(msg).toString();
- this.getServer().getLogger().log(level, message);
- debugLog.log(level, message);
- }
- }
-
- private String getLogTag() {
- if (logTag == null)
- logTag = String.format("[%s]", this.getDescription().getName());
- return logTag;
- }
-
- /**
- * Sets the debug log-tag.
- * @param tag The new tag.
- */
- protected final void setDebugLogTag(String tag) {
- this.debugLog.setTag(tag);
- }
-
@Override
public final String dumpVersionInfo(String buffer) {
throw new UnsupportedOperationException("This is gone.");
diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/DebugCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/DebugCommand.java
index 4f6ec40c..e4cabe2a 100644
--- a/src/main/java/com/onarandombox/MultiverseCore/commands/DebugCommand.java
+++ b/src/main/java/com/onarandombox/MultiverseCore/commands/DebugCommand.java
@@ -1,66 +1,57 @@
-/******************************************************************************
- * Multiverse 2 Copyright (c) the Multiverse Team 2011. *
- * Multiverse 2 is licensed under the BSD License. *
- * For more information please check the README.md file included *
- * with this project. *
- ******************************************************************************/
-
package com.onarandombox.MultiverseCore.commands;
+import co.aikar.commands.CommandIssuer;
+import co.aikar.commands.annotation.CommandAlias;
+import co.aikar.commands.annotation.CommandCompletion;
+import co.aikar.commands.annotation.CommandPermission;
+import co.aikar.commands.annotation.Conditions;
+import co.aikar.commands.annotation.Description;
+import co.aikar.commands.annotation.Subcommand;
+import co.aikar.commands.annotation.Syntax;
+import com.dumptruckman.minecraft.util.Logging;
import com.onarandombox.MultiverseCore.MultiverseCore;
-import org.bukkit.ChatColor;
-import org.bukkit.command.CommandSender;
-import org.bukkit.permissions.PermissionDefault;
+import com.onarandombox.MultiverseCore.locale.MVCorei18n;
+import org.jetbrains.annotations.NotNull;
-import java.util.List;
-import java.util.logging.Level;
-
-/**
- * Enables debug-information.
- */
+@CommandAlias("mv")
public class DebugCommand extends MultiverseCommand {
public DebugCommand(MultiverseCore plugin) {
super(plugin);
- this.setName("Turn Debug on/off?");
- this.setCommandUsage("/mv debug" + ChatColor.GOLD + " [1|2|3|off|silent]");
- this.setArgRange(0, 1);
- 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);
}
- @Override
- public void runCommand(CommandSender sender, List args) {
- if (args.size() == 1) {
- if (args.get(0).equalsIgnoreCase("off")) {
- plugin.getMVConfig().setGlobalDebug(0);
- } else {
- try {
- int debugLevel = Integer.parseInt(args.get(0));
- if (debugLevel > 3 || debugLevel < 0) {
- throw new NumberFormatException();
- }
- plugin.getMVConfig().setGlobalDebug(debugLevel);
- } catch (NumberFormatException e) {
- sender.sendMessage(ChatColor.RED + "Error" + ChatColor.WHITE
- + " setting debug level. Please use a number 0-3 " + ChatColor.AQUA + "(3 being many many messages!)");
- }
- }
- plugin.saveMVConfigs();
- }
- this.displayDebugMode(sender);
+ @Subcommand("debug")
+ @CommandPermission("multiverse.core.debug")
+ @Description("{@@mv-core.debug_info_description}")
+ public void onShowDebugCommand(@NotNull CommandIssuer issuer) {
+ this.displayDebugMode(issuer);
}
- private void displayDebugMode(CommandSender sender) {
- final int debugLevel = plugin.getMVConfig().getGlobalDebug();
+
+ @Subcommand("debug")
+ @CommandPermission("multiverse.core.debug")
+ @Syntax("<{@@mv-core.debug_change_syntax}>")
+ @CommandCompletion("@range:3")
+ @Description("{@@mv-core.debug_change_description}")
+ public void onChangeDebugCommand(@NotNull CommandIssuer issuer,
+
+ @Conditions("debuglevel")
+ @Syntax("<{@@mv-core.debug_change_syntax}>")
+ @Description("{@@mv-core.debug_change_level_description}")
+ int level) {
+
+ this.plugin.getMVConfig().setGlobalDebug(level);
+ this.plugin.saveMVConfigs();
+ this.displayDebugMode(issuer);
+ }
+
+ private void displayDebugMode(@NotNull CommandIssuer issuer) {
+ final int debugLevel = this.plugin.getMVConfig().getGlobalDebug();
if (debugLevel == 0) {
- sender.sendMessage("Multiverse Debug mode is " + ChatColor.RED + "OFF");
- } else {
- sender.sendMessage("Multiverse Debug mode is " + ChatColor.GREEN + debugLevel);
- this.plugin.log(Level.FINE, "Multiverse Debug ENABLED");
+ issuer.sendInfo(MVCorei18n.DEBUG_INFO_OFF);
+ return;
}
+ issuer.sendInfo(MVCorei18n.DEBUG_INFO_ON, "{level}", String.valueOf(debugLevel));
+ Logging.fine("Multiverse Debug ENABLED.");
}
}
diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/GamerulesCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/GamerulesCommand.java
deleted file mode 100644
index 321ac090..00000000
--- a/src/main/java/com/onarandombox/MultiverseCore/commands/GamerulesCommand.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/******************************************************************************
- * Multiverse 2 Copyright (c) the Multiverse Team 2011. *
- * Multiverse 2 is licensed under the BSD License. *
- * For more information please check the README.md file included *
- * with this project. *
- ******************************************************************************/
-
-package com.onarandombox.MultiverseCore.commands;
-
-import com.onarandombox.MultiverseCore.MultiverseCore;
-import org.bukkit.Bukkit;
-import org.bukkit.ChatColor;
-import org.bukkit.World;
-import org.bukkit.command.CommandSender;
-import org.bukkit.entity.Player;
-import org.bukkit.permissions.PermissionDefault;
-
-import java.util.List;
-
-/**
- * Allows management of Anchor Destinations.
- */
-public class GamerulesCommand extends MultiverseCommand {
-
- public GamerulesCommand(MultiverseCore plugin) {
- super(plugin);
- this.setName("List the Minecraft Game Rules for a World.");
- this.setCommandUsage("/mv gamerules" + ChatColor.GOLD + " [WORLD]");
- this.setArgRange(0, 1);
- this.addKey("mv gamerules");
- this.addKey("mv rules");
- this.addKey("mvgamerules");
- this.addKey("mvrules");
- this.addCommandExample("/mv gamerules");
- this.addCommandExample("/mvrules " + ChatColor.RED + "world_nether");
- this.setPermission("multiverse.core.gamerule.list", "Allows a player to list gamerules.", PermissionDefault.OP);
- }
-
-
- @Override
- public void runCommand(CommandSender sender, List args) {
- // We NEED a world from the command line
- final Player p;
- if (sender instanceof Player) {
- p = (Player) sender;
- } else {
- p = null;
- }
-
- if (args.size() == 0 && p == null) {
- sender.sendMessage("From the command line, WORLD is required.");
- sender.sendMessage(this.getCommandDesc());
- sender.sendMessage(this.getCommandUsage());
- sender.sendMessage("Nothing changed.");
- return;
- }
-
- final World world;
- if (args.size() == 0) {
- world = p.getWorld();
- } else {
- world = Bukkit.getWorld(args.get(0));
- }
-
- final StringBuilder gameRules = new StringBuilder();
- for (final String gameRule : world.getGameRules()) {
- if (gameRules.length() != 0) {
- gameRules.append(ChatColor.WHITE).append(", ");
- }
- gameRules.append(ChatColor.AQUA).append(gameRule).append(ChatColor.WHITE).append(": ");
- gameRules.append(ChatColor.GREEN).append(world.getGameRuleValue(gameRule));
- }
- sender.sendMessage("=== Gamerules for " + ChatColor.AQUA + world.getName() + ChatColor.WHITE + " ===");
- sender.sendMessage(gameRules.toString());
- }
-}
diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/ListCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/ListCommand.java
deleted file mode 100644
index e63ea4f2..00000000
--- a/src/main/java/com/onarandombox/MultiverseCore/commands/ListCommand.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/******************************************************************************
- * Multiverse 2 Copyright (c) the Multiverse Team 2011. *
- * Multiverse 2 is licensed under the BSD License. *
- * For more information please check the README.md file included *
- * with this project. *
- ******************************************************************************/
-
-package com.onarandombox.MultiverseCore.commands;
-
-import com.onarandombox.MultiverseCore.MultiverseCore;
-import com.onarandombox.MultiverseCore.api.MultiverseWorld;
-import org.bukkit.ChatColor;
-import org.bukkit.World.Environment;
-import org.bukkit.command.CommandSender;
-import org.bukkit.entity.Player;
-import org.bukkit.permissions.PermissionDefault;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Displays a listing of all worlds that a player can enter.
- */
-public class ListCommand extends PaginatedCoreCommand {
-
- public ListCommand(MultiverseCore plugin) {
- super(plugin);
- this.setName("World Listing");
- this.setCommandUsage("/mv list");
- this.setArgRange(0, 2);
- this.addKey("mvlist");
- this.addKey("mvl");
- this.addKey("mv list");
- this.setPermission("multiverse.core.list.worlds", "Displays a listing of all worlds that you can enter.", PermissionDefault.OP);
- this.setItemsPerPage(8); // SUPPRESS CHECKSTYLE: MagicNumberCheck
- }
-
- private List getFancyWorldList(Player p) {
- List worldList = new ArrayList();
- for (MultiverseWorld world : this.plugin.getMVWorldManager().getMVWorlds()) {
-
- if (p != null && (!this.plugin.getMVPerms().canEnterWorld(p, world))) {
- continue;
- }
-
- ChatColor color = ChatColor.GOLD;
- Environment env = world.getEnvironment();
- if (env == Environment.NETHER) {
- color = ChatColor.RED;
- } else if (env == Environment.NORMAL) {
- color = ChatColor.GREEN;
- } else if (env == Environment.THE_END) {
- color = ChatColor.AQUA;
- }
- StringBuilder builder = new StringBuilder();
- builder.append(world.getColoredWorldString()).append(ChatColor.WHITE);
- builder.append(" - ").append(color).append(world.getEnvironment());
- if (world.isHidden()) {
- if (p == null || this.plugin.getMVPerms().hasPermission(p, "multiverse.core.modify", true)) {
- // Prefix hidden worlds with an "[H]"
- worldList.add(ChatColor.GRAY + "[H]" + builder.toString());
- }
- } else {
- worldList.add(builder.toString());
- }
- }
- for (String name : this.plugin.getMVWorldManager().getUnloadedWorlds()) {
- if (p == null || this.plugin.getMVPerms().hasPermission(p, "multiverse.access." + name, true)) {
- worldList.add(ChatColor.GRAY + name + " - UNLOADED");
- }
- }
- return worldList;
- }
-
- @Override
- protected List getFilteredItems(List availableItems, String filter) {
- List filtered = new ArrayList();
-
- for (String s : availableItems) {
- if (s.matches("(?i).*" + filter + ".*")) {
- filtered.add(s);
- }
- }
- return filtered;
- }
-
- @Override
- protected String getItemText(String item) {
- return item;
- }
-
- @Override
- public void runCommand(CommandSender sender, List args) {
- sender.sendMessage(ChatColor.LIGHT_PURPLE + "====[ Multiverse World List ]====");
- Player p = null;
- if (sender instanceof Player) {
- p = (Player) sender;
- }
-
-
- FilterObject filterObject = this.getPageAndFilter(args);
-
- List availableWorlds = new ArrayList(this.getFancyWorldList(p));
- if (filterObject.getFilter().length() > 0) {
- availableWorlds = this.getFilteredItems(availableWorlds, filterObject.getFilter());
- if (availableWorlds.size() == 0) {
- sender.sendMessage(ChatColor.RED + "Sorry... " + ChatColor.WHITE
- + "No worlds matched your filter: " + ChatColor.AQUA + filterObject.getFilter());
- return;
- }
- }
-
- if (!(sender instanceof Player)) {
- for (String c : availableWorlds) {
- sender.sendMessage(c);
- }
- return;
- }
-
- int totalPages = (int) Math.ceil(availableWorlds.size() / (this.itemsPerPage + 0.0));
-
- if (filterObject.getPage() > totalPages) {
- filterObject.setPage(totalPages);
- }
-
- sender.sendMessage(ChatColor.AQUA + " Page " + filterObject.getPage() + " of " + totalPages);
-
- this.showPage(filterObject.getPage(), sender, availableWorlds);
- }
-}
diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/MultiverseCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/MultiverseCommand.java
index ae54a9b8..42a65604 100644
--- a/src/main/java/com/onarandombox/MultiverseCore/commands/MultiverseCommand.java
+++ b/src/main/java/com/onarandombox/MultiverseCore/commands/MultiverseCommand.java
@@ -1,40 +1,13 @@
-/******************************************************************************
- * Multiverse 2 Copyright (c) the Multiverse Team 2011. *
- * Multiverse 2 is licensed under the BSD License. *
- * For more information please check the README.md file included *
- * with this project. *
- ******************************************************************************/
-
package com.onarandombox.MultiverseCore.commands;
+import co.aikar.commands.BaseCommand;
import com.onarandombox.MultiverseCore.MultiverseCore;
-import com.onarandombox.MultiverseCore.api.MultiverseMessaging;
-import com.pneumaticraft.commandhandler.Command;
-import org.bukkit.command.CommandSender;
-import java.util.List;
+public class MultiverseCommand extends BaseCommand {
-/**
- * A generic Multiverse-command.
- */
-public abstract class MultiverseCommand extends Command {
+ protected final MultiverseCore plugin;
- /**
- * The reference to the core.
- */
- protected MultiverseCore plugin;
- /**
- * The reference to {@link MultiverseMessaging}.
- */
- protected MultiverseMessaging messaging;
-
- public MultiverseCommand(MultiverseCore plugin) {
- super(plugin);
+ protected MultiverseCommand(MultiverseCore plugin) {
this.plugin = plugin;
- this.messaging = this.plugin.getMessaging();
}
-
- @Override
- public abstract void runCommand(CommandSender sender, List args);
-
}
diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/VersionCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/VersionCommand.java
deleted file mode 100644
index b2ac51e4..00000000
--- a/src/main/java/com/onarandombox/MultiverseCore/commands/VersionCommand.java
+++ /dev/null
@@ -1,227 +0,0 @@
-/******************************************************************************
- * Multiverse 2 Copyright (c) the Multiverse Team 2011. *
- * Multiverse 2 is licensed under the BSD License. *
- * For more information please check the README.md file included *
- * with this project. *
- ******************************************************************************/
-
-package com.onarandombox.MultiverseCore.commands;
-
-import com.dumptruckman.minecraft.util.Logging;
-import com.onarandombox.MultiverseCore.MultiverseCore;
-import com.onarandombox.MultiverseCore.event.MVVersionEvent;
-import com.onarandombox.MultiverseCore.utils.webpaste.BitlyURLShortener;
-import com.onarandombox.MultiverseCore.utils.webpaste.PasteFailedException;
-import com.onarandombox.MultiverseCore.utils.webpaste.PasteService;
-import com.onarandombox.MultiverseCore.utils.webpaste.PasteServiceFactory;
-import com.onarandombox.MultiverseCore.utils.webpaste.PasteServiceType;
-import com.onarandombox.MultiverseCore.utils.webpaste.URLShortener;
-import com.pneumaticraft.commandhandler.CommandHandler;
-import org.apache.commons.lang.StringUtils;
-import org.bukkit.ChatColor;
-import org.bukkit.command.CommandSender;
-import org.bukkit.command.ConsoleCommandSender;
-import org.bukkit.entity.Player;
-import org.bukkit.permissions.PermissionDefault;
-import org.bukkit.scheduler.BukkitRunnable;
-import org.bukkit.util.StringUtil;
-
-import java.io.*;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Dumps version info to the console.
- */
-public class VersionCommand extends MultiverseCommand {
- private static final URLShortener SHORTENER = new BitlyURLShortener();
-
- public VersionCommand(MultiverseCore plugin) {
- super(plugin);
- this.setName("Multiverse Version");
- this.setCommandUsage("/mv version " + ChatColor.GOLD + "-[bh] [--include-plugin-list]");
- this.setArgRange(0, 2);
- this.addKey("mv version");
- this.addKey("mvv");
- this.addKey("mvversion");
- this.setPermission("multiverse.core.version",
- "Dumps version info to the console, optionally to pastie.org with -p or pastebin.com with a -b.", PermissionDefault.TRUE);
- }
-
- private String getLegacyString() {
- StringBuilder legacyFile = new StringBuilder();
- legacyFile.append("[Multiverse-Core] Multiverse-Core Version: ").append(this.plugin.getDescription().getVersion()).append('\n');
- legacyFile.append("[Multiverse-Core] Bukkit Version: ").append(this.plugin.getServer().getVersion()).append('\n');
- legacyFile.append("[Multiverse-Core] Loaded Worlds: ").append(this.plugin.getMVWorldManager().getMVWorlds()).append('\n');
- legacyFile.append("[Multiverse-Core] Multiverse Plugins Loaded: ").append(this.plugin.getPluginCount()).append('\n');
- legacyFile.append("[Multiverse-Core] Economy being used: ").append(plugin.getEconomist().getEconomyName()).append('\n');
- legacyFile.append("[Multiverse-Core] Permissions Plugin: ").append(this.plugin.getMVPerms().getType()).append('\n');
- legacyFile.append("[Multiverse-Core] Dumping Config Values: (version ")
- .append(this.plugin.getMVConfig().getVersion()).append(")").append('\n');
- legacyFile.append("[Multiverse-Core] messagecooldown: ").append(plugin.getMessaging().getCooldown()).append('\n');
- legacyFile.append("[Multiverse-Core] teleportcooldown: ").append(plugin.getMVConfig().getTeleportCooldown()).append('\n');
- legacyFile.append("[Multiverse-Core] worldnameprefix: ").append(plugin.getMVConfig().getPrefixChat()).append('\n');
- legacyFile.append("[Multiverse-Core] worldnameprefixFormat: ").append(plugin.getMVConfig().getPrefixChatFormat()).append('\n');
- legacyFile.append("[Multiverse-Core] enforceaccess: ").append(plugin.getMVConfig().getEnforceAccess()).append('\n');
- legacyFile.append("[Multiverse-Core] displaypermerrors: ").append(plugin.getMVConfig().getDisplayPermErrors()).append('\n');
- legacyFile.append("[Multiverse-Core] teleportintercept: ").append(plugin.getMVConfig().getTeleportIntercept()).append('\n');
- legacyFile.append("[Multiverse-Core] firstspawnoverride: ").append(plugin.getMVConfig().getFirstSpawnOverride()).append('\n');
- legacyFile.append("[Multiverse-Core] firstspawnworld: ").append(plugin.getMVConfig().getFirstSpawnWorld()).append('\n');
- legacyFile.append("[Multiverse-Core] debug: ").append(plugin.getMVConfig().getGlobalDebug()).append('\n');
- legacyFile.append("[Multiverse-Core] Special Code: FRN002").append('\n');
- return legacyFile.toString();
- }
-
- private String getMarkdownString() {
- StringBuilder markdownString = new StringBuilder();
- markdownString.append("# Multiverse-Core\n");
- markdownString.append("## Overview\n");
- markdownString.append("| Name | Value |\n");
- markdownString.append("| --- | --- |\n");
- markdownString.append("| Multiverse-Core Version | `").append(this.plugin.getDescription().getVersion()).append("` |\n");
- markdownString.append("| Bukkit Version | `").append(this.plugin.getServer().getVersion()).append("` |\n");
- //markdownString.append("| Loaded Worlds | `").append(this.plugin.getMVWorldManager().getMVWorlds()).append("` |\n");
- markdownString.append("| Multiverse Plugins Loaded | `").append(this.plugin.getPluginCount()).append("` |\n");
- markdownString.append("| Economy being used | `").append(plugin.getEconomist().getEconomyName()).append("` |\n");
- markdownString.append("| Permissions Plugin | `").append(this.plugin.getMVPerms().getType()).append("` |\n");
- markdownString.append("## Parsed Config\n");
- markdownString.append("These are what Multiverse thought the in-memory values of the config were.\n\n");
- markdownString.append("| Config Key | Value |\n");
- markdownString.append("| --- | --- |\n");
- markdownString.append("| version | `").append(this.plugin.getMVConfig().getVersion()).append("` |\n");
- markdownString.append("| messagecooldown | `").append(plugin.getMessaging().getCooldown()).append("` |\n");
- markdownString.append("| teleportcooldown | `").append(plugin.getMVConfig().getTeleportCooldown()).append("` |\n");
- markdownString.append("| worldnameprefix | `").append(plugin.getMVConfig().getPrefixChat()).append("` |\n");
- markdownString.append("| worldnameprefixFormat | `").append(plugin.getMVConfig().getPrefixChatFormat()).append("` |\n");
- markdownString.append("| enforceaccess | `").append(plugin.getMVConfig().getEnforceAccess()).append("` |\n");
- markdownString.append("| displaypermerrors | `").append(plugin.getMVConfig().getDisplayPermErrors()).append("` |\n");
- markdownString.append("| teleportintercept | `").append(plugin.getMVConfig().getTeleportIntercept()).append("` |\n");
- markdownString.append("| firstspawnoverride | `").append(plugin.getMVConfig().getFirstSpawnOverride()).append("` |\n");
- markdownString.append("| firstspawnworld | `").append(plugin.getMVConfig().getFirstSpawnWorld()).append("` |\n");
- markdownString.append("| debug | `").append(plugin.getMVConfig().getGlobalDebug()).append("` |\n");
- return markdownString.toString();
- }
-
- private String readFile(final String filename) {
- String result;
- try {
- FileReader reader = new FileReader(filename);
- BufferedReader bufferedReader = new BufferedReader(reader);
- String line;
- result = "";
- while ((line = bufferedReader.readLine()) != null) {
- result += line + '\n';
- }
- } catch (FileNotFoundException e) {
- Logging.severe("Unable to find %s. Here's the traceback: %s", filename, e.getMessage());
- e.printStackTrace();
- result = String.format("ERROR: Could not load: %s", filename);
- } catch (IOException e) {
- Logging.severe("Something bad happend when reading %s. Here's the traceback: %s", filename, e.getMessage());
- e.printStackTrace();
- result = String.format("ERROR: Could not load: %s", filename);
- }
- return result;
- }
-
- private Map getVersionFiles() {
- Map files = new HashMap();
-
- // Add the legacy file, but as markdown so it's readable
- files.put("version.md", this.getMarkdownString());
-
- // Add the config.yml
- File configFile = new File(this.plugin.getDataFolder(), "config.yml");
- files.put(configFile.getName(), this.readFile(configFile.getAbsolutePath()));
-
- // Add the config.yml
- File worldConfig = new File(this.plugin.getDataFolder(), "worlds.yml");
- files.put(worldConfig.getName(), this.readFile(worldConfig.getAbsolutePath()));
- return files;
- }
-
- @Override
- public void runCommand(final CommandSender sender, final List args) {
- // Check if the command was sent from a Player.
- if (sender instanceof Player) {
- sender.sendMessage("Version info dumped to console. Please check your server logs.");
- }
-
- MVVersionEvent versionEvent = new MVVersionEvent(this.getLegacyString(), this.getVersionFiles());
- final Map files = this.getVersionFiles();
- this.plugin.getServer().getPluginManager().callEvent(versionEvent);
-
- String versionInfo = versionEvent.getVersionInfo();
-
- if (CommandHandler.hasFlag("--include-plugin-list", args)) {
- versionInfo = versionInfo + "\nPlugins: " + getPluginList();
- }
-
- final String data = versionInfo;
-
- // log to console
- String[] lines = data.split("\n");
- for (String line : lines) {
- if (!line.isEmpty()) {
- Logging.info(line);
- }
- }
-
- BukkitRunnable logPoster = new BukkitRunnable() {
- @Override
- public void run() {
- if (args.size() > 0) {
- String pasteUrl;
- if (CommandHandler.hasFlag("-b", args)) {
- // private post to pastebin
- pasteUrl = postToService(PasteServiceType.PASTEBIN, true, data, files);
- } else if (CommandHandler.hasFlag("-h", args)) {
- // private post to pastebin
- pasteUrl = postToService(PasteServiceType.HASTEBIN, true, data, files);
- } else {
- return;
- }
-
- if (!(sender instanceof ConsoleCommandSender)) {
- sender.sendMessage("Version info dumped here: " + ChatColor.GREEN + pasteUrl);
- }
- Logging.info("Version info dumped here: %s", pasteUrl);
- }
- }
- };
-
- // Run the log posting operation asynchronously, since we don't know how long it will take.
- logPoster.runTaskAsynchronously(this.plugin);
- }
-
- /**
- * Send the current contents of this.pasteBinBuffer to a web service.
- *
- * @param type Service type to send paste data to.
- * @param isPrivate Should the paste be marked as private.
- * @param pasteData Legacy string only data to post to a service.
- * @param pasteFiles Map of filenames/contents of debug info.
- * @return URL of visible paste
- */
- private static String postToService(PasteServiceType type, boolean isPrivate, String pasteData,
- Map pasteFiles) {
- PasteService ps = PasteServiceFactory.getService(type, isPrivate);
- try {
- String result;
- if (ps.supportsMultiFile()) {
- result = ps.postData(ps.encodeData(pasteFiles), ps.getPostURL());
- } else {
- result = ps.postData(ps.encodeData(pasteData), ps.getPostURL());
- }
- return SHORTENER.shorten(result);
- } catch (PasteFailedException e) {
- System.out.print(e);
- return "Error posting to service";
- }
- }
-
- private String getPluginList() {
- return StringUtils.join(plugin.getServer().getPluginManager().getPlugins(), ", ");
- }
-}
diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/package-info.java b/src/main/java/com/onarandombox/MultiverseCore/commands/package-info.java
deleted file mode 100644
index 53d7f9b3..00000000
--- a/src/main/java/com/onarandombox/MultiverseCore/commands/package-info.java
+++ /dev/null
@@ -1,4 +0,0 @@
-/**
- * This package contains all Commands.
- */
-package com.onarandombox.MultiverseCore.commands;
diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/AnchorCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commandsold/AnchorCommand.java
similarity index 99%
rename from src/main/java/com/onarandombox/MultiverseCore/commands/AnchorCommand.java
rename to src/main/java/com/onarandombox/MultiverseCore/commandsold/AnchorCommand.java
index 55d0b2cf..5009c270 100644
--- a/src/main/java/com/onarandombox/MultiverseCore/commands/AnchorCommand.java
+++ b/src/main/java/com/onarandombox/MultiverseCore/commandsold/AnchorCommand.java
@@ -5,7 +5,7 @@
* with this project. *
******************************************************************************/
-package com.onarandombox.MultiverseCore.commands;
+package com.onarandombox.MultiverseCore.commandsold;
import com.onarandombox.MultiverseCore.MultiverseCore;
import org.bukkit.ChatColor;
diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/CheckCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commandsold/CheckCommand.java
similarity index 94%
rename from src/main/java/com/onarandombox/MultiverseCore/commands/CheckCommand.java
rename to src/main/java/com/onarandombox/MultiverseCore/commandsold/CheckCommand.java
index 474308c6..519dfa21 100644
--- a/src/main/java/com/onarandombox/MultiverseCore/commands/CheckCommand.java
+++ b/src/main/java/com/onarandombox/MultiverseCore/commandsold/CheckCommand.java
@@ -5,12 +5,13 @@
* with this project. *
******************************************************************************/
-package com.onarandombox.MultiverseCore.commands;
+package com.onarandombox.MultiverseCore.commandsold;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.api.MVDestination;
import com.onarandombox.MultiverseCore.destination.InvalidDestination;
import com.onarandombox.MultiverseCore.utils.MVPermissions;
+import com.onarandombox.MultiverseCore.utils.PlayerFinder;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@@ -37,7 +38,7 @@ public class CheckCommand extends MultiverseCommand {
@Override
public void runCommand(CommandSender sender, List args) {
- Player p = this.plugin.getServer().getPlayer(args.get(0));
+ Player p = PlayerFinder.get(args.get(0), sender);
if (p == null) {
sender.sendMessage("Could not find player " + ChatColor.GREEN + args.get(0));
sender.sendMessage("Are they online?");
diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/CloneCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commandsold/CloneCommand.java
similarity index 97%
rename from src/main/java/com/onarandombox/MultiverseCore/commands/CloneCommand.java
rename to src/main/java/com/onarandombox/MultiverseCore/commandsold/CloneCommand.java
index 95a0bf14..7f2a2efe 100644
--- a/src/main/java/com/onarandombox/MultiverseCore/commands/CloneCommand.java
+++ b/src/main/java/com/onarandombox/MultiverseCore/commandsold/CloneCommand.java
@@ -5,7 +5,7 @@
* with this project. *
******************************************************************************/
-package com.onarandombox.MultiverseCore.commands;
+package com.onarandombox.MultiverseCore.commandsold;
import java.util.List;
diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/ConfigCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commandsold/ConfigCommand.java
similarity index 98%
rename from src/main/java/com/onarandombox/MultiverseCore/commands/ConfigCommand.java
rename to src/main/java/com/onarandombox/MultiverseCore/commandsold/ConfigCommand.java
index 55424a94..e454dd95 100644
--- a/src/main/java/com/onarandombox/MultiverseCore/commands/ConfigCommand.java
+++ b/src/main/java/com/onarandombox/MultiverseCore/commandsold/ConfigCommand.java
@@ -5,7 +5,7 @@
* with this project. *
******************************************************************************/
-package com.onarandombox.MultiverseCore.commands;
+package com.onarandombox.MultiverseCore.commandsold;
import com.onarandombox.MultiverseCore.MultiverseCore;
import org.bukkit.ChatColor;
diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/ConfirmCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commandsold/ConfirmCommand.java
similarity index 91%
rename from src/main/java/com/onarandombox/MultiverseCore/commands/ConfirmCommand.java
rename to src/main/java/com/onarandombox/MultiverseCore/commandsold/ConfirmCommand.java
index 2a68f353..c216ca37 100644
--- a/src/main/java/com/onarandombox/MultiverseCore/commands/ConfirmCommand.java
+++ b/src/main/java/com/onarandombox/MultiverseCore/commandsold/ConfirmCommand.java
@@ -5,7 +5,7 @@
* with this project. *
******************************************************************************/
-package com.onarandombox.MultiverseCore.commands;
+package com.onarandombox.MultiverseCore.commandsold;
import com.onarandombox.MultiverseCore.MultiverseCore;
import org.bukkit.command.CommandSender;
@@ -33,7 +33,7 @@ public class ConfirmCommand extends MultiverseCommand {
@Override
public void runCommand(CommandSender sender, List args) {
- this.plugin.getCommandHandler().confirmQueuedCommand(sender);
+ this.plugin.getCommandQueueManager().runQueuedCommand(sender);
}
}
diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/CoordCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commandsold/CoordCommand.java
similarity index 97%
rename from src/main/java/com/onarandombox/MultiverseCore/commands/CoordCommand.java
rename to src/main/java/com/onarandombox/MultiverseCore/commandsold/CoordCommand.java
index 485cc370..b7ce8553 100644
--- a/src/main/java/com/onarandombox/MultiverseCore/commands/CoordCommand.java
+++ b/src/main/java/com/onarandombox/MultiverseCore/commandsold/CoordCommand.java
@@ -5,13 +5,12 @@
* with this project. *
******************************************************************************/
-package com.onarandombox.MultiverseCore.commands;
+package com.onarandombox.MultiverseCore.commandsold;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.api.MVWorldManager;
import com.onarandombox.MultiverseCore.api.MultiverseWorld;
import org.bukkit.ChatColor;
-import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/CreateCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commandsold/CreateCommand.java
similarity index 91%
rename from src/main/java/com/onarandombox/MultiverseCore/commands/CreateCommand.java
rename to src/main/java/com/onarandombox/MultiverseCore/commandsold/CreateCommand.java
index 87bdacab..750c9e62 100644
--- a/src/main/java/com/onarandombox/MultiverseCore/commands/CreateCommand.java
+++ b/src/main/java/com/onarandombox/MultiverseCore/commandsold/CreateCommand.java
@@ -5,7 +5,7 @@
* with this project. *
******************************************************************************/
-package com.onarandombox.MultiverseCore.commands;
+package com.onarandombox.MultiverseCore.commandsold;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.api.MVWorldManager;
@@ -46,10 +46,15 @@ public class CreateCommand extends MultiverseCommand {
this.addCommandExample("/mv create " + ChatColor.GOLD + "moonworld" + ChatColor.GREEN + " normal" + ChatColor.DARK_AQUA + " -g BukkitFullOfMoon");
this.worldManager = this.plugin.getMVWorldManager();
}
-
+
+ private String trimWorldName(String userInput) {
+ // Removes relative paths.
+ return userInput.replaceAll("^[./\\\\]+", "");
+ }
+
@Override
public void runCommand(CommandSender sender, List args) {
- String worldName = args.get(0);
+ String worldName = trimWorldName(args.get(0));
File worldFile = new File(this.plugin.getServer().getWorldContainer(), worldName);
String env = args.get(1);
String seed = CommandHandler.getFlag("-s", args);
@@ -66,7 +71,13 @@ public class CreateCommand extends MultiverseCommand {
useSpawnAdjust = false;
}
}
-
+
+ // Make sure the world name doesn't contain the words 'plugins' and '.dat'
+ if(worldName.contains("plugins")||worldName.contains(".dat")){
+ sender.sendMessage(ChatColor.RED + "Multiverse cannot create a world that contains 'plugins' or '.dat'");
+ return;
+ }
+
if (this.worldManager.isMVWorld(worldName)) {
sender.sendMessage(ChatColor.RED + "Multiverse cannot create " + ChatColor.GOLD + ChatColor.UNDERLINE
+ "another" + ChatColor.RESET + ChatColor.RED + " world named " + worldName);
@@ -117,4 +128,4 @@ public class CreateCommand extends MultiverseCommand {
Command.broadcastCommandMessage(sender, "FAILED.");
}
}
-}
+}
\ No newline at end of file
diff --git a/src/main/java/com/onarandombox/MultiverseCore/commandsold/DebugCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commandsold/DebugCommand.java
new file mode 100644
index 00000000..81a7f74f
--- /dev/null
+++ b/src/main/java/com/onarandombox/MultiverseCore/commandsold/DebugCommand.java
@@ -0,0 +1,66 @@
+/******************************************************************************
+ * Multiverse 2 Copyright (c) the Multiverse Team 2011. *
+ * Multiverse 2 is licensed under the BSD License. *
+ * For more information please check the README.md file included *
+ * with this project. *
+ ******************************************************************************/
+
+package com.onarandombox.MultiverseCore.commandsold;
+
+import com.dumptruckman.minecraft.util.Logging;
+import com.onarandombox.MultiverseCore.MultiverseCore;
+import org.bukkit.ChatColor;
+import org.bukkit.command.CommandSender;
+import org.bukkit.permissions.PermissionDefault;
+
+import java.util.List;
+
+/**
+ * Enables debug-information.
+ */
+public class DebugCommand extends MultiverseCommand {
+
+ public DebugCommand(MultiverseCore plugin) {
+ super(plugin);
+ this.setName("Turn Debug on/off?");
+ this.setCommandUsage("/mv debug" + ChatColor.GOLD + " [1|2|3|off|silent]");
+ this.setArgRange(0, 1);
+ 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);
+ }
+
+ @Override
+ public void runCommand(CommandSender sender, List args) {
+ if (args.size() == 1) {
+ if (args.get(0).equalsIgnoreCase("off")) {
+ plugin.getMVConfig().setGlobalDebug(0);
+ } else {
+ try {
+ int debugLevel = Integer.parseInt(args.get(0));
+ if (debugLevel > 3 || debugLevel < 0) {
+ throw new NumberFormatException();
+ }
+ plugin.getMVConfig().setGlobalDebug(debugLevel);
+ } catch (NumberFormatException e) {
+ sender.sendMessage(ChatColor.RED + "Error" + ChatColor.WHITE
+ + " setting debug level. Please use a number 0-3 " + ChatColor.AQUA + "(3 being many many messages!)");
+ }
+ }
+ plugin.saveMVConfigs();
+ }
+ this.displayDebugMode(sender);
+ }
+
+ private void displayDebugMode(CommandSender sender) {
+ final int debugLevel = plugin.getMVConfig().getGlobalDebug();
+ if (debugLevel == 0) {
+ sender.sendMessage("Multiverse Debug mode is " + ChatColor.RED + "OFF");
+ } else {
+ sender.sendMessage("Multiverse Debug mode is " + ChatColor.GREEN + debugLevel);
+ Logging.fine("Multiverse Debug ENABLED");
+ }
+ }
+}
diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/DeleteCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commandsold/DeleteCommand.java
similarity index 56%
rename from src/main/java/com/onarandombox/MultiverseCore/commands/DeleteCommand.java
rename to src/main/java/com/onarandombox/MultiverseCore/commandsold/DeleteCommand.java
index 2e7b3c8b..85157d16 100644
--- a/src/main/java/com/onarandombox/MultiverseCore/commands/DeleteCommand.java
+++ b/src/main/java/com/onarandombox/MultiverseCore/commandsold/DeleteCommand.java
@@ -5,14 +5,15 @@
* with this project. *
******************************************************************************/
-package com.onarandombox.MultiverseCore.commands;
+package com.onarandombox.MultiverseCore.commandsold;
import com.onarandombox.MultiverseCore.MultiverseCore;
+import com.onarandombox.MultiverseCore.commandtools.queue.QueuedCommand;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.permissions.PermissionDefault;
+import org.jetbrains.annotations.NotNull;
-import java.util.ArrayList;
import java.util.List;
/**
@@ -35,11 +36,24 @@ public class DeleteCommand extends MultiverseCommand {
public void runCommand(CommandSender sender, List args) {
String worldName = args.get(0);
- Class>[] paramTypes = {String.class};
- List