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

This commit is contained in:
IronApollo
2019-01-13 02:00:14 -05:00
214 changed files with 1720 additions and 2063 deletions

View File

@ -19,10 +19,10 @@
package com.sk89q.worldedit.util;
import javax.annotation.Nullable;
import static com.google.common.base.Preconditions.checkNotNull;
import javax.annotation.Nullable;
/**
* Helper methods for enums.
*/

View File

@ -21,13 +21,14 @@ package com.sk89q.worldedit.util;
import com.sk89q.util.StringUtil;
import javax.swing.*;
import javax.swing.filechooser.FileFilter;
import java.io.File;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import javax.swing.JFileChooser;
import javax.swing.filechooser.FileFilter;
public final class FileDialogUtil {
private FileDialogUtil() {
}

View File

@ -19,10 +19,10 @@
package com.sk89q.worldedit.util;
import javax.annotation.Nullable;
import static com.google.common.base.Preconditions.checkNotNull;
import javax.annotation.Nullable;
public final class GuavaUtil {
private GuavaUtil() {}

View File

@ -25,7 +25,6 @@ import com.sk89q.worldedit.MaxChangedBlocksException;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.world.block.BlockState;
import com.sk89q.worldedit.world.block.BlockStateHolder;
import com.sk89q.worldedit.world.block.BlockState;
import com.sk89q.worldedit.world.block.BlockTypes;
import java.util.Collections;

View File

@ -19,11 +19,11 @@
package com.sk89q.worldedit.util.collection;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import java.util.Map;
import java.util.NoSuchElementException;
/**

View File

@ -19,13 +19,13 @@
package com.sk89q.worldedit.util.collection;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import java.util.Iterator;
import java.util.List;
import java.util.NoSuchElementException;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
/**
* A fast iterator for lists that uses an internal index integer
* and caches the size of the list. The size of the list cannot change

View File

@ -19,10 +19,11 @@
package com.sk89q.worldedit.util.command;
import javax.annotation.Nullable;
import java.util.Collection;
import java.util.Set;
import javax.annotation.Nullable;
/**
* Executes a command based on user input.
*/

View File

@ -19,12 +19,12 @@
package com.sk89q.worldedit.util.command;
import static com.google.common.base.Preconditions.checkNotNull;
import com.sk89q.minecraft.util.commands.CommandException;
import javax.annotation.Nullable;
import static com.google.common.base.Preconditions.checkNotNull;
/**
* Thrown when a command is not used properly.
*

View File

@ -19,10 +19,11 @@
package com.sk89q.worldedit.util.command;
import javax.annotation.Nullable;
import java.util.Comparator;
import java.util.regex.Pattern;
import javax.annotation.Nullable;
/**
* Compares the primary aliases of two {@link CommandMapping} using
* {@link String#compareTo(String)}.

View File

@ -112,7 +112,7 @@ public class SimpleDispatcher implements Dispatcher {
@Override
public Object call(String arguments, CommandLocals locals, String[] parentCommands) throws CommandException {
// We have permission for this command if we have permissions for subcommands
if (!testPermission(locals)) {
if (parentCommands.length != 0 && !testPermission(locals)) {
throw new CommandPermissionsException();
}

View File

@ -28,9 +28,10 @@ import com.sk89q.worldedit.util.command.parametric.BindingHelper;
import com.sk89q.worldedit.util.command.parametric.BindingMatch;
import com.sk89q.worldedit.util.command.parametric.ParameterException;
import javax.annotation.Nullable;
import java.lang.annotation.Annotation;
import javax.annotation.Nullable;
/**
* Handles basic Java types such as {@link String}s, {@link Byte}s, etc.
*
@ -86,8 +87,8 @@ public final class PrimitiveBindings extends BindingHelper {
* @throws ParameterException on error
*/
@BindingMatch(type = { Boolean.class, boolean.class },
behavior = BindingBehavior.CONSUMES,
consumedCount = 1)
behavior = BindingBehavior.CONSUMES,
consumedCount = 1)
public Boolean getBoolean(ArgumentStack context) throws ParameterException {
return context.nextBoolean();
}
@ -117,6 +118,7 @@ public final class PrimitiveBindings extends BindingHelper {
throw new ParameterException(String.format(
"Expected '%s' to be a number or valid math expression (error: %s)", input, e.getMessage()));
}
}
}

View File

@ -25,15 +25,16 @@ import com.google.common.collect.Maps;
import com.sk89q.minecraft.util.commands.CommandException;
import com.sk89q.minecraft.util.commands.CommandLocals;
import com.sk89q.worldedit.util.command.argument.CommandArgs;
import com.sk89q.worldedit.util.command.composition.FlagParser.FlagData;
import com.sk89q.worldedit.util.command.argument.MissingArgumentException;
import com.sk89q.worldedit.util.command.composition.FlagParser.FlagData;
import javax.annotation.Nullable;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import javax.annotation.Nullable;
public class FlagParser implements CommandExecutor<FlagData> {
private final Map<Character, CommandExecutor<?>> flags = Maps.newHashMap();

View File

@ -201,7 +201,7 @@ public class ParametricCallable extends AParametricCallable {
@Override
public Object call(String stringArguments, CommandLocals locals, String[] parentCommands) throws CommandException {
// Test permission
if (!testPermission(locals)) {
if (parentCommands.length != 0 && !testPermission(locals)) {
throw new CommandPermissionsException();
}
locals.putIfAbsent(CommandCallable.class, this);

View File

@ -19,10 +19,10 @@
package com.sk89q.worldedit.util.eventbus;
import java.lang.reflect.InvocationTargetException;
import static com.google.common.base.Preconditions.checkNotNull;
import java.lang.reflect.InvocationTargetException;
/**
* Event handler object for {@link EventBus} that is able to dispatch
* an event.

View File

@ -23,7 +23,11 @@ import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import com.sk89q.worldedit.internal.annotation.RequiresNewerGuava;
import java.util.*;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.WeakHashMap;
/**
* Holds a cache of class hierarchy.

View File

@ -19,10 +19,10 @@
package com.sk89q.worldedit.util.eventbus;
import java.lang.reflect.Method;
import static com.google.common.base.Preconditions.checkNotNull;
import java.lang.reflect.Method;
/**
* Invokes a {@link Method} to dispatch an event.
*/

View File

@ -19,12 +19,12 @@
package com.sk89q.worldedit.util.eventbus;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.*;
/**
* Used to mark methods as event handlers.
*/

View File

@ -25,7 +25,7 @@ package com.sk89q.worldedit.util.formatting;
public class Fragment {
private final StringBuilder builder = new StringBuilder();
public Fragment() {
}
@ -88,6 +88,5 @@ public class Fragment {
public String toString() {
return builder.toString();
}
}

View File

@ -19,14 +19,14 @@
package com.sk89q.worldedit.util.formatting;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import com.google.common.collect.Maps;
import java.util.Map;
import java.util.regex.Pattern;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
/**
* All supported color values for chat.
*
@ -221,7 +221,7 @@ public enum Style {
* ChatColor.COLOR_CODE color code character. The alternate color code character will only be replaced
* if it is immediately followed by 0-9, A-F, a-f, K-O, k-o, R or r.
*
* @param altColorChar The alternate color code character to replace. Ex: &
* @param altColorChar The alternate color code character to replace. Ex: &amp;
* @param textToTranslate Text containing the alternate color code character.
* @return Text containing the ChatColor.COLOR_CODE color code character.
*/

View File

@ -19,12 +19,13 @@
package com.sk89q.worldedit.util.function;
import static com.google.common.base.Preconditions.checkNotNull;
import com.google.common.base.Function;
import javax.annotation.Nullable;
import java.util.regex.Pattern;
import static com.google.common.base.Preconditions.checkNotNull;
import javax.annotation.Nullable;
/**
* Provides a Levenshtein distance between a given string and each string

View File

@ -19,6 +19,8 @@
package com.sk89q.worldedit.util.io;
import static com.google.common.base.Preconditions.checkNotNull;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Throwables;
@ -31,8 +33,6 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.zip.ZipFile;
import static com.google.common.base.Preconditions.checkNotNull;
public final class Closer implements Closeable {
private static final Logger logger = Logger.getLogger(Closer.class.getCanonicalName());

View File

@ -19,11 +19,11 @@
package com.sk89q.worldedit.util.logging;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.Date;
import java.util.logging.Formatter;
import java.util.logging.LogRecord;
import java.io.PrintWriter;
import java.io.StringWriter;
/**
* A standard logging format for WorldEdit.