Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into feature/multipass2
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkArc committed Jun 17, 2017
2 parents 867ec60 + aabc229 commit 158f0d1
Show file tree
Hide file tree
Showing 88 changed files with 4,490 additions and 1,080 deletions.
22 changes: 15 additions & 7 deletions COMPILING.md
@@ -1,12 +1,14 @@
Compiling
=========

You can compile WorldEdit as long as you have the [Java Development Kit (JDK)](http://www.oracle.com/technetwork/java/javase/downloads/index-jsp-138363.html) for Java 7 or newer. You only need one version of JDK installed.
You can compile WorldEdit as long as you have the [Java Development Kit (JDK)](http://www.oracle.com/technetwork/java/javase/downloads/index-jsp-138363.html) for Java 7 or newer.
You only need one version of the JDK installed.

The build process uses Gradle, which you do *not* need to download. WorldEdit is a multi-module project with three modules:
The build process uses Gradle, which you do *not* need to download. WorldEdit is a multi-module project with four modules:

* `worldedit-core` contains WorldEdit
* `worldedit-core` contains the WorldEdit API
* `worldedit-bukkit` is the Bukkit plugin
* `worldedit-sponge` is the Sponge plugin
* `worldedit-forge` is the Forge mod

## To compile...
Expand All @@ -29,14 +31,20 @@ You will find:

* The core WorldEdit API in **worldedit-core/build/libs**
* WorldEdit for Bukkit in **worldedit-bukkit/build/libs**
* WorldEdit for Sponge in **worldedit-sponge/build/libs**
* WorldEdit for Forge in **worldedit-forge/build/libs**

If you want to use WorldEdit, use the `-shadow` version.
If you want to use WorldEdit, use the `-dist` version.

(The -shadow version includes WorldEdit + necessary libraries.)
(The -dist version includes WorldEdit + necessary libraries.)

### Note regarding `setupDecompWorkspace`
`setupDecompWorkspace` requires more memory than is usually given to Gradle by default.
If it fails, you should put `org.gradle.jvmargs=-Xmx3G` in `gradle.properties`.
Please don't commit this change!

## Other commands

* `gradlew idea` will generate an [IntelliJ IDEA](http://www.jetbrains.com/idea/) module for the Forge module.
* `gradlew eclipse` will generate an [Eclipse](https://www.eclipse.org/downloads/) project for the Forge version.
* `gradlew idea` will generate an [IntelliJ IDEA](http://www.jetbrains.com/idea/) module for each folder.
* `gradlew eclipse` will generate an [Eclipse](https://www.eclipse.org/downloads/) project for each folder.
* Use `setupCIWorkspace` instead of `setupDecompWorkspace` if you are doing this on a CI server.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Expand Up @@ -8,9 +8,9 @@ ask that you make note of the following guidelines.
* **Follow the [Oracle coding conventions](http://www.oracle.com/technetwork/java/codeconv-138413.html).**
We can't stress this enough; if your code has notable issues, it may delay
the process significantly.
* **Target Java 6 for source and compilation.** Make sure to mark methods with
* **Target Java 7 for source and compilation.** Make sure to mark methods with
` @Override` that override methods of parent classes, or that implement
methods of interfaces (Java 6+).
methods of interfaces.
* **Use only spaces for indentation.** Our indents are 4-spaces long, and tabs
are unacceptable.
* **Wrap code to a 120 column limit.** We do this to make side by side diffs
Expand Down
23 changes: 15 additions & 8 deletions build.gradle
Expand Up @@ -21,26 +21,29 @@ buildscript {

configurations.all {
resolutionStrategy {
force 'com.google.guava:guava:17.0'
force 'com.google.guava:guava:21.0'
}
}

dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.3'
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:4.4.0'
classpath 'org.ajoberstar:gradle-git:1.4.2'
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:4.3.0'
classpath 'org.ajoberstar:gradle-git:1.5.1'
}
}

allprojects {
group = 'com.sk89q.worldedit'
version = '6.1.8-SNAPSHOT'
}

if (!project.hasProperty("artifactory_contextUrl")) ext.artifactory_contextUrl = "http://localhost"
if (!project.hasProperty("artifactory_user")) ext.artifactory_user = "guest"
if (!project.hasProperty("artifactory_password")) ext.artifactory_password = ""

if (!project.hasProperty("gitCommitHash") && !JavaVersion.current().isJava6()) {
try {
def Grgit = Class.forName("org.ajoberstar.grgit.Grgit");
def Grgit_open = Grgit.getDeclaredMethod("open", File.class)
def repo = Grgit_open.invoke(null, project.file('.'))
def repo = org.ajoberstar.grgit.Grgit.open(dir: '.')
ext.gitCommitHash = repo.head().abbreviatedId
} catch (Exception e) {
println "Error getting commit hash: " + e.getMessage()
Expand All @@ -59,6 +62,7 @@ artifactory {
username = "${artifactory_user}"
password = "${artifactory_password}"
maven = true
ivy = false
}
}

Expand All @@ -71,6 +75,7 @@ artifactory {
}
}
}
artifactoryPublish.skip = true

subprojects {
apply plugin: 'java'
Expand All @@ -79,8 +84,6 @@ subprojects {
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'com.jfrog.artifactory'

group = 'com.sk89q.worldedit'
version = '7.0-SNAPSHOT'
ext.internalVersion = version + ";" + gitCommitHash

sourceCompatibility = 1.7
Expand Down Expand Up @@ -139,4 +142,8 @@ subprojects {
exclude '.cache'
exclude 'LICENSE*'
}

artifactoryPublish {
publishConfigs('archives')
}
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
#Thu May 05 15:11:12 PDT 2016
#Wed Feb 22 23:32:37 PST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-3.4-bin.zip
22 changes: 15 additions & 7 deletions gradlew
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/usr/bin/env sh

##############################################################################
##
Expand Down Expand Up @@ -154,11 +154,19 @@ if $cygwin ; then
esac
fi

# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
# Escape application args
save ( ) {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
APP_ARGS=$(save "$@")

exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi

exec "$JAVACMD" "$@"
6 changes: 0 additions & 6 deletions gradlew.bat
Expand Up @@ -49,7 +49,6 @@ goto fail
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args

:win9xME_args
@rem Slurp the command line arguments.
Expand All @@ -60,11 +59,6 @@ set _SKIP=2
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*
goto execute

:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$

:execute
@rem Setup the command line
Expand Down
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion worldedit-bukkit/src/main/resources/defaults/config.yml
Expand Up @@ -29,7 +29,7 @@ limits:
butcher-radius:
default: -1
maximum: -1
disallowed-blocks: [6, 7, 14, 15, 16, 26, 27, 28, 29, 39, 31, 32, 33, 34, 36, 37, 38, 39, 40, 46, 50, 51, 56, 59, 69, 73, 74, 75, 76, 77, 81, 83]
disallowed-blocks: [6, 7, 14, 15, 16, 26, 27, 28, 29, 39, 31, 32, 33, 34, 36, 37, 38, 39, 40, 46, 50, 51, 56, 59, 69, 73, 74, 75, 76, 77, 81, 83, 137, 210, 211, 255]

use-inventory:
enable: false
Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion worldedit-core/build.gradle
Expand Up @@ -5,7 +5,7 @@ dependencies {
compile 'de.schlichtherle:truezip:6.8.3'
compile 'rhino:js:1.7R2'
compile 'org.yaml:snakeyaml:1.9'
compile 'com.google.guava:guava:17.0'
compile 'com.google.guava:guava:21.0'
compile 'com.sk89q:jchronic:0.2.4a'
compile 'com.google.code.findbugs:jsr305:1.3.9'
compile 'com.thoughtworks.paranamer:paranamer:2.6'
Expand Down
Expand Up @@ -59,6 +59,7 @@
import com.sk89q.worldedit.internal.expression.Expression;
import com.sk89q.worldedit.internal.expression.ExpressionException;
import com.sk89q.worldedit.internal.expression.runtime.RValue;
import com.sk89q.worldedit.math.MathUtils;
import com.sk89q.worldedit.math.interpolation.Interpolation;
import com.sk89q.worldedit.math.interpolation.KochanekBartelsInterpolation;
import com.sk89q.worldedit.math.interpolation.Node;
Expand Down Expand Up @@ -974,8 +975,9 @@ public int center(Region region, Pattern pattern) throws MaxChangedBlocksExcepti
Vector center = region.getCenter();
Region centerRegion = new CuboidRegion(
getWorld(), // Causes clamping of Y range
new Vector((int) center.getX(), (int) center.getY(), (int) center.getZ()),
center.toBlockVector());
new Vector(((int) center.getX()), ((int) center.getY()), ((int) center.getZ())),
new Vector(MathUtils.roundHalfUp(center.getX()),
center.getY(), MathUtils.roundHalfUp(center.getZ())));
return setBlocks(centerRegion, pattern);
}

Expand Down
Expand Up @@ -247,6 +247,41 @@ public final class BlockID {
public static final int RED_NETHER_BRICK = 215;
public static final int BONE_BLOCK = 216;
public static final int STRUCTURE_VOID = 217;
public static final int OBSERVER = 218;
public static final int SHULKER_BOX_WHITE = 219;
public static final int SHULKER_BOX_ORANGE = 220;
public static final int SHULKER_BOX_MAGENTA = 221;
public static final int SHULKER_BOX_LIGHT_BLUE = 222;
public static final int SHULKER_BOX_YELLOW = 223;
public static final int SHULKER_BOX_LIME = 224;
public static final int SHULKER_BOX_PINK = 225;
public static final int SHULKER_BOX_GRAY = 226;
public static final int SHULKER_BOX_LIGHT_GRAY = 227;
public static final int SHULKER_BOX_CYAN = 228;
public static final int SHULKER_BOX_PURPLE = 229;
public static final int SHULKER_BOX_BLUE = 230;
public static final int SHULKER_BOX_BROWN = 231;
public static final int SHULKER_BOX_GREEN = 232;
public static final int SHULKER_BOX_RED = 233;
public static final int SHULKER_BOX_BLACK = 234;
public static final int TERRACOTTA_WHITE = 235;
public static final int TERRACOTTA_ORANGE = 236;
public static final int TERRACOTTA_MAGENTA = 237;
public static final int TERRACOTTA_LIGHT_BLUE = 238;
public static final int TERRACOTTA_YELLOW = 239;
public static final int TERRACOTTA_LIME = 240;
public static final int TERRACOTTA_PINK = 241;
public static final int TERRACOTTA_GRAY = 242;
public static final int TERRACOTTA_LIGHT_GRAY = 243;
public static final int TERRACOTTA_CYAN = 244;
public static final int TERRACOTTA_PURPLE = 245;
public static final int TERRACOTTA_BLUE = 246;
public static final int TERRACOTTA_BROWN = 247;
public static final int TERRACOTTA_GREEN = 248;
public static final int TERRACOTTA_RED = 249;
public static final int TERRACOTTA_BLACK = 250;
public static final int CONCRETE = 251;
public static final int CONCRETE_POWDER = 252;
public static final int STRUCTURE_BLOCK = 255;

private BlockID() {
Expand Down
Expand Up @@ -135,7 +135,6 @@ public enum BlockType {
CAKE(BlockID.CAKE_BLOCK, "Cake", "cake", "cakeblock"),
REDSTONE_REPEATER_OFF(BlockID.REDSTONE_REPEATER_OFF, "Redstone repeater (off)", "diodeoff", "redstonerepeater", "repeateroff", "delayeroff"),
REDSTONE_REPEATER_ON(BlockID.REDSTONE_REPEATER_ON, "Redstone repeater (on)", "diodeon", "redstonerepeateron", "repeateron", "delayeron"),
@Deprecated LOCKED_CHEST(BlockID.LOCKED_CHEST, "thisblockisinvalidusedstainedglassinstead"),
STAINED_GLASS(BlockID.STAINED_GLASS, "Stained Glass", "stainedglass"),
TRAP_DOOR(BlockID.TRAP_DOOR, "Trap door", "trapdoor", "hatch", "floordoor"),
SILVERFISH_BLOCK(BlockID.SILVERFISH_BLOCK, "Silverfish block", "silverfish", "silver"),
Expand Down Expand Up @@ -259,6 +258,41 @@ public enum BlockType {
RED_NETHER_BRICK(BlockID.RED_NETHER_BRICK, "Red Nether Brick", "rednetherbrick", "netherbrickred"),
BONE_BLOCK(BlockID.BONE_BLOCK, "Bone Block", "boneblock", "blockbone", "fossil", "fossilblock", "blockfossil"),
STRUCTURE_VOID(BlockID.STRUCTURE_VOID, "Structure Void", "structurevoid", "structureair"),
OBSERVER(BlockID.OBSERVER, "Observer", "observer", "blockupdatedetector"),
SHULKER_BOX_WHITE(BlockID.SHULKER_BOX_WHITE, "White Shulker Box", "shulkerboxwhite"),
SHULKER_BOX_ORANGE(BlockID.SHULKER_BOX_ORANGE, "Orange Shulker Box", "shulkerboxorange"),
SHULKER_BOX_MAGENTA(BlockID.SHULKER_BOX_MAGENTA, "Magenta Shulker Box", "shulkerboxmagenta"),
SHULKER_BOX_LIGHT_BLUE(BlockID.SHULKER_BOX_LIGHT_BLUE, "Light Blue Shulker Box", "shulkerboxlightblue"),
SHULKER_BOX_YELLOW(BlockID.SHULKER_BOX_YELLOW, "Yellow Shulker Box", "shulkerboxyellow"),
SHULKER_BOX_LIME(BlockID.SHULKER_BOX_LIME, "Lime Shulker Box", "shulkerboxlime"),
SHULKER_BOX_PINK(BlockID.SHULKER_BOX_PINK, "Pink Shulker Box", "shulkerboxpink"),
SHULKER_BOX_GRAY(BlockID.SHULKER_BOX_GRAY, "Gray Shulker Box", "shulkerboxgray"),
SHULKER_BOX_LIGHT_GRAY(BlockID.SHULKER_BOX_LIGHT_GRAY, "Light Gray Shulker Box", "shulkerboxlightgray"),
SHULKER_BOX_CYAN(BlockID.SHULKER_BOX_CYAN, "Cyan Shulker Box", "shulkerboxcyan"),
SHULKER_BOX_PURPLE(BlockID.SHULKER_BOX_PURPLE, "Purple Shulker Box", "shulkerboxpurple"),
SHULKER_BOX_BLUE(BlockID.SHULKER_BOX_BLUE, "Blue Shulker Box", "shulkerboxblue"),
SHULKER_BOX_BROWN(BlockID.SHULKER_BOX_BROWN, "Brown Shulker Box", "shulkerboxbrown"),
SHULKER_BOX_GREEN(BlockID.SHULKER_BOX_GREEN, "Green Shulker Box", "shulkerboxgreen"),
SHULKER_BOX_RED(BlockID.SHULKER_BOX_RED, "Red Shulker Box", "shulkerboxred"),
SHULKER_BOX_BLACK(BlockID.SHULKER_BOX_BLACK, "Black Shulker Box", "shulkerboxblack"),
TERRACOTTA_WHITE(BlockID.TERRACOTTA_WHITE, "White Terracotta", "terracottawhite"),
TERRACOTTA_ORANGE(BlockID.TERRACOTTA_ORANGE, "Orange Terracotta", "terracottaorange"),
TERRACOTTA_MAGENTA(BlockID.TERRACOTTA_MAGENTA, "Magenta Terracotta", "terracottamagenta"),
TERRACOTTA_LIGHT_BLUE(BlockID.TERRACOTTA_LIGHT_BLUE, "Light Blue Terracotta", "terracottalightblue"),
TERRACOTTA_YELLOW(BlockID.TERRACOTTA_YELLOW, "Yellow Terracotta", "terracottayellow"),
TERRACOTTA_LIME(BlockID.TERRACOTTA_LIME, "Lime Terracotta", "terracottalime"),
TERRACOTTA_PINK(BlockID.TERRACOTTA_PINK, "Pink Terracotta", "terracottapink"),
TERRACOTTA_GRAY(BlockID.TERRACOTTA_GRAY, "Gray Terracotta", "terracottagray"),
TERRACOTTA_LIGHT_GRAY(BlockID.TERRACOTTA_LIGHT_GRAY, "Light Gray Terracotta", "terracottalightgray"),
TERRACOTTA_CYAN(BlockID.TERRACOTTA_CYAN, "Cyan Terracotta", "terracottacyan"),
TERRACOTTA_PURPLE(BlockID.TERRACOTTA_PURPLE, "Purple Terracotta", "terracottapurple"),
TERRACOTTA_BLUE(BlockID.TERRACOTTA_BLUE, "Blue Terracotta", "terracottablue"),
TERRACOTTA_BROWN(BlockID.TERRACOTTA_BROWN, "Brown Terracotta", "terracottabrown"),
TERRACOTTA_GREEN(BlockID.TERRACOTTA_GREEN, "Green Terracotta", "terracottagreen"),
TERRACOTTA_RED(BlockID.TERRACOTTA_RED, "Red Terracotta", "terracottared"),
TERRACOTTA_BLACK(BlockID.TERRACOTTA_BLACK, "Black Terracotta", "terracottablack"),
CONCRETE(BlockID.CONCRETE, "Concrete", "concrete"),
CONCRETE_POWDER(BlockID.CONCRETE_POWDER, "Concrete Powder", "concretepowder"),
STRUCTURE_BLOCK(BlockID.STRUCTURE_BLOCK, "Structure Block", "structureblock");

/**
Expand Down
Expand Up @@ -177,6 +177,14 @@ public final class ItemID {
public static final int NETHER_QUARTZ = 406;
public static final int TNT_MINECART = 407;
public static final int HOPPER_MINECART = 408;
public static final int PRISMARINE_SHARD = 409;
public static final int PRISMARINE_CRYSTALS = 410;
public static final int RABBIT = 411;
public static final int COOKED_RABBIT = 412;
public static final int RABBIT_STEW = 413;
public static final int RABBIT_FOOT = 414;
public static final int RABBIT_HIDE = 415;
public static final int ARMOR_STAND = 416;
public static final int HORSE_ARMOR_IRON = 417;
public static final int HORSE_ARMOR_GOLD = 418;
public static final int HORSE_ARMOR_DIAMOND = 419;
Expand Down Expand Up @@ -209,6 +217,10 @@ public final class ItemID {
public static final int JUNGLE_BOAT = 446;
public static final int ACACIA_BOAT = 447;
public static final int DARK_OAK_BOAT = 448;
public static final int TOTEM_OF_UNDYING = 449;
public static final int SHULKER_SHELL = 450;
public static final int IRON_NUGGET = 452;
public static final int KNOWLEDGE_BOOK = 453;

@Deprecated public static final int GOLD_RECORD = 2256; // deprecated, but leave it there
@Deprecated public static final int GREEN_RECORD = 2257; // deprecated, but leave it there
Expand Down

0 comments on commit 158f0d1

Please sign in to comment.