Skip to content

Commit

Permalink
Merge pull request #28 from TotalFreedom/tfm50
Browse files Browse the repository at this point in the history
Merging into Master
  • Loading branch information
Wild1145 authored Jan 7, 2017
2 parents 58aac97 + e616d90 commit 9fd2ad5
Show file tree
Hide file tree
Showing 128 changed files with 4,402 additions and 300 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ out
run

/dependency-reduced-pom.xml
*-private.sh
*-private.sh
.nb-gradle
.nb-gradle-properties
21 changes: 16 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,19 @@ language: java
notifications:
email: false
before_install: chmod +x gradlew
install: ./gradlew setupCIWorkspace -S
matrix:
include:
- jdk: oraclejdk7
script: ./gradlew build -S
install: ./gradlew setupCIWorkspace -s
script: ./gradlew build -s
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/

# Faster builds without sudo.
sudo: false
16 changes: 16 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
6.1
- Added support for Spigot for MC 1.8.3 to 1.8.6.
- Added rotation values to lit redstone torches.
- Added banners to usesDamageValue properties list.
- Added stone to usesData properties list.
- Changed cycler tool to use undo sessions rather than changing the world directly.
- Changed PEX support to use UUIDs wherever possible.
- Fixed imprecise rotations.
- Fixed incorrect support BlockBag and EditSession support in two of the tools.
- Fixed entity rotation floating point issues.
- Fixed button rotation and added support for up/down flipping.
- Fixed armor stands being included //butcher by default.
- Fixed /butcher text in the case of only one mob being killed.
- Fixed entity counter for //remove and //butcher.
- Fixed performance issues with some commands that use lists of entities.

6.0.1
- (Forge only) Add a permissions API (temporary) for interoperability.

Expand Down
8 changes: 3 additions & 5 deletions COMPILING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ The build process uses Gradle, which you do *not* need to download. WorldEdit is
### On Windows

1. Shift + right click the folder with WorldEdit's files and click "Open command prompt".
2. `gradlew clean setupDevWorkspace`
2. `gradlew clean setupDecompWorkspace`
3. `gradlew build`

### On Linux, BSD, or Mac OS X

1. In your terminal, navigate to the folder with WorldEdit's files (`cd /folder/of/worldedit/files`)
2. `./gradlew clean setupDevWorkspace`
2. `./gradlew clean setupDecompWorkspace`
3. `./gradlew build`

## Then you will find...
Expand All @@ -39,6 +39,4 @@ If you want to use WorldEdit, use the `-shadow` version.

* `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.
* Use `setupCIWorkspace` instead of `setupDevWorkspace` if you are doing this on a CI server.

Note: Rather than `setupDevWorkspace`, `setupDecompWorkspace` would you give better decompiled code for developing the Forge mod, but it is currently incompatible with multi-module projects like WorldEdit.
* Use `setupCIWorkspace` instead of `setupDecompWorkspace` if you are doing this on a CI server.
16 changes: 8 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
println """
*******************************************
You are building WorldEdit!
You are building WorldEdit!
If you encounter trouble:
1) Read COMPILING.md if you haven't yet
Expand All @@ -21,7 +21,7 @@ buildscript {

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

Expand All @@ -48,18 +48,18 @@ if (!project.hasProperty("gitCommitHash")) {
subprojects {
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'checkstyle'
//apply plugin: 'checkstyle'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'com.jfrog.artifactory-upload'

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

sourceCompatibility = 1.6
targetCompatibility = 1.6

checkstyle.configFile = new File(rootProject.projectDir, "config/checkstyle/checkstyle.xml")
//checkstyle.configFile = new File(rootProject.projectDir, "config/checkstyle/checkstyle.xml")

repositories {
mavenCentral()
Expand Down Expand Up @@ -91,8 +91,8 @@ subprojects {
archives javadocJar
}

build.dependsOn(checkstyleMain)
build.dependsOn(checkstyleTest)
//build.dependsOn(checkstyleMain)
//build.dependsOn(checkstyleTest)
build.dependsOn(sourcesJar)
build.dependsOn(javadocJar)

Expand All @@ -116,7 +116,7 @@ subprojects {
username = "${artifactory_user}"
password = "${artifactory_password}"
maven = true

}
}

Expand Down
4 changes: 3 additions & 1 deletion config/checkstyle/import-control.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,13 @@
</subpackage>

<subpackage name="forge">
<allow pkg="codechicken.multipart"/>
<allow pkg="cpw"/>
<allow pkg="net.minecraft"/>
<allow pkg="net.minecraftforge"/>
<allow pkg="com.mojang.authlib"/>
<allow pkg="org.apache.logging.log4j"/>
<allow pkg="org.lwjgl"/>
</subpackage>
</subpackage>
</import-control>
</import-control>
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
rootProject.name = 'worldedit'

include 'worldedit-core', 'worldedit-bukkit', 'worldedit-forge'
include 'worldedit-core', 'worldedit-bukkit'
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class BukkitCommandInspector implements CommandInspector {
public String getShortText(Command command) {
CommandMapping mapping = dispatcher.get(command.getName());
if (mapping != null) {
return mapping.getDescription().getShortDescription();
return mapping.getDescription().getDescription();
} else {
logger.warning("BukkitCommandInspector doesn't know how about the command '" + command + "'");
return "Help text not available";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public void registerCommands(Dispatcher dispatcher) {
String[] permissionsArray = new String[permissions.size()];
permissions.toArray(permissionsArray);

toRegister.add(new CommandInfo(description.getUsage(), description.getShortDescription(), command.getAllAliases(), inspector, permissionsArray));
toRegister.add(new CommandInfo(description.getUsage(), description.getDescription(), command.getAllAliases(), inspector, permissionsArray));
}

dynamicCommands.register(toRegister);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,9 @@ public boolean generateTallRedwoodTree(EditSession editSession, Vector pt) {
treeTypeMapping.put(TreeGenerator.TreeType.RANDOM, TreeType.BROWN_MUSHROOM);
treeTypeMapping.put(TreeGenerator.TreeType.RANDOM_REDWOOD, TreeType.REDWOOD);
treeTypeMapping.put(TreeGenerator.TreeType.PINE, TreeType.REDWOOD);
treeTypeMapping.put(TreeGenerator.TreeType.RANDOM_BIRCH, TreeType.BIRCH);
treeTypeMapping.put(TreeGenerator.TreeType.RANDOM_JUNGLE, TreeType.JUNGLE);
treeTypeMapping.put(TreeGenerator.TreeType.RANDOM_MUSHROOM, TreeType.BROWN_MUSHROOM);
for (TreeGenerator.TreeType type : TreeGenerator.TreeType.values()) {
if (treeTypeMapping.get(type) == null) {
WorldEdit.logger.severe("No TreeType mapping for TreeGenerator.TreeType." + type);
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
4 changes: 3 additions & 1 deletion worldedit-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ dependencies {
compile 'de.schlichtherle:truezip:6.8.3'
compile 'rhino:js:1.7R2'
compile 'org.yaml:snakeyaml:1.9'
compile 'com.google.guava:guava:18.0'
compile 'com.google.guava:guava:17.0'
compile 'com.sk89q:jchronic:0.2.4a'
compile 'com.google.code.findbugs:jsr305:1.3.9'
compile 'com.thoughtworks.paranamer:paranamer:2.6'
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.sk89q.lib:jlibnoise:1.0.0'
compile 'org.sk89q.bukkit:bukkit-classloader-check:1.7.9-R0.2'
compile 'org.bukkit:bukkit:1.7.9-R0.2'
//compile 'net.sf.trove4j:trove4j:3.0.3'
testCompile 'org.mockito:mockito-core:1.9.0-rc1'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,32 @@ public CommandContext(String[] args, Set<Character> valueFlags) throws CommandEx

/**
* Parse the given array of arguments.
*
*
* <p>Empty arguments are removed from the list of arguments.</p>
*
*
* @param args an array with arguments
* @param valueFlags a set containing all value flags (pass null to disable value flag parsing)
* @param allowHangingFlag true if hanging flags are allowed
* @param locals the locals, null to create empty one
* @throws CommandException thrown on a parsing error
*/
public CommandContext(String[] args, Set<Character> valueFlags,
boolean allowHangingFlag, CommandLocals locals) throws CommandException {
public CommandContext(String[] args, Set<Character> valueFlags, boolean allowHangingFlag, CommandLocals locals) throws CommandException {
this(args, valueFlags, allowHangingFlag, locals, true);
}

/**
* Parse the given array of arguments.
*
* <p>Empty arguments are removed from the list of arguments.</p>
*
* @param args an array with arguments
* @param valueFlags a set containing all value flags (pass null to disable value flag parsing)
* @param allowHangingFlag true if hanging flags are allowed
* @param locals the locals, null to create empty one
* @param parseFlags where to parse flags
* @throws CommandException thrown on a parsing error
*/
public CommandContext(String[] args, Set<Character> valueFlags, boolean allowHangingFlag, CommandLocals locals, boolean parseFlags) throws CommandException {
if (valueFlags == null) {
valueFlags = Collections.emptySet();
}
Expand Down Expand Up @@ -140,58 +155,66 @@ public CommandContext(String[] args, Set<Character> valueFlags,
this.originalArgIndices = new ArrayList<Integer>(argIndexList.size());
this.parsedArgs = new ArrayList<String>(argList.size());

for (int nextArg = 0; nextArg < argList.size(); ) {
// Fetch argument
String arg = argList.get(nextArg++);
suggestionContext = SuggestionContext.hangingValue();
if (parseFlags) {
for (int nextArg = 0; nextArg < argList.size(); ) {
// Fetch argument
String arg = argList.get(nextArg++);
suggestionContext = SuggestionContext.hangingValue();

// Not a flag?
if (arg.charAt(0) != '-' || arg.length() == 1 || !arg.matches("^-[a-zA-Z\\?]+$")) {
if (!isHanging) {
suggestionContext = SuggestionContext.lastValue();
// Not a flag?
if (arg.charAt(0) != '-' || arg.length() == 1 || !arg.matches("^-[a-zA-Z\\?]+$")) {
if (!isHanging) {
suggestionContext = SuggestionContext.lastValue();
}

originalArgIndices.add(argIndexList.get(nextArg - 1));
parsedArgs.add(arg);
continue;
}

originalArgIndices.add(argIndexList.get(nextArg - 1));
parsedArgs.add(arg);
continue;
}

// Handle flag parsing terminator --
if (arg.equals("--")) {
while (nextArg < argList.size()) {
originalArgIndices.add(argIndexList.get(nextArg));
parsedArgs.add(argList.get(nextArg++));
// Handle flag parsing terminator --
if (arg.equals("--")) {
while (nextArg < argList.size()) {
originalArgIndices.add(argIndexList.get(nextArg));
parsedArgs.add(argList.get(nextArg++));
}
break;
}
break;
}

// Go through the flag characters
for (int i = 1; i < arg.length(); ++i) {
char flagName = arg.charAt(i);
// Go through the flag characters
for (int i = 1; i < arg.length(); ++i) {
char flagName = arg.charAt(i);

if (valueFlags.contains(flagName)) {
if (this.valueFlags.containsKey(flagName)) {
throw new CommandException("Value flag '" + flagName + "' already given");
}
if (valueFlags.contains(flagName)) {
if (this.valueFlags.containsKey(flagName)) {
throw new CommandException("Value flag '" + flagName + "' already given");
}

if (nextArg >= argList.size()) {
if (allowHangingFlag) {
suggestionContext = SuggestionContext.flag(flagName);
break;
} else {
throw new CommandException("No value specified for the '-" + flagName + "' flag.");
if (nextArg >= argList.size()) {
if (allowHangingFlag) {
suggestionContext = SuggestionContext.flag(flagName);
break;
} else {
throw new CommandException("No value specified for the '-" + flagName + "' flag.");
}
}
}

// If it is a value flag, read another argument and add it
this.valueFlags.put(flagName, argList.get(nextArg++));
if (!isHanging) {
suggestionContext = SuggestionContext.flag(flagName);
// If it is a value flag, read another argument and add it
this.valueFlags.put(flagName, argList.get(nextArg++));
if (!isHanging) {
suggestionContext = SuggestionContext.flag(flagName);
}
} else {
booleanFlags.add(flagName);
}
} else {
booleanFlags.add(flagName);
}
}
} else {
for (int i = 0; i < argList.size(); i++) {
String arg = argList.get(i);
originalArgIndices.add(argIndexList.get(i));
parsedArgs.add(arg);
}
}

this.suggestionContext = suggestionContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

package com.sk89q.worldedit;

import static com.google.common.base.Preconditions.checkNotNull;
import com.sk89q.jchronic.Chronic;
import com.sk89q.jchronic.Options;
import com.sk89q.jchronic.utils.Span;
Expand All @@ -44,16 +45,13 @@
import com.sk89q.worldedit.session.request.Request;
import com.sk89q.worldedit.world.World;
import com.sk89q.worldedit.world.snapshot.Snapshot;

import javax.annotation.Nullable;
import java.util.Calendar;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Map;
import java.util.TimeZone;
import java.util.concurrent.atomic.AtomicBoolean;

import static com.google.common.base.Preconditions.checkNotNull;
import javax.annotation.Nullable;

/**
* Stores session information.
Expand Down Expand Up @@ -613,7 +611,6 @@ public Tool getTool(int item) {
* @return the tool, or {@code null}
* @throws InvalidToolBindException if the item can't be bound to that item
*/
@Nullable
public BrushTool getBrushTool(int item) throws InvalidToolBindException {
Tool tool = getTool(item);

Expand Down Expand Up @@ -703,6 +700,10 @@ public void dispatchCUIEvent(Actor actor, CUIEvent event) {
if (hasCUISupport) {
actor.dispatchCUIEvent(event);
}

if (actor instanceof com.sk89q.worldedit.entity.Player) {
me.totalfreedom.worldedit.WorldEditHandler.selectionChanged((com.sk89q.worldedit.entity.Player) actor);
}
}

/**
Expand Down
Loading

0 comments on commit 9fd2ad5

Please sign in to comment.