Merge remote-tracking branch 'refs/remotes/origin/master' into new-vector-system

# Conflicts:
#	build.gradle
#	worldedit-core/build.gradle
#	worldedit-core/src/main/java/com/boydti/fawe/util/IncendoPaster.java

#	worldedit-core/src/main/java/com/sk89q/worldedit/command/WorldEditCommands.java

#	worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SpongeSchematicReader.java
This commit is contained in:
Jesse Boyd
2019-04-01 23:50:16 +11:00
6 changed files with 33 additions and 15 deletions

View File

@ -28,8 +28,8 @@ public final class IncendoPaster {
* Valid paste applications
*/
public static final Collection<String>
VALID_APPLICATIONS = Arrays
.asList("plotsquared", "fastasyncworldedit", "incendopermissions", "kvantum");
VALID_APPLICATIONS = Arrays
.asList("plotsquared", "fastasyncworldedit", "incendopermissions", "kvantum");
private final Collection<PasteFile> files = new ArrayList<>();
private final String pasteApplication;
@ -45,7 +45,7 @@ public final class IncendoPaster {
}
if (!VALID_APPLICATIONS.contains(pasteApplication.toLowerCase(Locale.ENGLISH))) {
throw new IllegalArgumentException(
String.format("Unknown application name: %s", pasteApplication));
String.format("Unknown application name: %s", pasteApplication));
}
this.pasteApplication = pasteApplication;
}
@ -72,7 +72,7 @@ public final class IncendoPaster {
for (final PasteFile pasteFile : this.files) {
if (pasteFile.fileName.equalsIgnoreCase(file.getFileName())) {
throw new IllegalArgumentException(String.format("Found duplicate file with name %s",
file.getFileName()));
file.getFileName()));
}
}
this.files.add(file);
@ -99,7 +99,7 @@ public final class IncendoPaster {
while (fileIterator.hasNext()) {
final PasteFile file = fileIterator.next();
builder.append("\"file-").append(file.getFileName()).append("\": \"")
.append(file.getContent().replaceAll("\"", "\\\\\"")).append("\"");
.append(file.getContent().replaceAll("\"", "\\\\\"")).append("\"");
if (fileIterator.hasNext()) {
builder.append(",\n");
}
@ -130,7 +130,7 @@ public final class IncendoPaster {
}
if (!httpURLConnection.getResponseMessage().contains("OK")) {
throw new IllegalStateException(String.format("Server returned status: %d %s",
httpURLConnection.getResponseCode(), httpURLConnection.getResponseMessage()));
httpURLConnection.getResponseCode(), httpURLConnection.getResponseMessage()));
}
final StringBuilder input = new StringBuilder();
try (final BufferedReader inputStream = new BufferedReader(new InputStreamReader(httpURLConnection.getInputStream()))) {
@ -191,9 +191,10 @@ public final class IncendoPaster {
StringBuilder b = new StringBuilder();
b.append(
"# Welcome to this paste\n# It is meant to provide us at IntellectualSites with better information about your "
+ "problem\n");
"# 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");
Runtime runtime = Runtime.getRuntime();
@ -240,7 +241,7 @@ public final class IncendoPaster {
return String.format("https://incendo.org/paste/view/%s", pasteId);
} else {
throw new IOException(String.format("Failed to upload files: %s",
jsonObject.get("response").getAsString()));
jsonObject.get("response").getAsString()));
}
}

View File

@ -79,8 +79,6 @@ public class ScriptingCommands {
}
public static <T> T runScript(Actor actor, File f, String[] args, @Nullable Function<String, String> processor) throws WorldEditException {
Request.reset();
String filename = f.getPath();
int index = filename.lastIndexOf(".");
String ext = filename.substring(index + 1, filename.length());
@ -188,7 +186,7 @@ public class ScriptingCommands {
player.printError("More info: https://github.com/boy0001/CraftScripts/");
return;
}
this.worldEdit.runScript(LocationMaskedPlayerWrapper.unwrap(player), f, scriptArgs);
runScript(LocationMaskedPlayerWrapper.unwrap(player), f, scriptArgs);
}
@Command(aliases = {".s"}, usage = "[args...]", desc = "Execute last CraftScript", min = 0, max = -1)

View File

@ -200,7 +200,6 @@ public class WorldEditCommands {
@CommandPermissions("worldedit.debugpaste")
public void debugpaste(Actor actor) throws WorldEditException, IOException {
BBC.DOWNLOAD_LINK.send(actor, IncendoPaster.debugPaste());
}
@Command(

View File

@ -356,7 +356,8 @@ public class ForwardExtentCopy implements Operation {
entities = source.getEntities()
.stream()
.filter(entity -> entity.getState() != null &&
entity.getState().getType().getId().equals("minecraft:player"))
!entity.getState().getType().getId().equals("minecraft:player") &&
region.contains(entity.getLocation().toVector()))
.collect(Collectors.toList());
} else {
entities = new ArrayList<>();