mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-12 08:18:35 +00:00
Merge branch '1.15' of https://github.com/IntellectualSites/FastAsyncWorldEdit-1.13 into 1.15
This commit is contained in:
@ -7,12 +7,15 @@ import com.google.gson.JsonParser;
|
||||
import com.sk89q.worldedit.util.paste.Paster;
|
||||
|
||||
import java.io.*;
|
||||
import java.lang.management.ManagementFactory;
|
||||
import java.lang.management.RuntimeMXBean;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.nio.file.Files;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* Single class paster for the Incendo paste service
|
||||
@ -212,18 +215,19 @@ public final class IncendoPaster implements Paster {
|
||||
"# Welcome to this paste\n# It is meant to provide us at IntellectualSites with better information about your "
|
||||
+ "problem\n");
|
||||
b.append("\n# Server Information\n");
|
||||
b.append("server.platform: ").append(Fawe.imp().getPlatform()).append('\n');
|
||||
b.append(Fawe.imp().getDebugInfo()).append('\n');
|
||||
b.append("\n\n# YAY! Now, let's see what we can find in your JVM\n");
|
||||
b.append(Fawe.imp().getDebugInfo());
|
||||
b.append("\n# YAY! Now, let's see what we can find in your JVM\n");
|
||||
Runtime runtime = Runtime.getRuntime();
|
||||
b.append("memory.free: ").append(runtime.freeMemory()).append('\n');
|
||||
b.append("memory.max: ").append(runtime.maxMemory()).append('\n');
|
||||
b.append("java.specification.version: '").append(System.getProperty("java.specification.version")).append("'\n");
|
||||
b.append("java.vendor: '").append(System.getProperty("java.vendor")).append("'\n");
|
||||
b.append("java.version: '").append(System.getProperty("java.version")).append("'\n");
|
||||
b.append("os.arch: '").append(System.getProperty("os.arch")).append("'\n");
|
||||
b.append("os.name: '").append(System.getProperty("os.name")).append("'\n");
|
||||
b.append("os.version: '").append(System.getProperty("os.version")).append("'\n\n");
|
||||
RuntimeMXBean rb = ManagementFactory.getRuntimeMXBean();
|
||||
b.append("Uptime: ").append(TimeUnit.MINUTES.convert(rb.getUptime(), TimeUnit.MILLISECONDS) + " minutes").append('\n');
|
||||
b.append("Free Memory: ").append(runtime.freeMemory() / 1024 / 1024 + " MB").append('\n');
|
||||
b.append("Max Memory: ").append(runtime.maxMemory() / 1024 / 1024 + " MB").append('\n');
|
||||
b.append("Java Name: ").append(rb.getVmName()).append('\n');
|
||||
b.append("Java Version: '").append(System.getProperty("java.version")).append("'\n");
|
||||
b.append("Java Vendor: '").append(System.getProperty("java.vendor")).append("'\n");
|
||||
b.append("Operating System: '").append(System.getProperty("os.name")).append("'\n");
|
||||
b.append("OS Version: ").append(System.getProperty("os.version")).append('\n');
|
||||
b.append("OS Arch: ").append(System.getProperty("os.arch")).append('\n');
|
||||
b.append("# Okay :D Great. You are now ready to create your bug report!");
|
||||
b.append("\n# You can do so at https://github.com/IntellectualSites/FastAsyncWorldEdit-1.13/issues");
|
||||
b.append("\n# or via our Discord at https://discord.gg/ngZCzbU");
|
||||
|
@ -52,7 +52,7 @@ public class ReflectionUtils {
|
||||
|
||||
// 2. Copy it
|
||||
T[] previousValues = (T[]) valuesField.get(enumType);
|
||||
List values = new ArrayList(Arrays.asList(previousValues));
|
||||
List<T> values = new ArrayList<>(Arrays.asList(previousValues));
|
||||
|
||||
// 3. build new enum
|
||||
T newValue = (T) makeEnum(enumType, // The target enum class
|
||||
@ -176,7 +176,7 @@ public class ReflectionUtils {
|
||||
|
||||
public static <T> List<T> getList(List<T> list) {
|
||||
try {
|
||||
Class<? extends List> clazz = (Class<? extends List>) Class.forName("java.util.Collections$UnmodifiableList");
|
||||
Class<? extends List<T>> clazz = (Class<? extends List<T>>) Class.forName("java.util.Collections$UnmodifiableList");
|
||||
if (!clazz.isInstance(list)) return list;
|
||||
Field m = clazz.getDeclaredField("list");
|
||||
m.setAccessible(true);
|
||||
@ -566,10 +566,10 @@ public class ReflectionUtils {
|
||||
* @throws RuntimeException if constructor not found
|
||||
*/
|
||||
public RefConstructor findConstructor(int number) {
|
||||
final List<Constructor> constructors = new ArrayList<>();
|
||||
final List<Constructor<?>> constructors = new ArrayList<>();
|
||||
Collections.addAll(constructors, this.clazz.getConstructors());
|
||||
Collections.addAll(constructors, this.clazz.getDeclaredConstructors());
|
||||
for (Constructor m : constructors) {
|
||||
for (Constructor<?> m : constructors) {
|
||||
if (m.getParameterTypes().length == number) {
|
||||
return new RefConstructor(m);
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ public class ReflectionUtils9 {
|
||||
|
||||
// 2. Copy it
|
||||
T[] previousValues = (T[]) valuesField.get(enumType);
|
||||
List values = new ArrayList<>(Arrays.asList(previousValues));
|
||||
List<T> values = new ArrayList<>(Arrays.asList(previousValues));
|
||||
|
||||
// 3. build new enum
|
||||
T newValue = (T) makeEnum(enumType, // The target enum class
|
||||
|
@ -13,6 +13,7 @@ import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
import com.sk89q.worldedit.util.Location;
|
||||
import com.sk89q.worldedit.util.formatting.text.TextComponent;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.HashSet;
|
||||
@ -92,6 +93,7 @@ public class WEManager {
|
||||
backupRegions.add(region);
|
||||
}
|
||||
} else {
|
||||
player.printDebug(TextComponent.of("Invalid Mask"));
|
||||
removed = true;
|
||||
iterator.remove();
|
||||
}
|
||||
@ -115,6 +117,8 @@ public class WEManager {
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
player.printError(TextComponent.of("Missing permission " + "fawe." + manager.getKey()));
|
||||
}
|
||||
}
|
||||
regions.addAll(backupRegions);
|
||||
|
Reference in New Issue
Block a user