Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
148187025a | ||
|
|
115b0dc078 | ||
|
|
78bf6ba3bf | ||
|
|
e31c391af4 | ||
|
|
6ed4be9a64 | ||
|
|
d626e7e4b1 | ||
|
|
e7dd4fee51 | ||
|
|
146075de69 | ||
|
|
9fce6c54f6 | ||
|
|
f189eb3b7e | ||
|
|
2d4fe301cf | ||
|
|
e5fe1fe565 | ||
|
|
83010f1a28 | ||
|
|
864e50e38c | ||
|
|
0a99258f3e | ||
|
|
b345baf20e | ||
|
|
d532052c7b |
No files matched your search
@@ -2,7 +2,7 @@
|
||||
name: ❓ Help!
|
||||
about: Encountered a problem with Multiverse-Core? Not sure how to fix it?
|
||||
title: ''
|
||||
labels: 'type: Assistance'
|
||||
labels: 'Assistance'
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
name: 🐛 Report a Bug
|
||||
about: Report a Multiverse-Core bug. Only use this if you're 100% sure it's something wrong with Multiverse-Core - otherwise, try "Help!".
|
||||
title: ''
|
||||
labels: 'type: Bug'
|
||||
labels: 'Bug'
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
name: 💡 Request a Feature
|
||||
about: Suggest a feature you want to see in Multiverse-Core!
|
||||
title: ''
|
||||
labels: 'type: Suggestion'
|
||||
labels: 'Suggestion'
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.onarandombox.multiversecore</groupId>
|
||||
<artifactId>Multiverse-Core</artifactId>
|
||||
<version>4.2.0</version>
|
||||
<version>4.2.2</version>
|
||||
<name>Multiverse-Core</name>
|
||||
<description>World Management Plugin</description>
|
||||
<properties>
|
||||
|
||||
@@ -93,6 +93,7 @@ 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.TestingMode;
|
||||
import com.onarandombox.MultiverseCore.utils.metrics.MetricsConfigurator;
|
||||
import com.onarandombox.MultiverseCore.utils.SimpleBlockSafety;
|
||||
import com.onarandombox.MultiverseCore.utils.SimpleLocationManipulation;
|
||||
@@ -343,7 +344,9 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
|
||||
}
|
||||
|
||||
private void setupMetrics() {
|
||||
MetricsConfigurator.configureMetrics(this);
|
||||
if (TestingMode.isDisabled()) {
|
||||
MetricsConfigurator.configureMetrics(this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -380,7 +383,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.");
|
||||
log(Level.INFO, ChatColor.GREEN + "We are aware of the warning about the deprecated event. There is no alternative that allows us to do what we need to do and performance impact is negligible. It is safe to ignore.");
|
||||
pm.registerEvents(this.worldListener, this);
|
||||
pm.registerEvents(new MVMapListener(this), this);
|
||||
}
|
||||
|
||||
@@ -26,12 +26,7 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.permissions.PermissionDefault;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -55,58 +50,58 @@ public class VersionCommand extends MultiverseCommand {
|
||||
}
|
||||
|
||||
private String getLegacyString() {
|
||||
return "[Multiverse-Core] Multiverse-Core Version: " + this.plugin.getDescription().getVersion() + System.lineSeparator()
|
||||
+ "[Multiverse-Core] Bukkit Version: " + this.plugin.getServer().getVersion() + System.lineSeparator()
|
||||
+ "[Multiverse-Core] Loaded Worlds: " + this.plugin.getMVWorldManager().getMVWorlds() + System.lineSeparator()
|
||||
+ "[Multiverse-Core] Multiverse Plugins Loaded: " + this.plugin.getPluginCount() + System.lineSeparator()
|
||||
+"[Multiverse-Core] Economy being used: " + plugin.getEconomist().getEconomyName() + System.lineSeparator()
|
||||
+ "[Multiverse-Core] Permissions Plugin: " + this.plugin.getMVPerms().getType() + System.lineSeparator()
|
||||
+ "[Multiverse-Core] Dumping Config Values: (version " + this.plugin.getMVConfig().getVersion() + ")" + System.lineSeparator()
|
||||
+ "[Multiverse-Core] enforceaccess: " + plugin.getMVConfig().getEnforceAccess() + System.lineSeparator()
|
||||
+ "[Multiverse-Core] prefixchat: " + plugin.getMVConfig().getPrefixChat() + System.lineSeparator()
|
||||
+ "[Multiverse-Core] prefixchatformat: " + plugin.getMVConfig().getPrefixChatFormat() + System.lineSeparator()
|
||||
+ "[Multiverse-Core] useasyncchat: " + plugin.getMVConfig().getUseAsyncChat() + System.lineSeparator()
|
||||
+ "[Multiverse-Core] teleportintercept: " + plugin.getMVConfig().getTeleportIntercept() + System.lineSeparator()
|
||||
+ "[Multiverse-Core] firstspawnoverride: " + plugin.getMVConfig().getFirstSpawnOverride() + System.lineSeparator()
|
||||
+ "[Multiverse-Core] displaypermerrors: " + plugin.getMVConfig().getDisplayPermErrors() + System.lineSeparator()
|
||||
+ "[Multiverse-Core] globaldebug: " + plugin.getMVConfig().getGlobalDebug() + System.lineSeparator()
|
||||
+ "[Multiverse-Core] silentstart: " + plugin.getMVConfig().getSilentStart() + System.lineSeparator()
|
||||
+ "[Multiverse-Core] messagecooldown: " + plugin.getMessaging().getCooldown() + System.lineSeparator()
|
||||
+ "[Multiverse-Core] version: " + plugin.getMVConfig().getVersion() + System.lineSeparator()
|
||||
+ "[Multiverse-Core] firstspawnworld: " + plugin.getMVConfig().getFirstSpawnWorld() + System.lineSeparator()
|
||||
+ "[Multiverse-Core] teleportcooldown: " + plugin.getMVConfig().getTeleportCooldown() + System.lineSeparator()
|
||||
+ "[Multiverse-Core] defaultportalsearch: " + plugin.getMVConfig().isUsingDefaultPortalSearch() + System.lineSeparator()
|
||||
+ "[Multiverse-Core] portalsearchradius: " + plugin.getMVConfig().getPortalSearchRadius() + System.lineSeparator()
|
||||
+ "[Multiverse-Core] autopurge: " + plugin.getMVConfig().isAutoPurgeEnabled() + System.lineSeparator()
|
||||
+ "[Multiverse-Core] Special Code: FRN002" + System.lineSeparator();
|
||||
return "[Multiverse-Core] Multiverse-Core Version: " + this.plugin.getDescription().getVersion() + '\n'
|
||||
+ "[Multiverse-Core] Bukkit Version: " + this.plugin.getServer().getVersion() + '\n'
|
||||
+ "[Multiverse-Core] Loaded Worlds: " + this.plugin.getMVWorldManager().getMVWorlds() + '\n'
|
||||
+ "[Multiverse-Core] Multiverse Plugins Loaded: " + this.plugin.getPluginCount() + '\n'
|
||||
+"[Multiverse-Core] Economy being used: " + plugin.getEconomist().getEconomyName() + '\n'
|
||||
+ "[Multiverse-Core] Permissions Plugin: " + this.plugin.getMVPerms().getType() + '\n'
|
||||
+ "[Multiverse-Core] Dumping Config Values: (version " + this.plugin.getMVConfig().getVersion() + ")" + '\n'
|
||||
+ "[Multiverse-Core] enforceaccess: " + plugin.getMVConfig().getEnforceAccess() + '\n'
|
||||
+ "[Multiverse-Core] prefixchat: " + plugin.getMVConfig().getPrefixChat() + '\n'
|
||||
+ "[Multiverse-Core] prefixchatformat: " + plugin.getMVConfig().getPrefixChatFormat() + '\n'
|
||||
+ "[Multiverse-Core] useasyncchat: " + plugin.getMVConfig().getUseAsyncChat() + '\n'
|
||||
+ "[Multiverse-Core] teleportintercept: " + plugin.getMVConfig().getTeleportIntercept() + '\n'
|
||||
+ "[Multiverse-Core] firstspawnoverride: " + plugin.getMVConfig().getFirstSpawnOverride() + '\n'
|
||||
+ "[Multiverse-Core] displaypermerrors: " + plugin.getMVConfig().getDisplayPermErrors() + '\n'
|
||||
+ "[Multiverse-Core] globaldebug: " + plugin.getMVConfig().getGlobalDebug() + '\n'
|
||||
+ "[Multiverse-Core] silentstart: " + plugin.getMVConfig().getSilentStart() + '\n'
|
||||
+ "[Multiverse-Core] messagecooldown: " + plugin.getMessaging().getCooldown() + '\n'
|
||||
+ "[Multiverse-Core] version: " + plugin.getMVConfig().getVersion() + '\n'
|
||||
+ "[Multiverse-Core] firstspawnworld: " + plugin.getMVConfig().getFirstSpawnWorld() + '\n'
|
||||
+ "[Multiverse-Core] teleportcooldown: " + plugin.getMVConfig().getTeleportCooldown() + '\n'
|
||||
+ "[Multiverse-Core] defaultportalsearch: " + plugin.getMVConfig().isUsingDefaultPortalSearch() + '\n'
|
||||
+ "[Multiverse-Core] portalsearchradius: " + plugin.getMVConfig().getPortalSearchRadius() + '\n'
|
||||
+ "[Multiverse-Core] autopurge: " + plugin.getMVConfig().isAutoPurgeEnabled() + '\n'
|
||||
+ "[Multiverse-Core] Special Code: FRN002" + '\n';
|
||||
}
|
||||
|
||||
private String getMarkdownString() {
|
||||
return "# Multiverse-Core" + System.lineSeparator()
|
||||
+ "## Overview" + System.lineSeparator()
|
||||
+ "| Name | Value |" + System.lineSeparator()
|
||||
+ "| --- | --- |" + System.lineSeparator()
|
||||
+ "| Multiverse-Core Version | `" + this.plugin.getDescription().getVersion() + "` |" + System.lineSeparator()
|
||||
+ "| Bukkit Version | `" + this.plugin.getServer().getVersion() + "` |" + System.lineSeparator()
|
||||
+ "| Loaded Worlds | `" + this.plugin.getMVWorldManager().getMVWorlds() + "` |" + System.lineSeparator()
|
||||
+ "| Multiverse Plugins Loaded | `" + this.plugin.getPluginCount() + "` |" + System.lineSeparator()
|
||||
+ "| Economy being used | `" + plugin.getEconomist().getEconomyName() + "` |" + System.lineSeparator()
|
||||
+ "| Permissions Plugin | `" + this.plugin.getMVPerms().getType() + "` |" + System.lineSeparator()
|
||||
+ "## Parsed Config" + System.lineSeparator()
|
||||
+ "These are what Multiverse thought the in-memory values of the config were." + System.lineSeparator() + System.lineSeparator()
|
||||
+ "| Config Key | Value |" + System.lineSeparator()
|
||||
+ "| --- | --- |" + System.lineSeparator()
|
||||
+ "| version | `" + this.plugin.getMVConfig().getVersion() + "` |" + System.lineSeparator()
|
||||
+ "| messagecooldown | `" + plugin.getMessaging().getCooldown() + "` |" + System.lineSeparator()
|
||||
+ "| teleportcooldown | `" + plugin.getMVConfig().getTeleportCooldown() + "` |" + System.lineSeparator()
|
||||
+ "| worldnameprefix | `" + plugin.getMVConfig().getPrefixChat() + "` |" + System.lineSeparator()
|
||||
+ "| worldnameprefixFormat | `" + plugin.getMVConfig().getPrefixChatFormat() + "` |" + System.lineSeparator()
|
||||
+ "| enforceaccess | `" + plugin.getMVConfig().getEnforceAccess() + "` |" + System.lineSeparator()
|
||||
+ "| displaypermerrors | `" + plugin.getMVConfig().getDisplayPermErrors() + "` |" + System.lineSeparator()
|
||||
+ "| teleportintercept | `" + plugin.getMVConfig().getTeleportIntercept() + "` |" + System.lineSeparator()
|
||||
+ "| firstspawnoverride | `" + plugin.getMVConfig().getFirstSpawnOverride() + "` |" + System.lineSeparator()
|
||||
+ "| firstspawnworld | `" + plugin.getMVConfig().getFirstSpawnWorld() + "` |" + System.lineSeparator()
|
||||
+ "| debug | `" + plugin.getMVConfig().getGlobalDebug() + "` |" + System.lineSeparator();
|
||||
return "# Multiverse-Core" + '\n'
|
||||
+ "## Overview" + '\n'
|
||||
+ "| Name | Value |" + '\n'
|
||||
+ "| --- | --- |" + '\n'
|
||||
+ "| Multiverse-Core Version | `" + this.plugin.getDescription().getVersion() + "` |" + '\n'
|
||||
+ "| Bukkit Version | `" + this.plugin.getServer().getVersion() + "` |" + '\n'
|
||||
+ "| Loaded Worlds | `" + this.plugin.getMVWorldManager().getMVWorlds() + "` |" + '\n'
|
||||
+ "| Multiverse Plugins Loaded | `" + this.plugin.getPluginCount() + "` |" + '\n'
|
||||
+ "| Economy being used | `" + plugin.getEconomist().getEconomyName() + "` |" + '\n'
|
||||
+ "| Permissions Plugin | `" + this.plugin.getMVPerms().getType() + "` |" + '\n'
|
||||
+ "## Parsed Config" + '\n'
|
||||
+ "These are what Multiverse thought the in-memory values of the config were." + "\n\n"
|
||||
+ "| Config Key | Value |" + '\n'
|
||||
+ "| --- | --- |" + '\n'
|
||||
+ "| version | `" + this.plugin.getMVConfig().getVersion() + "` |" + '\n'
|
||||
+ "| messagecooldown | `" + plugin.getMessaging().getCooldown() + "` |" + '\n'
|
||||
+ "| teleportcooldown | `" + plugin.getMVConfig().getTeleportCooldown() + "` |" + '\n'
|
||||
+ "| worldnameprefix | `" + plugin.getMVConfig().getPrefixChat() + "` |" + '\n'
|
||||
+ "| worldnameprefixFormat | `" + plugin.getMVConfig().getPrefixChatFormat() + "` |" + '\n'
|
||||
+ "| enforceaccess | `" + plugin.getMVConfig().getEnforceAccess() + "` |" + '\n'
|
||||
+ "| displaypermerrors | `" + plugin.getMVConfig().getDisplayPermErrors() + "` |" + '\n'
|
||||
+ "| teleportintercept | `" + plugin.getMVConfig().getTeleportIntercept() + "` |" + '\n'
|
||||
+ "| firstspawnoverride | `" + plugin.getMVConfig().getFirstSpawnOverride() + "` |" + '\n'
|
||||
+ "| firstspawnworld | `" + plugin.getMVConfig().getFirstSpawnWorld() + "` |" + '\n'
|
||||
+ "| debug | `" + plugin.getMVConfig().getGlobalDebug() + "` |" + '\n';
|
||||
}
|
||||
|
||||
private void addVersionInfoToEvent(MVVersionEvent event) {
|
||||
@@ -114,15 +109,16 @@ public class VersionCommand extends MultiverseCommand {
|
||||
event.appendVersionInfo(this.getLegacyString());
|
||||
|
||||
// add the legacy file, but as markdown so it's readable
|
||||
event.putDetailedVersionInfo("version.md", this.getMarkdownString());
|
||||
// TODO Readd this in 5.0.0
|
||||
// event.putDetailedVersionInfo("version.md", this.getMarkdownString());
|
||||
|
||||
// add config.yml
|
||||
File configFile = new File(this.plugin.getDataFolder(), "config.yml");
|
||||
event.putDetailedVersionInfo("version.md", configFile);
|
||||
event.putDetailedVersionInfo("multiverse-core/config.yml", configFile);
|
||||
|
||||
// add worlds.yml
|
||||
File worldsFile = new File(this.plugin.getDataFolder(), "worlds.yml");
|
||||
event.putDetailedVersionInfo("version.md", worldsFile);
|
||||
event.putDetailedVersionInfo("multiverse-core/worlds.yml", worldsFile);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -138,18 +134,20 @@ public class VersionCommand extends MultiverseCommand {
|
||||
this.plugin.getServer().getPluginManager().callEvent(versionEvent);
|
||||
|
||||
if (CommandHandler.hasFlag("--include-plugin-list", args)) {
|
||||
versionEvent.appendVersionInfo(System.lineSeparator() + "Plugins: " + getPluginList());
|
||||
versionEvent.appendVersionInfo('\n' + "Plugins: " + getPluginList());
|
||||
versionEvent.putDetailedVersionInfo("plugins.txt", "Plugins: " + getPluginList());
|
||||
}
|
||||
|
||||
final String versionInfo = versionEvent.getVersionInfo();
|
||||
versionEvent.putDetailedVersionInfo("version.txt", versionInfo);
|
||||
|
||||
final Map<String, String> files = versionEvent.getDetailedVersionInfo();
|
||||
|
||||
// log to console
|
||||
String[] lines = versionInfo.split(System.lineSeparator());
|
||||
String[] lines = versionInfo.split("\\r?\\n");
|
||||
for (String line : lines) {
|
||||
if (!line.isEmpty()) {
|
||||
Logging.info(line);
|
||||
this.plugin.getServer().getLogger().info(line);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.onarandombox.MultiverseCore.utils;
|
||||
|
||||
/**
|
||||
* A utility class that enables automated tests to flag Multiverse for testing. This allows Multiverse to not perform
|
||||
* certain behaviors such as enabled stats uploads.
|
||||
*/
|
||||
public class TestingMode {
|
||||
|
||||
private static boolean enabled = false;
|
||||
|
||||
public static void enable() {
|
||||
enabled = true;
|
||||
}
|
||||
|
||||
public static boolean isDisabled() {
|
||||
return !enabled;
|
||||
}
|
||||
}
|
||||
@@ -140,7 +140,7 @@ public class WorldManager implements MVWorldManager {
|
||||
|
||||
// Make sure the new world doesn't exist outside of multiverse.
|
||||
if (newWorldFile.exists()) {
|
||||
Logging.warning("File for new world '%s' already exists", newName);
|
||||
Logging.warning("Folder for new world '%s' already exists", newName);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -162,14 +162,8 @@ public class WorldManager implements MVWorldManager {
|
||||
}
|
||||
|
||||
// Grab a bit of metadata from the old world.
|
||||
MVWorld oldWorld = (MVWorld) getMVWorld(oldName);
|
||||
Environment environment = oldWorld.getEnvironment();
|
||||
String seedString = oldWorld.getSeed() + "";
|
||||
WorldType worldType = oldWorld.getWorldType();
|
||||
Boolean generateStructures = oldWorld.getCBWorld().canGenerateStructures();
|
||||
String generator = oldWorld.getGenerator();
|
||||
boolean useSpawnAdjust = oldWorld.getAdjustSpawn();
|
||||
|
||||
MultiverseWorld oldWorld = getMVWorld(oldName);
|
||||
|
||||
// Don't need the loaded world anymore.
|
||||
if (wasJustLoaded) {
|
||||
this.unloadWorld(oldName, true);
|
||||
@@ -525,6 +519,13 @@ public class WorldManager implements MVWorldManager {
|
||||
*/
|
||||
@Override
|
||||
public boolean deleteWorld(String name, boolean removeFromConfig, boolean deleteWorldFolder) {
|
||||
if (this.hasUnloadedWorld(name, false)) {
|
||||
// Attempt to load if unloaded so we can actually delete the world
|
||||
if (!this.doLoad(name)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
World world = this.plugin.getServer().getWorld(name);
|
||||
if (world == null) {
|
||||
// We can only delete loaded worlds
|
||||
@@ -937,6 +938,9 @@ public class WorldManager implements MVWorldManager {
|
||||
return this.configWorlds;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public boolean hasUnloadedWorld(String name, boolean includeLoaded) {
|
||||
if (getMVWorld(name) != null) {
|
||||
|
||||
@@ -64,6 +64,7 @@ public class TestInstanceCreator {
|
||||
public static final File worldsDirectory = new File("bin/test/server");
|
||||
|
||||
public boolean setUp() {
|
||||
TestingMode.enable();
|
||||
try {
|
||||
pluginDirectory.mkdirs();
|
||||
assertTrue(pluginDirectory.exists());
|
||||
|
||||
Reference in new issue
Block a user