mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-25 02:04:44 +02:00
Merge branch 'v5' into v6
# Conflicts: # Bukkit/build.gradle # Bukkit/pom.xml # Bukkit/src/main/java/com/plotsquared/bukkit/BukkitPlatform.java # Bukkit/src/main/java/com/plotsquared/bukkit/listener/PlayerEventListener.java # Bukkit/src/main/java/com/plotsquared/bukkit/uuid/BungeePermsUUIDService.java # Core/src/main/java/com/plotsquared/core/PlotPlatform.java # Core/src/main/java/com/plotsquared/core/command/DebugPaste.java # Core/src/main/java/com/plotsquared/core/command/Grant.java # build.gradle
This commit is contained in:
@ -142,8 +142,6 @@ public interface PlotPlatform<P> extends LocaleHolder {
|
||||
return getInjector().getInstance(Key.get(IndependentPlotGenerator.class, DefaultGenerator.class));
|
||||
}
|
||||
|
||||
List<Map.Entry<Map.Entry<String, String>, Boolean>> getPluginIds();
|
||||
|
||||
/**
|
||||
* Get the backup manager instance
|
||||
*
|
||||
@ -256,6 +254,8 @@ public interface PlotPlatform<P> extends LocaleHolder {
|
||||
*/
|
||||
@Nonnull Audience getConsoleAudience();
|
||||
|
||||
String getPluginList();
|
||||
|
||||
/**
|
||||
* Load the caption maps
|
||||
*/
|
||||
|
@ -103,28 +103,21 @@ public class DebugPaste extends SubCommand {
|
||||
.append("\n");
|
||||
b.append("online_mode: ").append(!Settings.UUID.OFFLINE).append(';')
|
||||
.append(!Settings.UUID.OFFLINE).append('\n');
|
||||
b.append("Plugins:");
|
||||
for (Map.Entry<Map.Entry<String, String>, Boolean> pluginInfo : PlotSquared
|
||||
.platform().getPluginIds()) {
|
||||
Map.Entry<String, String> nameVersion = pluginInfo.getKey();
|
||||
String name = nameVersion.getKey();
|
||||
String version = nameVersion.getValue();
|
||||
boolean enabled = pluginInfo.getValue();
|
||||
b.append("\n ").append(name).append(":\n ").append("version: '")
|
||||
.append(version).append('\'').append("\n enabled: ").append(enabled);
|
||||
}
|
||||
b.append(PlotSquared.platform().getPluginList());
|
||||
b.append("\n\n# YAY! Now, let's see what we can find in your JVM\n");
|
||||
Runtime runtime = Runtime.getRuntime();
|
||||
RuntimeMXBean rb = ManagementFactory.getRuntimeMXBean();
|
||||
b.append("Uptime: ").append(
|
||||
TimeUnit.MINUTES.convert(rb.getUptime(), TimeUnit.MILLISECONDS) + " minutes")
|
||||
b.append("Uptime: ")
|
||||
.append(TimeUnit.MINUTES.convert(rb.getUptime(), TimeUnit.MILLISECONDS))
|
||||
.append(" minutes")
|
||||
.append('\n');
|
||||
b.append("JVM Flags: ").append(rb.getInputArguments()).append('\n');
|
||||
b.append("Free Memory: ").append(runtime.freeMemory() / 1024 / 1024 + " MB")
|
||||
b.append("Free Memory: ").append(runtime.freeMemory() / 1024 / 1024).append(" MB")
|
||||
.append('\n');
|
||||
b.append("Max Memory: ").append(runtime.maxMemory() / 1024 / 1024 + " MB")
|
||||
b.append("Max Memory: ").append(runtime.maxMemory() / 1024 / 1024).append(" MB")
|
||||
.append('\n');
|
||||
b.append("Total Memory: ").append(runtime.totalMemory() / 1024 / 1024).append(" MB")
|
||||
.append('\n');
|
||||
b.append("Total Memory: ").append(runtime.totalMemory() / 1024 / 1024 + " MB").append('\n');
|
||||
b.append("Available Processors: ").append(runtime.availableProcessors()).append('\n');
|
||||
b.append("Java Name: ").append(rb.getVmName()).append('\n');
|
||||
b.append("Java Version: '").append(System.getProperty("java.version"))
|
||||
|
@ -39,11 +39,11 @@ import com.plotsquared.core.util.task.RunnableVal;
|
||||
import com.plotsquared.core.util.task.RunnableVal2;
|
||||
import com.plotsquared.core.util.task.RunnableVal3;
|
||||
import net.kyori.adventure.text.minimessage.Template;
|
||||
import com.plotsquared.core.uuid.UUIDMapping;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
import java.util.stream.Collectors;
|
||||
@ -86,8 +86,8 @@ public class Grant extends Command {
|
||||
Template.of("value", String.valueOf(uuids))
|
||||
);
|
||||
} else {
|
||||
final UUID uuid = uuids.toArray(new UUID[0])[0];
|
||||
PlotPlayer<?> pp = PlotSquared.platform().getPlayerManager().getPlayerIfExists(uuid);
|
||||
final UUIDMapping uuid = uuids.toArray(new UUIDMapping[0])[0];
|
||||
PlotPlayer<?> pp = PlotSquared.platform().getPlayerManager().getPlayerIfExists(uuid.getUuid());
|
||||
if (pp != null) {
|
||||
try (final MetaDataAccess<Integer> access = pp.accessPersistentMetaData(
|
||||
PlayerMetaDataKeys.PERSISTENT_GRANTED_PLOTS)) {
|
||||
@ -99,7 +99,7 @@ public class Grant extends Command {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
DBFunc.getPersistentMeta(uuid, new RunnableVal<Map<String, byte[]>>() {
|
||||
DBFunc.getPersistentMeta(uuid.getUuid(), new RunnableVal<Map<String, byte[]>>() {
|
||||
@Override public void run(Map<String, byte[]> value) {
|
||||
final byte[] array = value.get("grantedPlots");
|
||||
if (arg0.equals("check")) { // check
|
||||
@ -123,7 +123,7 @@ public class Grant extends Command {
|
||||
boolean replace = array != null;
|
||||
String key = "grantedPlots";
|
||||
byte[] rawData = Ints.toByteArray(amount);
|
||||
DBFunc.addPersistentMeta(uuid, key, rawData, replace);
|
||||
DBFunc.addPersistentMeta(uuid.getUuid(), key, rawData, replace);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -267,8 +267,6 @@ public class Settings extends Config {
|
||||
public static boolean SERVICE_BUKKIT = true;
|
||||
@Comment("Whether the EssentialsX service is enabled")
|
||||
public static boolean SERVICE_ESSENTIALSX = true;
|
||||
@Comment("Whether the BungeePerms service is enabled")
|
||||
public static boolean SERVICE_BUNGEE_PERMS = true;
|
||||
}
|
||||
|
||||
|
||||
|
@ -269,7 +269,7 @@ public enum CommonSetupSteps implements SetupStep {
|
||||
|
||||
private static boolean isValidWorldName(String s) {
|
||||
return s.chars().allMatch((i) -> {
|
||||
return i == 95 || i == 45 || i >= 97 && i <= 122 || i >= 48 && i <= 57 || i == 46;
|
||||
return i == 95 || i == 45 || i >= 97 && i <= 122 || i >= 65 && i <= 90 || i >= 48 && i <= 57 || i == 46;
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user