From 8cd46977f3fd9b544b6134e186646d33da76cd19 Mon Sep 17 00:00:00 2001 From: Kenzie Togami Date: Mon, 28 Dec 2015 12:05:16 -0800 Subject: [PATCH 01/28] Add paging to //schematics. -p can be used to select a page. Defaults to page 1. First implementation by @BangL. --- .../worldedit/command/SchematicCommands.java | 68 +++++++++++++++---- 1 file changed, 54 insertions(+), 14 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SchematicCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SchematicCommands.java index 817be6368..74e538ea9 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SchematicCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SchematicCommands.java @@ -24,8 +24,6 @@ import com.sk89q.minecraft.util.commands.CommandContext; import com.sk89q.minecraft.util.commands.CommandException; import com.sk89q.minecraft.util.commands.CommandPermissions; import com.sk89q.worldedit.EditSession; -import com.sk89q.worldedit.util.io.file.FilenameException; -import com.sk89q.worldedit.util.io.file.FilenameResolutionException; import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.WorldEdit; @@ -40,8 +38,11 @@ import com.sk89q.worldedit.extent.clipboard.io.ClipboardWriter; import com.sk89q.worldedit.function.operation.Operations; import com.sk89q.worldedit.math.transform.Transform; import com.sk89q.worldedit.session.ClipboardHolder; -import com.sk89q.worldedit.util.io.Closer; +import com.sk89q.worldedit.util.command.binding.Switch; import com.sk89q.worldedit.util.command.parametric.Optional; +import com.sk89q.worldedit.util.io.Closer; +import com.sk89q.worldedit.util.io.file.FilenameException; +import com.sk89q.worldedit.util.io.file.FilenameResolutionException; import com.sk89q.worldedit.world.registry.WorldData; import java.io.BufferedInputStream; @@ -51,8 +52,10 @@ import java.io.FileFilter; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; +import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; +import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; @@ -63,6 +66,10 @@ import static com.google.common.base.Preconditions.checkNotNull; */ public class SchematicCommands { + /** + * 9 schematics per page fits in the MC chat window. + */ + private static final int SCHEMATICS_PER_PAGE = 9; private static final Logger log = Logger.getLogger(SchematicCommands.class.getCanonicalName()); private final WorldEdit worldEdit; @@ -244,14 +251,16 @@ public class SchematicCommands { @Command( aliases = {"list", "all", "ls"}, desc = "List saved schematics", - max = 0, - flags = "dn", + min = 0, + max = 1, + flags = "dnp", help = "List all schematics in the schematics directory\n" + " -d sorts by date, oldest first\n" + - " -n sorts by date, newest first\n" + " -n sorts by date, newest first\n" + + " -p prints the requested page\n" ) @CommandPermissions("worldedit.schematic.list") - public void list(Actor actor, CommandContext args) throws WorldEditException { + public void list(Actor actor, CommandContext args, @Switch('p') @Optional("1") int page) throws WorldEditException { File dir = worldEdit.getWorkingDirectoryFile(worldEdit.getConfiguration().saveDir); File[] files = dir.listFiles(new FileFilter(){ @Override @@ -265,6 +274,21 @@ public class SchematicCommands { if (files == null) { throw new FilenameResolutionException(dir.getPath(), "Schematics directory invalid or not found."); } + + if (files.length == 0) { + actor.printError("No schematics found."); + return; + } + + int pageCount = files.length / SCHEMATICS_PER_PAGE + 1; + if (page < 1) { + actor.printError("Page must be at least 1"); + return; + } + if (page > pageCount) { + actor.printError("Page must be less than " + (pageCount + 1)); + return; + } final int sortType = args.hasFlag('d') ? -1 : args.hasFlag('n') ? 1 : 0; // cleanup file list @@ -283,13 +307,23 @@ public class SchematicCommands { } }); - actor.print("Available schematics (Filename (Format)):"); - actor.print(listFiles("", files)); + List schematics = listFiles("", files); + int offset = (page - 1) * SCHEMATICS_PER_PAGE; + + actor.print("Available schematics (Filename: Format) [" + page + "/" + pageCount + "]:"); + StringBuilder build = new StringBuilder(); + int limit = Math.min(offset + SCHEMATICS_PER_PAGE, schematics.size()); + for (int i = offset; i < limit; i++) { + build.append(schematics.get(i)); + } + + actor.print(build.toString()); } - private String listFiles(String prefix, File[] files) { - StringBuilder build = new StringBuilder(); + private List listFiles(String prefix, File[] files) { + List result = new ArrayList(); for (File file : files) { + StringBuilder build = new StringBuilder(); if (file.isDirectory()) { build.append(listFiles(prefix + file.getName() + "/", file.listFiles())); continue; @@ -299,10 +333,16 @@ public class SchematicCommands { continue; } - build.append("\n\u00a79"); + if (!result.isEmpty()) { // prevent an empty line + build.append('\n'); + } + build.append("\u00a79"); ClipboardFormat format = ClipboardFormat.findByFile(file); - build.append(prefix).append(file.getName()).append(": ").append(format == null ? "Unknown" : format.name()); + build.append(prefix).append(file.getName()) + .append(": ").append(format == null ? "Unknown" : format.name()); + + result.add(build.toString()); } - return build.toString(); + return result; } } From 2cd4412b5dc351ec70e4b1b49d1657ce930a98d5 Mon Sep 17 00:00:00 2001 From: wizjany Date: Wed, 13 Jan 2016 17:34:58 -0500 Subject: [PATCH 02/28] Make mask parser create world-aware expression masks. This allows things like //gmask =queryRel(...) to work. Also the query* functions now allow -1 as a wildcard for either id or data. --- .../worldedit/extension/factory/DefaultMaskParser.java | 8 +++++++- .../worldedit/internal/expression/runtime/Functions.java | 4 +++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultMaskParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultMaskParser.java index fa2cdf163..88d4b53ac 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultMaskParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/DefaultMaskParser.java @@ -37,9 +37,11 @@ import com.sk89q.worldedit.function.mask.NoiseFilter; import com.sk89q.worldedit.function.mask.OffsetMask; import com.sk89q.worldedit.function.mask.RegionMask; import com.sk89q.worldedit.function.mask.SolidBlockMask; +import com.sk89q.worldedit.internal.expression.Expression; import com.sk89q.worldedit.internal.expression.ExpressionException; import com.sk89q.worldedit.internal.registry.InputParser; import com.sk89q.worldedit.math.noise.RandomNoise; +import com.sk89q.worldedit.regions.shape.WorldEditExpressionEnvironment; import com.sk89q.worldedit.session.request.Request; import com.sk89q.worldedit.session.request.RequestSelection; import com.sk89q.worldedit.world.biome.BaseBiome; @@ -144,7 +146,11 @@ class DefaultMaskParser extends InputParser { case '=': try { - return new ExpressionMask(component.substring(1)); + Expression exp = Expression.compile(component.substring(1), "x", "y", "z"); + WorldEditExpressionEnvironment env = new WorldEditExpressionEnvironment( + Request.request().getEditSession(), Vector.ONE, Vector.ZERO); + exp.setEnvironment(env); + return new ExpressionMask(exp); } catch (ExpressionException e) { throw new InputParseException("Invalid expression: " + e.getMessage()); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/runtime/Functions.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/runtime/Functions.java index 1a5981855..a9cf3b684 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/runtime/Functions.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/runtime/Functions.java @@ -442,7 +442,9 @@ public final class Functions { private static double queryInternal(RValue type, RValue data, double typeId, double dataValue) throws EvaluationException { // Compare to input values and determine return value - final double ret = (typeId == type.getValue() && dataValue == data.getValue()) ? 1.0 : 0.0; + // -1 is a wildcard, always true + final double ret = ((type.getValue() == -1 || typeId == type.getValue()) + && (data.getValue() == -1 || dataValue == data.getValue())) ? 1.0 : 0.0; if (type instanceof LValue) { ((LValue) type).assign(typeId); From 62befe7594987d070fd7c5b5d3d9fc882d4fdd2e Mon Sep 17 00:00:00 2001 From: wizjany Date: Wed, 13 Jan 2016 18:55:49 -0500 Subject: [PATCH 03/28] Fix schematics in directories. --- .../worldedit/command/SchematicCommands.java | 84 ++++++++++--------- 1 file changed, 44 insertions(+), 40 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SchematicCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SchematicCommands.java index 74e538ea9..9bc9de49d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SchematicCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SchematicCommands.java @@ -42,13 +42,11 @@ import com.sk89q.worldedit.util.command.binding.Switch; import com.sk89q.worldedit.util.command.parametric.Optional; import com.sk89q.worldedit.util.io.Closer; import com.sk89q.worldedit.util.io.file.FilenameException; -import com.sk89q.worldedit.util.io.file.FilenameResolutionException; import com.sk89q.worldedit.world.registry.WorldData; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.File; -import java.io.FileFilter; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; @@ -58,6 +56,7 @@ import java.util.Comparator; import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; +import java.util.regex.Pattern; import static com.google.common.base.Preconditions.checkNotNull; @@ -262,19 +261,10 @@ public class SchematicCommands { @CommandPermissions("worldedit.schematic.list") public void list(Actor actor, CommandContext args, @Switch('p') @Optional("1") int page) throws WorldEditException { File dir = worldEdit.getWorkingDirectoryFile(worldEdit.getConfiguration().saveDir); - File[] files = dir.listFiles(new FileFilter(){ - @Override - public boolean accept(File file) { - // sort out directories from the schematic list - // if WE supports sub-directories in the future, - // this will have to be changed - return file.isFile(); - } - }); - if (files == null) { - throw new FilenameResolutionException(dir.getPath(), "Schematics directory invalid or not found."); - } - + List fileList = allFiles(dir); + File[] files = new File[fileList.size()]; + fileList.toArray(files); + if (files.length == 0) { actor.printError("No schematics found."); return; @@ -295,52 +285,66 @@ public class SchematicCommands { Arrays.sort(files, new Comparator(){ @Override public int compare(File f1, File f2) { - // this should no longer happen, as directory-ness is checked before - // however, if a directory slips through, this will break the contract - // of comparator transitivity - if (!f1.isFile() || !f2.isFile()) return -1; // http://stackoverflow.com/questions/203030/best-way-to-list-files-in-java-sorted-by-date-modified - int result = sortType == 0 ? f1.getName().compareToIgnoreCase(f2.getName()) : // use name by default - Long.valueOf(f1.lastModified()).compareTo(f2.lastModified()); // use date if there is a flag - if (sortType == 1) result = -result; // flip date for newest first instead of oldest first - return result; + int res; + if (sortType == 0) { // use name by default + int p = f1.getParent().compareTo(f2.getParent()); + if (p == 0) { // same parent, compare names + res = f1.getName().compareTo(f2.getName()); + } else { // different parent, sort by that + res = p; + } + } else { + res = Long.valueOf(f1.lastModified()).compareTo(f2.lastModified()); // use date if there is a flag + if (sortType == 1) res = -res; // flip date for newest first instead of oldest first + } + return res; } }); - List schematics = listFiles("", files); + List schematics = listFiles(worldEdit.getConfiguration().saveDir, files); int offset = (page - 1) * SCHEMATICS_PER_PAGE; actor.print("Available schematics (Filename: Format) [" + page + "/" + pageCount + "]:"); StringBuilder build = new StringBuilder(); int limit = Math.min(offset + SCHEMATICS_PER_PAGE, schematics.size()); - for (int i = offset; i < limit; i++) { + for (int i = offset; i < limit;) { build.append(schematics.get(i)); + if (++i != limit) { + build.append("\n"); + } } actor.print(build.toString()); } + private List allFiles(File root) { + File[] files = root.listFiles(); + if (files == null) return null; + List fileList = new ArrayList(); + for (File f : files) { + if (f.isDirectory()) { + List subFiles = allFiles(f); + if (subFiles == null) continue; // empty subdir + fileList.addAll(subFiles); + } else { + fileList.add(f); + } + } + return fileList; + } + private List listFiles(String prefix, File[] files) { + if (prefix == null) prefix = ""; List result = new ArrayList(); for (File file : files) { StringBuilder build = new StringBuilder(); - if (file.isDirectory()) { - build.append(listFiles(prefix + file.getName() + "/", file.listFiles())); - continue; - } - if (!file.isFile()) { - continue; - } - - if (!result.isEmpty()) { // prevent an empty line - build.append('\n'); - } - build.append("\u00a79"); + build.append("\u00a72"); ClipboardFormat format = ClipboardFormat.findByFile(file); - build.append(prefix).append(file.getName()) - .append(": ").append(format == null ? "Unknown" : format.name()); - + boolean inRoot = file.getParentFile().getName().equals(prefix); + build.append(inRoot ? file.getName() : file.getPath().split(Pattern.quote(prefix + File.separator))[1]) + .append(": ").append(format == null ? "Unknown" : format.name()); result.add(build.toString()); } return result; From 03f8843c2021425e5279aa82f9be6177d1802eed Mon Sep 17 00:00:00 2001 From: rlf Date: Mon, 12 Oct 2015 16:15:50 +0200 Subject: [PATCH 04/28] More efficient chunk calculation of CuboidRegion --- .../sk89q/worldedit/regions/CuboidRegion.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/CuboidRegion.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/CuboidRegion.java index 71143b3d3..258be2c6f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/CuboidRegion.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/CuboidRegion.java @@ -300,10 +300,9 @@ public class CuboidRegion extends AbstractRegion implements FlatRegion { Vector min = getMinimumPoint(); Vector max = getMaximumPoint(); - for (int x = min.getBlockX(); x <= max.getBlockX(); ++x) { - for (int z = min.getBlockZ(); z <= max.getBlockZ(); ++z) { - chunks.add(new BlockVector2D(x >> ChunkStore.CHUNK_SHIFTS, - z >> ChunkStore.CHUNK_SHIFTS)); + for (int x = min.getBlockX() >> ChunkStore.CHUNK_SHIFTS; x <= max.getBlockX() >> ChunkStore.CHUNK_SHIFTS; ++x) { + for (int z = min.getBlockZ() >> ChunkStore.CHUNK_SHIFTS; z <= max.getBlockZ() >> ChunkStore.CHUNK_SHIFTS; ++z) { + chunks.add(new BlockVector2D(x, z)); } } @@ -317,11 +316,10 @@ public class CuboidRegion extends AbstractRegion implements FlatRegion { Vector min = getMinimumPoint(); Vector max = getMaximumPoint(); - for (int x = min.getBlockX(); x <= max.getBlockX(); ++x) { - for (int y = min.getBlockY(); y <= max.getBlockY(); ++y) { - for (int z = min.getBlockZ(); z <= max.getBlockZ(); ++z) { - chunks.add(new BlockVector(x >> ChunkStore.CHUNK_SHIFTS, - y >> ChunkStore.CHUNK_SHIFTS, z >> ChunkStore.CHUNK_SHIFTS)); + for (int x = min.getBlockX() >> ChunkStore.CHUNK_SHIFTS; x <= max.getBlockX() >> ChunkStore.CHUNK_SHIFTS; ++x) { + for (int z = min.getBlockZ() >> ChunkStore.CHUNK_SHIFTS; z <= max.getBlockZ() >> ChunkStore.CHUNK_SHIFTS; ++z) { + for (int y = min.getBlockY() >> ChunkStore.CHUNK_SHIFTS; y <= max.getBlockY() >> ChunkStore.CHUNK_SHIFTS; ++y) { + chunks.add(new BlockVector(x, y, z)); } } } From 1952c6f91acc144f1b435bc627c0b46845c1650c Mon Sep 17 00:00:00 2001 From: Kenzie Togami Date: Sun, 31 Jan 2016 21:23:51 -0800 Subject: [PATCH 05/28] Compile on JDK 6, 7, and 8 Ensure that all JDKs are supported. --- .travis.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7b43b6822..3c13ded18 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,8 @@ notifications: email: false before_install: chmod +x gradlew install: ./gradlew setupCIWorkspace -S -matrix: - include: - - jdk: oraclejdk7 - script: ./gradlew build -S \ No newline at end of file +script: ./gradlew build -S +jdk: + - oraclejdk8 + - oraclejdk7 + - openjdk6 From c14a3dfbde68f3bfd1debb8f51499715340cf11c Mon Sep 17 00:00:00 2001 From: Kenzie Togami Date: Sun, 31 Jan 2016 21:24:59 -0800 Subject: [PATCH 06/28] Add caching to Travis --- .travis.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.travis.yml b/.travis.yml index 3c13ded18..f1f614733 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,3 +8,10 @@ jdk: - oraclejdk8 - oraclejdk7 - openjdk6 +# Caching for Gradle files, prevents hitting Maven too much. +before_cache: + - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock +cache: + directories: + - $HOME/.gradle/caches/ + - $HOME/.gradle/wrapper/ From 53b8f08e5eb0d42895eea77e5d5fb24919b6cf29 Mon Sep 17 00:00:00 2001 From: Kenzie Togami Date: Sun, 31 Jan 2016 21:25:32 -0800 Subject: [PATCH 07/28] Have Travis give less verbose stack traces --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index f1f614733..d7da99ae4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,8 +2,8 @@ language: java notifications: email: false before_install: chmod +x gradlew -install: ./gradlew setupCIWorkspace -S -script: ./gradlew build -S +install: ./gradlew setupCIWorkspace -s +script: ./gradlew build -s jdk: - oraclejdk8 - oraclejdk7 From 9dac0b30dbde2bc0c07541f609d2c6fda180c628 Mon Sep 17 00:00:00 2001 From: Kenzie Togami Date: Sun, 31 Jan 2016 21:27:07 -0800 Subject: [PATCH 08/28] Speed up Travis by running on non-sudo containers See why at https://docs.travis-ci.com/user/workers/container-based-infrastructure/ --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index d7da99ae4..e526c902f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,3 +15,6 @@ cache: directories: - $HOME/.gradle/caches/ - $HOME/.gradle/wrapper/ + +# Faster builds without sudo. +sudo: false From 982420369d7709c6732261708d1f075245d99286 Mon Sep 17 00:00:00 2001 From: Kenzie Togami Date: Sun, 31 Jan 2016 22:26:30 -0800 Subject: [PATCH 09/28] Rewrite Closer to compile on Java 6 wrt Jar/ZipFile. --- .../com/sk89q/worldedit/util/io/Closer.java | 31 +++++++++++++++++-- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/io/Closer.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/io/Closer.java index 2e733c6ab..6b5c37efe 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/io/Closer.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/io/Closer.java @@ -29,6 +29,7 @@ import java.util.ArrayDeque; import java.util.Deque; import java.util.logging.Level; import java.util.logging.Logger; +import java.util.zip.ZipFile; import static com.google.common.base.Preconditions.checkNotNull; @@ -55,6 +56,7 @@ public final class Closer implements Closeable { // only need space for 2 elements in most cases, so try to use the smallest array possible private final Deque stack = new ArrayDeque(4); + private final Deque zipStack = new ArrayDeque(4); private Throwable thrown; @VisibleForTesting Closer(Suppressor suppressor) { @@ -73,6 +75,17 @@ public final class Closer implements Closeable { return closeable; } + /** + * Registers the given {@code zipFile} to be closed when this {@code Closer} is + * {@linkplain #close closed}. + * + * @return the given {@code closeable} + */ + public Z register(Z zipFile) { + zipStack.push(zipFile); + return zipFile; + } + /** * Stores the given throwable and rethrows it. It will be rethrown as is if it is an * {@code IOException}, {@code RuntimeException} or {@code Error}. Otherwise, it will be rethrown @@ -161,6 +174,18 @@ public final class Closer implements Closeable { } } } + while (!zipStack.isEmpty()) { + ZipFile zipFile = zipStack.pop(); + try { + zipFile.close(); + } catch (Throwable e) { + if (throwable == null) { + throwable = e; + } else { + suppressor.suppress(zipFile, throwable, e); + } + } + } if (thrown == null && throwable != null) { Throwables.propagateIfPossible(throwable, IOException.class); @@ -177,7 +202,7 @@ public final class Closer implements Closeable { * the given closeable. {@code thrown} is the exception that is actually being thrown from the * method. Implementations of this method should not throw under any circumstances. */ - void suppress(Closeable closeable, Throwable thrown, Throwable suppressed); + void suppress(Object closeable, Throwable thrown, Throwable suppressed); } /** @@ -188,7 +213,7 @@ public final class Closer implements Closeable { static final LoggingSuppressor INSTANCE = new LoggingSuppressor(); @Override - public void suppress(Closeable closeable, Throwable thrown, Throwable suppressed) { + public void suppress(Object closeable, Throwable thrown, Throwable suppressed) { // log to the same place as Closeables logger.log(Level.WARNING, "Suppressing exception thrown when closing " + closeable, suppressed); } @@ -217,7 +242,7 @@ public final class Closer implements Closeable { } @Override - public void suppress(Closeable closeable, Throwable thrown, Throwable suppressed) { + public void suppress(Object closeable, Throwable thrown, Throwable suppressed) { // ensure no exceptions from addSuppressed if (thrown == suppressed) { return; From d6db9a97908204c9e2b91ed077fd51c0d864ca4e Mon Sep 17 00:00:00 2001 From: Kenzie Togami Date: Sun, 7 Feb 2016 09:41:29 -0800 Subject: [PATCH 10/28] Update 1.7.10 Forge version --- worldedit-forge/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worldedit-forge/build.gradle b/worldedit-forge/build.gradle index f7b51a33e..6c4e6c3a4 100644 --- a/worldedit-forge/build.gradle +++ b/worldedit-forge/build.gradle @@ -19,7 +19,7 @@ dependencies { } minecraft { - ext.forgeVersion = "10.13.1.1225" + ext.forgeVersion = "10.13.4.1614-1.7.10" version = "1.7.10-$forgeVersion" replaceIn "com/sk89q/worldedit/forge/ForgeWorldEdit.java" From 6757b04d24f8920d863b0685aa76310ece3a1dc3 Mon Sep 17 00:00:00 2001 From: Kenzie Togami Date: Sun, 7 Feb 2016 10:14:33 -0800 Subject: [PATCH 11/28] Add FMP as a dependency at compile --- worldedit-forge/build.gradle | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/worldedit-forge/build.gradle b/worldedit-forge/build.gradle index 6c4e6c3a4..015e0f88d 100644 --- a/worldedit-forge/build.gradle +++ b/worldedit-forge/build.gradle @@ -15,7 +15,8 @@ apply plugin: 'forge' dependencies { compile project(':worldedit-core') - testCompile group: 'org.mockito', name: 'mockito-core', version:'1.9.0-rc1' + compile group: 'codechicken', name: 'ForgeMultipart', version: '1.2.0.345', classifier: 'dev' + testCompile group: 'org.mockito', name: 'mockito-core', version: '1.9.0-rc1' } minecraft { From 10776f27a8c7b4840c7b02b51d5947131a693b27 Mon Sep 17 00:00:00 2001 From: Kenzie Togami Date: Sun, 7 Feb 2016 10:42:13 -0800 Subject: [PATCH 12/28] Fix dependency --- worldedit-forge/build.gradle | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/worldedit-forge/build.gradle b/worldedit-forge/build.gradle index 015e0f88d..a5857ecb8 100644 --- a/worldedit-forge/build.gradle +++ b/worldedit-forge/build.gradle @@ -13,9 +13,16 @@ buildscript { apply plugin: 'forge' +repositories { + maven { + name 'forge' + url 'http://files.minecraftforge.net/maven/' + } +} + dependencies { compile project(':worldedit-core') - compile group: 'codechicken', name: 'ForgeMultipart', version: '1.2.0.345', classifier: 'dev' + compile group: 'codechicken', name: 'ForgeMultipart', version: '1.7.10-1.2.0.345', classifier: 'dev' testCompile group: 'org.mockito', name: 'mockito-core', version: '1.9.0-rc1' } From 7271cca89ff5ff0621dcf4ef8d4e0ac7383045ea Mon Sep 17 00:00:00 2001 From: Kenzie Togami Date: Sun, 7 Feb 2016 14:07:41 -0800 Subject: [PATCH 13/28] Implement FMP compatibility --- .../sk89q/worldedit/forge/ForgeWorldEdit.java | 13 ++++++++ .../worldedit/forge/TileEntityUtils.java | 24 +++++++++++--- .../forge/compat/ForgeMultipartCompat.java | 15 +++++++++ .../compat/ForgeMultipartExistsCompat.java | 33 +++++++++++++++++++ .../forge/compat/NoForgeMultipartCompat.java | 19 +++++++++++ worldedit-forge/src/main/resources/mcmod.info | 3 +- 6 files changed, 101 insertions(+), 6 deletions(-) create mode 100644 worldedit-forge/src/main/java/com/sk89q/worldedit/forge/compat/ForgeMultipartCompat.java create mode 100644 worldedit-forge/src/main/java/com/sk89q/worldedit/forge/compat/ForgeMultipartExistsCompat.java create mode 100644 worldedit-forge/src/main/java/com/sk89q/worldedit/forge/compat/NoForgeMultipartCompat.java diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorldEdit.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorldEdit.java index 7284796e6..989865815 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorldEdit.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorldEdit.java @@ -26,8 +26,12 @@ import com.sk89q.worldedit.WorldVector; import com.sk89q.worldedit.blocks.BaseItemStack; import com.sk89q.worldedit.event.platform.PlatformReadyEvent; import com.sk89q.worldedit.extension.platform.Platform; +import com.sk89q.worldedit.forge.compat.ForgeMultipartCompat; +import com.sk89q.worldedit.forge.compat.ForgeMultipartExistsCompat; +import com.sk89q.worldedit.forge.compat.NoForgeMultipartCompat; import com.sk89q.worldedit.internal.LocalWorldAdapter; import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.Mod.Instance; @@ -76,6 +80,7 @@ public class ForgeWorldEdit { private ForgePlatform platform; private ForgeConfiguration config; private File workingDir; + private ForgeMultipartCompat compat = new NoForgeMultipartCompat(); @EventHandler public void preInit(FMLPreInitializationEvent event) { @@ -87,6 +92,10 @@ public class ForgeWorldEdit { config = new ForgeConfiguration(this); config.load(); + if (Loader.isModLoaded("ForgeMultipart")) { + compat = new ForgeMultipartExistsCompat(); + } + FMLCommonHandler.instance().bus().register(ThreadSafeCache.getInstance()); } @@ -260,6 +269,10 @@ public class ForgeWorldEdit { return this.workingDir; } + public ForgeMultipartCompat getFMPCompat() { + return compat; + } + /** * Get the version of the WorldEdit-for-Forge implementation. * diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/TileEntityUtils.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/TileEntityUtils.java index fd8d6e5fe..b3706f349 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/TileEntityUtils.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/TileEntityUtils.java @@ -81,9 +81,10 @@ final class TileEntityUtils { tileEntity.readFromNBT(tag); } - world.setTileEntity(position.getBlockX(), position.getBlockY(), position.getBlockZ(), tileEntity); - } + tileEntity = ForgeWorldEdit.inst.getFMPCompat().overrideTileEntity(world, tag, tileEntity); + setTileEntity(world, position, tileEntity); + } /** * Set a tile entity at the given location using the tile entity ID from * the tag. @@ -95,12 +96,26 @@ final class TileEntityUtils { static void setTileEntity(World world, Vector position, @Nullable NBTTagCompound tag) { if (tag != null) { updateForSet(tag, position); - TileEntity tileEntity = TileEntity.createAndLoadEntity(tag); + TileEntity tileEntity = makeTileEntity(world, position, tag); if (tileEntity != null) { - world.setTileEntity(position.getBlockX(), position.getBlockY(), position.getBlockZ(), tileEntity); + setTileEntity(world, position, tileEntity); } } } + + private static TileEntity makeTileEntity(World world, Vector position, + NBTTagCompound tag) { + TileEntity normal = TileEntity.createAndLoadEntity(tag); + return ForgeWorldEdit.inst.getFMPCompat().overrideTileEntity(world, tag, + normal); + } + + private static void setTileEntity(World world, Vector position, + TileEntity tileEntity) { + world.setTileEntity(position.getBlockX(), position.getBlockY(), + position.getBlockZ(), tileEntity); + ForgeWorldEdit.inst.getFMPCompat().sendDescPacket(world, tileEntity); + } /** * Construct a tile entity from the given class. @@ -139,5 +154,4 @@ final class TileEntityUtils { return genericTE; } - } diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/compat/ForgeMultipartCompat.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/compat/ForgeMultipartCompat.java new file mode 100644 index 000000000..a9e8bd0de --- /dev/null +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/compat/ForgeMultipartCompat.java @@ -0,0 +1,15 @@ +package com.sk89q.worldedit.forge.compat; + +import javax.annotation.Nullable; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + +public interface ForgeMultipartCompat { + + TileEntity overrideTileEntity(World world, @Nullable NBTTagCompound tag, + TileEntity normal); + + void sendDescPacket(World world, TileEntity entity); + +} diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/compat/ForgeMultipartExistsCompat.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/compat/ForgeMultipartExistsCompat.java new file mode 100644 index 000000000..1f5c82f30 --- /dev/null +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/compat/ForgeMultipartExistsCompat.java @@ -0,0 +1,33 @@ +package com.sk89q.worldedit.forge.compat; + +import codechicken.multipart.MultipartHelper; +import codechicken.multipart.TileMultipart; +import javax.annotation.Nullable; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + +public class ForgeMultipartExistsCompat implements ForgeMultipartCompat { + + @Override + public TileEntity overrideTileEntity(World world, + @Nullable NBTTagCompound tag, TileEntity normal) { + if (tag == null) { + return normal; + } + TileEntity tile = MultipartHelper.createTileFromNBT(world, tag); + if (tile == null) { + return normal; + } + return tile; + } + + @Override + public void sendDescPacket(World world, TileEntity entity) { + if (entity instanceof TileMultipart) { + TileMultipart multi = (TileMultipart) entity; + MultipartHelper.sendDescPacket(world, multi); + } + } + +} diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/compat/NoForgeMultipartCompat.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/compat/NoForgeMultipartCompat.java new file mode 100644 index 000000000..229a9ba40 --- /dev/null +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/compat/NoForgeMultipartCompat.java @@ -0,0 +1,19 @@ +package com.sk89q.worldedit.forge.compat; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + +public class NoForgeMultipartCompat implements ForgeMultipartCompat { + + @Override + public TileEntity overrideTileEntity(World world, NBTTagCompound tag, + TileEntity normal) { + return normal; + } + + @Override + public void sendDescPacket(World world, TileEntity entity) { + } + +} diff --git a/worldedit-forge/src/main/resources/mcmod.info b/worldedit-forge/src/main/resources/mcmod.info index df47ddfac..f3f2f5b98 100644 --- a/worldedit-forge/src/main/resources/mcmod.info +++ b/worldedit-forge/src/main/resources/mcmod.info @@ -14,7 +14,8 @@ "Forge@[${forgeVersion},)" ], "dependencies": [ - "Forge@[${forgeVersion},)" + "Forge@[${forgeVersion},)", + "ForgeMultipart" ], "dependants": [] }] From 4088f26d198ba48ed4fbdfd63748bf45455a01dc Mon Sep 17 00:00:00 2001 From: Kenzie Togami Date: Sun, 7 Feb 2016 14:21:24 -0800 Subject: [PATCH 14/28] Fix checkstyle errors --- config/checkstyle/import-control.xml | 1 + .../forge/compat/ForgeMultipartCompat.java | 19 +++++++++++++++++++ .../compat/ForgeMultipartExistsCompat.java | 18 ++++++++++++++++++ .../forge/compat/NoForgeMultipartCompat.java | 19 +++++++++++++++++++ 4 files changed, 57 insertions(+) diff --git a/config/checkstyle/import-control.xml b/config/checkstyle/import-control.xml index 7a5600470..1209aa71d 100644 --- a/config/checkstyle/import-control.xml +++ b/config/checkstyle/import-control.xml @@ -48,6 +48,7 @@ + diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/compat/ForgeMultipartCompat.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/compat/ForgeMultipartCompat.java index a9e8bd0de..00d1615e1 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/compat/ForgeMultipartCompat.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/compat/ForgeMultipartCompat.java @@ -1,3 +1,22 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + package com.sk89q.worldedit.forge.compat; import javax.annotation.Nullable; diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/compat/ForgeMultipartExistsCompat.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/compat/ForgeMultipartExistsCompat.java index 1f5c82f30..d1b4752e4 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/compat/ForgeMultipartExistsCompat.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/compat/ForgeMultipartExistsCompat.java @@ -1,3 +1,21 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ package com.sk89q.worldedit.forge.compat; import codechicken.multipart.MultipartHelper; diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/compat/NoForgeMultipartCompat.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/compat/NoForgeMultipartCompat.java index 229a9ba40..316509689 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/compat/NoForgeMultipartCompat.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/compat/NoForgeMultipartCompat.java @@ -1,3 +1,22 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + package com.sk89q.worldedit.forge.compat; import net.minecraft.nbt.NBTTagCompound; From 136c66868f20ca19cc6c46495e88acecaedad5e8 Mon Sep 17 00:00:00 2001 From: Kenzie Togami Date: Mon, 22 Feb 2016 17:01:09 -0800 Subject: [PATCH 15/28] Move sponge dependency to mcmod --- .../main/java/com/sk89q/worldedit/forge/ForgeWorldEdit.java | 2 +- worldedit-forge/src/main/resources/mcmod.info | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorldEdit.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorldEdit.java index 2ba05bf28..5ae29054e 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorldEdit.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorldEdit.java @@ -59,7 +59,7 @@ import static com.google.common.base.Preconditions.checkNotNull; /** * The Forge implementation of WorldEdit. */ -@Mod(modid = ForgeWorldEdit.MOD_ID, name = "WorldEdit", version = "%VERSION%", acceptableRemoteVersions = "*", dependencies = "after:sponge") +@Mod(modid = ForgeWorldEdit.MOD_ID, name = "WorldEdit", version = "%VERSION%", acceptableRemoteVersions = "*") public class ForgeWorldEdit { public static Logger logger; diff --git a/worldedit-forge/src/main/resources/mcmod.info b/worldedit-forge/src/main/resources/mcmod.info index b21a45185..02b53f838 100644 --- a/worldedit-forge/src/main/resources/mcmod.info +++ b/worldedit-forge/src/main/resources/mcmod.info @@ -14,7 +14,8 @@ "Forge@[${forgeVersion},)" ], "dependencies": [ - "Forge@[${forgeVersion},)" + "Forge@[${forgeVersion},)", + "sponge" ], "dependants": [] }] From a9fc46cef620c2b8b7cd97bd2ff47411f3e67e30 Mon Sep 17 00:00:00 2001 From: Kenzie Togami Date: Mon, 22 Feb 2016 17:11:29 -0800 Subject: [PATCH 16/28] Correlate modids in code and mcmod.info --- worldedit-forge/src/main/resources/mcmod.info | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worldedit-forge/src/main/resources/mcmod.info b/worldedit-forge/src/main/resources/mcmod.info index 02b53f838..599e2f5e1 100644 --- a/worldedit-forge/src/main/resources/mcmod.info +++ b/worldedit-forge/src/main/resources/mcmod.info @@ -1,5 +1,5 @@ [{ - "modid": "WorldEdit", + "modid": "worldedit", "name": "WorldEdit", "description": "WorldEdit is an easy-to-use in-game world editor for Minecraft, supporting both single player and multiplayer.", "version": "${internalVersion}", From 74167b8b9f86870842b392a4cf34ae68e22b346b Mon Sep 17 00:00:00 2001 From: Kenzie Togami Date: Mon, 22 Feb 2016 17:37:45 -0800 Subject: [PATCH 17/28] Update forge version. Not really needed, but why not? --- worldedit-forge/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worldedit-forge/build.gradle b/worldedit-forge/build.gradle index 2873f5608..e977bee24 100644 --- a/worldedit-forge/build.gradle +++ b/worldedit-forge/build.gradle @@ -27,7 +27,7 @@ repositories { } version = "6.1.1" -ext.forgeVersion = "11.15.0.1695" +ext.forgeVersion = "11.15.1.1760" ext.internalVersion = version + ";" + gitCommitHash minecraft { From fb52a86eae56aed82b3b5b43f71adb23f1dd5d42 Mon Sep 17 00:00:00 2001 From: Kenzie Togami Date: Mon, 22 Feb 2016 17:40:18 -0800 Subject: [PATCH 18/28] Update shadow plugin in build.gradle Needed to build this with the latest Gradle release. --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index fbe0f78ad..aebadd65e 100644 --- a/build.gradle +++ b/build.gradle @@ -26,7 +26,7 @@ buildscript { } dependencies { - classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.0' + classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.3' classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:3.0.1' classpath 'org.ajoberstar:gradle-git:0.12.0' } From 775075d3a732fdffea28cdb650c98fce90548864 Mon Sep 17 00:00:00 2001 From: Kenzie Togami Date: Mon, 22 Feb 2016 17:41:03 -0800 Subject: [PATCH 19/28] Update gradle wrapper to 2.11. --- gradle/wrapper/gradle-wrapper.jar | Bin 53636 -> 53638 bytes gradle/wrapper/gradle-wrapper.properties | 4 ++-- gradlew.bat | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 13372aef5e24af05341d49695ee84e5f9b594659..5ccda13e9cb94678ba179b32452cf3d60dc36353 100644 GIT binary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D-bq&A4G&EpU+Zf7kJ#i7ju4u2rx7Noj}L%f}aiRS4xu)c%%wB6Ab zUW_XCr~v@>9I|vL_8GiW1byKHb|&P~gS{GjZEb*FOC%#SZIrXteqAB0Atvrp>- z;KP~N0$saT5N8?PG?iJ2mOA@Gt}ZrIZ##mVRiN$S?rUzE$bFbQPGza0zK80Xo0|WjC DxnnmS diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 7f72d79da..b2c6e7a02 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Tue Jan 12 02:06:32 PST 2016 +#Mon Feb 22 17:40:44 PST 2016 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.11-bin.zip diff --git a/gradlew.bat b/gradlew.bat index aec99730b..72d362daf 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -46,7 +46,7 @@ echo location of your Java installation. goto fail :init -@rem Get command-line arguments, handling Windowz variants +@rem Get command-line arguments, handling Windows variants if not "%OS%" == "Windows_NT" goto win9xME_args if "%@eval[2+2]" == "4" goto 4NT_args From e53fb782d4fd4dbf8b375ae17eee5c3d1088949b Mon Sep 17 00:00:00 2001 From: Kenzie Togami Date: Mon, 22 Feb 2016 18:21:46 -0800 Subject: [PATCH 20/28] Disable Grgit on 6. It appears to be incompatible. --- build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index aebadd65e..63aa60726 100644 --- a/build.gradle +++ b/build.gradle @@ -28,7 +28,7 @@ buildscript { dependencies { classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.3' classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:3.0.1' - classpath 'org.ajoberstar:gradle-git:0.12.0' + classpath 'org.ajoberstar:gradle-git:1.4.2' } } @@ -36,7 +36,7 @@ if (!project.hasProperty("artifactory_contextUrl")) ext.artifactory_contextUrl = if (!project.hasProperty("artifactory_user")) ext.artifactory_user = "guest" if (!project.hasProperty("artifactory_password")) ext.artifactory_password = "" -if (!project.hasProperty("gitCommitHash")) { +if (!project.hasProperty("gitCommitHash") && !JavaVersion.current().isJava6()) { try { def repo = org.ajoberstar.grgit.Grgit.open(project.file('.')) ext.gitCommitHash = repo.head().abbreviatedId From 698a610eaa8a6051e2a9e460be07055154d316fb Mon Sep 17 00:00:00 2001 From: Kenzie Togami Date: Mon, 22 Feb 2016 18:31:55 -0800 Subject: [PATCH 21/28] Kill lock files in cache. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e526c902f..05606e10a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ jdk: - openjdk6 # Caching for Gradle files, prevents hitting Maven too much. before_cache: - - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock + - find $HOME/.gradle/ -name '*.lock' -print -exec 'rm -f {} \;' cache: directories: - $HOME/.gradle/caches/ From a1680886a461e1ca17fc92f925955aa404546d2b Mon Sep 17 00:00:00 2001 From: Kenzie Togami Date: Mon, 22 Feb 2016 19:13:08 -0800 Subject: [PATCH 22/28] Weird hack for java6. I hope it works. --- build.gradle | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 63aa60726..264c20903 100644 --- a/build.gradle +++ b/build.gradle @@ -38,9 +38,12 @@ if (!project.hasProperty("artifactory_password")) ext.artifactory_password = "" if (!project.hasProperty("gitCommitHash") && !JavaVersion.current().isJava6()) { try { - def repo = org.ajoberstar.grgit.Grgit.open(project.file('.')) + def Grgit = Class.forName("org.ajoberstar.grgit.Grgit"); + def Grgit_open = Grgit.getDeclaredMethod("open", File.class) + def repo = Grgit_open.invoke(null, project.file('.')) ext.gitCommitHash = repo.head().abbreviatedId } catch (Exception e) { + println "Error getting commit hash: " + e.getMessage() ext.gitCommitHash = "no_git_id" } } From a64a53db7ff68acefbfef329b66b7f97abc00711 Mon Sep 17 00:00:00 2001 From: Kenzie Togami Date: Mon, 22 Feb 2016 19:16:14 -0800 Subject: [PATCH 23/28] Default gitCommitHash --- build.gradle | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 264c20903..144b8de13 100644 --- a/build.gradle +++ b/build.gradle @@ -44,9 +44,11 @@ if (!project.hasProperty("gitCommitHash") && !JavaVersion.current().isJava6()) { ext.gitCommitHash = repo.head().abbreviatedId } catch (Exception e) { println "Error getting commit hash: " + e.getMessage() - ext.gitCommitHash = "no_git_id" } } +if (!project.hasProperty("gitCommitHash")) { + ext.gitCommitHash = "no_git_id" +} subprojects { apply plugin: 'java' From f5c015317eedcdcba9f56fe77dced71de67de6af Mon Sep 17 00:00:00 2001 From: Kenzie Togami Date: Mon, 22 Feb 2016 19:22:30 -0800 Subject: [PATCH 24/28] Fix finding locks --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 05606e10a..9321cf073 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ jdk: - openjdk6 # Caching for Gradle files, prevents hitting Maven too much. before_cache: - - find $HOME/.gradle/ -name '*.lock' -print -exec 'rm -f {} \;' + - find $HOME/.gradle/ -name '*.lock' -print -exec rm -f {} \; cache: directories: - $HOME/.gradle/caches/ From de3578137b90a83e7b9322c6792fb0a7482244af Mon Sep 17 00:00:00 2001 From: wizjany Date: Wed, 2 Mar 2016 18:14:18 -0500 Subject: [PATCH 25/28] Add bukkit adapter for MC 1.9. --- .../bukkit/adapter/impl/Spigot_v1_9_R1.class | Bin 0 -> 14795 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 worldedit-bukkit/src/main/resources/com/sk89q/worldedit/bukkit/adapter/impl/Spigot_v1_9_R1.class diff --git a/worldedit-bukkit/src/main/resources/com/sk89q/worldedit/bukkit/adapter/impl/Spigot_v1_9_R1.class b/worldedit-bukkit/src/main/resources/com/sk89q/worldedit/bukkit/adapter/impl/Spigot_v1_9_R1.class new file mode 100644 index 0000000000000000000000000000000000000000..77edca3290e5d9d476666edf807cbe21268562b0 GIT binary patch literal 14795 zcmbVT33yc1^*`rkCNFt;Y|$tK0zm;o0uCsmB#00;qe-A7ECCfK$s`$=%*4qgfcpvx z?mH^(f@?*qlVGaiQf#fQwzaL@t=(I@TJ^83^8cOt-psriVv?_XA8+2f%eiOyo#o#5 z^2Qg>zeq&Ks~?;65(nhcXwpb-GP#+9`ScpM7~E=d8;7KMgTWi~I4rmA(it&1${hxu zo5wMOJM%ftUDDYtotsSF%pE3g;q&BjzR4Hxg>t#bKq zm&teYE`#qeX@rhxU{Wi;WAG0R{*g%=7?$41?;89QgMVsLgnwpI zlz(pUFGSv7niS(l4E~kD@0rxazc#6x-xq#=WAJbD`FH&LJpO}#2Ymbg^)C z5&y;D4-EdRNtf~8OuC%^Zty=0{-;S>`Cle&;|~q~x4|Eow4FaTX$OB|@c$Y7sY%y! zz~Ije{*OsFaUhTXE5D!12V20|K|>K96ho^@$tA~B9_5AnDi@kihN1Eb z=zf(i7t>G$(1fx~j;mp!n75$_HC$Bk4pg8C%I!qld3i&y7po&a& zggO$^tI?tds32d*4AK*X-xHoKzG336%U2|(iV!e`m1$c1=C@X#&~t8GhQEP zm7gV{V7QsdXHN+SFf>ub3>6( zd>&Iy$<$R$o`uooAk&EIP$XE})!rD4)dw2GXeq3YHU+|~0aU*^L&4G@1Fy;@ncZB_Q9ii4}e0}%K^>fy*n2F`h z#haUg9q~{!(rKuvhAL$$0{_imzbX=s)`!Bu#gTX@zJ;lwq&gCe``f`;Q!LOD_jd+k z-5~4`^Ve3^W7fiGdq=b@(p)j{;56Y15j!UyXl0r{@SLm#z&xy$VsGlelU)lYMNCcB zk_rQZiRdCS@M>ACi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eHf*wxL?jG7B9j)4xTBM^jL67v%qtd!j58oiI8x!Wr%`}NN4H*}OFFs}^h^(ZODYHvD)v28?gdJ?G4{t*xxf)2^j!3eDe0&W}#BT*(ORM=hTFckdnS2BOdhJI1#nnx8 z0pE;dbPN6v>{faR^d9Hi=>@(6e~Y#gQRGhg1>c1zayNa*yXZfRZ*}-yp2+uc89vlL zjvqj-c@S~nAz=4mUe3GmR%{Qx9eo5}wm%9EALrZn3BH}5znO zA{1{@pD3P)q`Zb3G_p^mci|@rNS*<@YbggjDa4p{@BpAT=}-JT{Hei-F|vcV>7EI? z5?PL?!rafP*iM!RE1waME*d?0bde4>aF?@mxH Date: Sat, 5 Mar 2016 16:10:03 -0500 Subject: [PATCH 26/28] Fixed a bug where virtually all mobs were determined to be Animals on the Forge 1.8 platform --- .../main/java/com/sk89q/worldedit/forge/ForgeEntityType.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeEntityType.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeEntityType.java index 8fb19f3cd..c56375105 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeEntityType.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeEntityType.java @@ -36,6 +36,7 @@ import net.minecraft.entity.item.EntityTNTPrimed; import net.minecraft.entity.item.EntityXPOrb; import net.minecraft.entity.monster.EntityGolem; import net.minecraft.entity.passive.EntityAmbientCreature; +import net.minecraft.entity.passive.EntityAnimal; import net.minecraft.entity.passive.EntityTameable; import net.minecraft.entity.passive.IAnimals; import net.minecraft.entity.player.EntityPlayer; @@ -108,7 +109,7 @@ public class ForgeEntityType implements EntityType { @Override public boolean isAnimal() { - return entity instanceof IAnimals; + return entity instanceof EntityAnimal; } @Override From 6c03eea9b183687f5259c21a6bd27cffebcc1656 Mon Sep 17 00:00:00 2001 From: wizjany Date: Mon, 7 Mar 2016 19:26:16 -0500 Subject: [PATCH 27/28] Force compilation on newer bukkit api. Since spigot like pulling the rug out from under us. Fixes WORLDEDIT-3400. --- worldedit-bukkit/build.gradle | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/worldedit-bukkit/build.gradle b/worldedit-bukkit/build.gradle index ed882a1c0..cc23519df 100644 --- a/worldedit-bukkit/build.gradle +++ b/worldedit-bukkit/build.gradle @@ -1,11 +1,14 @@ apply plugin: 'eclipse' apply plugin: 'idea' +repositories { + maven { url "https://hub.spigotmc.org/nexus/content/groups/public" } +} + dependencies { compile project(':worldedit-core') compile 'com.sk89q:dummypermscompat:1.8' - compile 'org.sk89q.bukkit:bukkit-classloader-check:1.7.9-R0.2' - compile 'org.bukkit:bukkit:1.7.9-R0.2' + compile 'org.bukkit:bukkit:1.8.8-R0.1-SNAPSHOT' // zzz testCompile 'org.mockito:mockito-core:1.9.0-rc1' } From 94ae1be2d1fa1d4a19e83816f22029d0d0b1e9a8 Mon Sep 17 00:00:00 2001 From: wizjany Date: Tue, 8 Mar 2016 12:42:23 -0500 Subject: [PATCH 28/28] Fix NPE when using //schem list with not schematics present. --- .../com/sk89q/worldedit/command/SchematicCommands.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SchematicCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SchematicCommands.java index 9bc9de49d..9439f8184 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SchematicCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SchematicCommands.java @@ -262,14 +262,15 @@ public class SchematicCommands { public void list(Actor actor, CommandContext args, @Switch('p') @Optional("1") int page) throws WorldEditException { File dir = worldEdit.getWorkingDirectoryFile(worldEdit.getConfiguration().saveDir); List fileList = allFiles(dir); - File[] files = new File[fileList.size()]; - fileList.toArray(files); - if (files.length == 0) { + if (fileList.isEmpty()) { actor.printError("No schematics found."); return; } + File[] files = new File[fileList.size()]; + fileList.toArray(files); + int pageCount = files.length / SCHEMATICS_PER_PAGE + 1; if (page < 1) { actor.printError("Page must be at least 1");