Little bit of formatting

Dieser Commit ist enthalten in:
Matthew Miller 2018-08-27 17:24:18 +10:00
Ursprung fb5cb9a7bb
Commit c931095736
46 geänderte Dateien mit 76 neuen und 86 gelöschten Zeilen

Datei anzeigen

@ -35,6 +35,6 @@ public interface Injector {
* @throws InstantiationException thrown on injection fault
* @throws InvocationTargetException thrown on injection fault
*/
public Object getInstance(Class<?> cls) throws InvocationTargetException, IllegalAccessException, InstantiationException;
Object getInstance(Class<?> cls) throws InvocationTargetException, IllegalAccessException, InstantiationException;
}

Datei anzeigen

@ -31,7 +31,7 @@ import java.lang.annotation.RetentionPolicy;
@Retention(RetentionPolicy.RUNTIME)
public @interface Logging {
public enum LogMode {
enum LogMode {
/**
* Player position
*/

Datei anzeigen

@ -151,7 +151,7 @@ public class YAMLNode {
return;
}
if (o == null || !(o instanceof Map)) {
if (!(o instanceof Map)) {
// This will override existing configuration data!
o = new LinkedHashMap<String, Object>();
node.put(parts[i], o);

Datei anzeigen

@ -481,10 +481,10 @@ public class WorldEdit {
int size = missingBlocks.size();
int i = 0;
for (BlockType id : missingBlocks.keySet()) {
str.append(id.getName());
for (Map.Entry<BlockType, Integer> blockTypeIntegerEntry : missingBlocks.entrySet()) {
str.append((blockTypeIntegerEntry.getKey()).getName());
str.append(" [Amt: ").append(missingBlocks.get(id)).append("]");
str.append(" [Amt: ").append(blockTypeIntegerEntry.getValue()).append("]");
++i;
@ -559,7 +559,7 @@ public class WorldEdit {
Request.reset();
String filename = f.getPath();
int index = filename.lastIndexOf(".");
int index = filename.lastIndexOf('.');
String ext = filename.substring(index + 1);
if (!ext.equalsIgnoreCase("js")) {

Datei anzeigen

@ -55,7 +55,7 @@ public enum MobType {
private final String name;
private MobType(String name) {
MobType(String name) {
this.name = name;
}

Datei anzeigen

@ -32,7 +32,6 @@ import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.entity.Player;
import com.sk89q.worldedit.extension.platform.Actor;
import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard;
import com.sk89q.worldedit.extent.clipboard.Clipboard;
import com.sk89q.worldedit.function.block.BlockReplace;

Datei anzeigen

@ -27,5 +27,5 @@ import com.sk89q.worldedit.util.Location;
public interface BlockTool extends Tool {
public boolean actPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session, Location clicked);
boolean actPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session, Location clicked);
}

Datei anzeigen

@ -30,6 +30,6 @@ import com.sk89q.worldedit.util.Location;
*/
public interface DoubleActionBlockTool extends BlockTool {
public boolean actSecondary(Platform server, LocalConfiguration config, Player player, LocalSession session, Location clicked);
boolean actSecondary(Platform server, LocalConfiguration config, Player player, LocalSession session, Location clicked);
}

Datei anzeigen

@ -29,6 +29,6 @@ import com.sk89q.worldedit.extension.platform.Platform;
*/
public interface DoubleActionTraceTool extends TraceTool {
public boolean actSecondary(Platform server, LocalConfiguration config, Player player, LocalSession session);
boolean actSecondary(Platform server, LocalConfiguration config, Player player, LocalSession session);
}

Datei anzeigen

@ -29,7 +29,6 @@ import com.sk89q.worldedit.extension.platform.Platform;
import com.sk89q.worldedit.function.pattern.Pattern;
import com.sk89q.worldedit.util.Location;
import com.sk89q.worldedit.world.block.BlockStateHolder;
import com.sk89q.worldedit.world.block.BlockTypes;
/**
* A tool that can place (or remove) blocks at a distance.

Datei anzeigen

@ -34,6 +34,6 @@ public interface Tool {
* @param actor the actor
* @return true if use is permitted
*/
public boolean canUse(Actor actor);
boolean canUse(Actor actor);
}

Datei anzeigen

@ -26,5 +26,5 @@ import com.sk89q.worldedit.extension.platform.Platform;
public interface TraceTool extends Tool {
public boolean actPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session);
boolean actPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session);
}

Datei anzeigen

@ -38,6 +38,6 @@ public interface Brush {
* @param size the size of the brush
* @throws MaxChangedBlocksException
*/
public void build(EditSession editSession, Vector position, Pattern pattern, double size) throws MaxChangedBlocksException;
void build(EditSession editSession, Vector position, Pattern pattern, double size) throws MaxChangedBlocksException;
}

Datei anzeigen

@ -33,7 +33,6 @@ import com.sk89q.jnbt.Tag;
import com.sk89q.worldedit.BlockVector;
import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.world.block.BaseBlock;
import com.sk89q.worldedit.entity.BaseEntity;
import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard;
import com.sk89q.worldedit.extent.clipboard.Clipboard;

Datei anzeigen

@ -35,7 +35,6 @@ import com.sk89q.worldedit.BlockVector;
import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.world.block.BaseBlock;
import com.sk89q.worldedit.extension.input.InputParseException;
import com.sk89q.worldedit.extension.input.ParserContext;
import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard;

Datei anzeigen

@ -21,7 +21,6 @@ package com.sk89q.worldedit.extent.inventory;
import com.sk89q.worldedit.util.Location;
import com.sk89q.worldedit.world.block.BlockState;
import com.sk89q.worldedit.world.block.BlockTypes;
/**
* Represents a source to get blocks from and store removed ones.

Datei anzeigen

@ -26,7 +26,6 @@ import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.world.block.BlockState;
import com.sk89q.worldedit.world.block.BlockStateHolder;
import com.sk89q.worldedit.world.block.BlockType;
import com.sk89q.worldedit.world.block.BlockTypes;
import java.util.HashMap;
import java.util.Map;

Datei anzeigen

@ -27,7 +27,6 @@ import com.sk89q.worldedit.extent.AbstractDelegateExtent;
import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.world.World;
import com.sk89q.worldedit.world.block.BlockStateHolder;
import com.sk89q.worldedit.world.block.BlockTypes;
/**
* Makes changes to the world as if a player had done so during survival mode.

Datei anzeigen

@ -34,6 +34,6 @@ public interface EntityFunction {
* @return true if something was changed
* @throws WorldEditException thrown on an error
*/
public boolean apply(Entity entity) throws WorldEditException;
boolean apply(Entity entity) throws WorldEditException;
}

Datei anzeigen

@ -36,6 +36,6 @@ public interface FlatRegionFunction {
* @return true if something was changed
* @throws WorldEditException thrown on an error
*/
public boolean apply(Vector2D position) throws WorldEditException;
boolean apply(Vector2D position) throws WorldEditException;
}

Datei anzeigen

@ -34,6 +34,6 @@ public interface RegionFunction {
* @return true if something was changed
* @throws WorldEditException thrown on an error
*/
public boolean apply(Vector position) throws WorldEditException;
boolean apply(Vector position) throws WorldEditException;
}

Datei anzeigen

@ -21,7 +21,6 @@ package com.sk89q.worldedit.function.mask;
import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.world.block.BlockTypes;
import javax.annotation.Nullable;

Datei anzeigen

@ -34,6 +34,6 @@ import java.lang.annotation.Target;
@Target(ElementType.PARAMETER)
public @interface Direction {
public static final String AIM = "me";
String AIM = "me";
}

Datei anzeigen

@ -21,7 +21,7 @@ package com.sk89q.worldedit.internal.cui;
public interface CUIEvent {
public String getTypeId();
String getTypeId();
public String[] getParameters();
String[] getParameters();
}

Datei anzeigen

@ -30,7 +30,7 @@ public interface CUIRegion {
* value supplied by getProtocolVersion().
*
*/
public void describeCUI(LocalSession session, Actor player);
void describeCUI(LocalSession session, Actor player);
/**
* Sends CUI events describing the region for
@ -38,7 +38,7 @@ public interface CUIRegion {
* supplied by getProtocolVersion().
*
*/
public void describeLegacyCUI(LocalSession session, Actor player);
void describeLegacyCUI(LocalSession session, Actor player);
/**
* Returns the CUI version that is required to send
@ -47,14 +47,14 @@ public interface CUIRegion {
*
* @return the protocol version
*/
public int getProtocolVersion();
int getProtocolVersion();
/**
* Returns the type ID to send to CUI in the selection event.
*
* @return the type ID
*/
public String getTypeID();
String getTypeID();
/**
* Returns the type ID to send to CUI in the selection
@ -62,5 +62,5 @@ public interface CUIRegion {
*
* @return the legacy type ID
*/
public String getLegacyTypeID();
String getLegacyTypeID();
}

Datei anzeigen

@ -54,8 +54,8 @@ public interface Identifiable {
* C - Switch
* </pre>
*/
public abstract char id();
char id();
public int getPosition();
int getPosition();
}

Datei anzeigen

@ -27,12 +27,12 @@ import com.sk89q.worldedit.internal.expression.parser.ParserException;
*/
public interface LValue extends RValue {
public double assign(double value) throws EvaluationException;
double assign(double value) throws EvaluationException;
@Override
public LValue optimize() throws EvaluationException;
LValue optimize() throws EvaluationException;
@Override
public LValue bindVariables(Expression expression, boolean preferLValue) throws ParserException;
LValue bindVariables(Expression expression, boolean preferLValue) throws ParserException;
}

Datei anzeigen

@ -28,10 +28,10 @@ import com.sk89q.worldedit.internal.expression.parser.ParserException;
*/
public interface RValue extends Identifiable {
public double getValue() throws EvaluationException;
double getValue() throws EvaluationException;
public RValue optimize() throws EvaluationException;
RValue optimize() throws EvaluationException;
public RValue bindVariables(Expression expression, boolean preferLValue) throws ParserException;
RValue bindVariables(Expression expression, boolean preferLValue) throws ParserException;
}

Datei anzeigen

@ -160,13 +160,13 @@ public final class DocumentationPrinter {
stream.print(" || ");
if (cmd.flags() != null && !cmd.flags().equals("")) {
if (cmd.flags() != null && !cmd.flags().isEmpty()) {
stream.print(cmd.flags());
}
stream.print(" || ");
if (cmd.desc() != null && !cmd.desc().equals("")) {
if (cmd.desc() != null && !cmd.desc().isEmpty()) {
stream.print(cmd.desc());
}

Datei anzeigen

@ -36,7 +36,7 @@ public interface Interpolation {
*
* @param nodes the nodes
*/
public void setNodes(List<Node> nodes);
void setNodes(List<Node> nodes);
/**
* Gets the result of f(position)
@ -44,7 +44,7 @@ public interface Interpolation {
* @param position the position to interpolate
* @return the result
*/
public Vector getPosition(double position);
Vector getPosition(double position);
/**
* Gets the result of f'(position).
@ -52,7 +52,7 @@ public interface Interpolation {
* @param position the position to interpolate
* @return the result
*/
public Vector get1stDerivative(double position);
Vector get1stDerivative(double position);
/**
* Gets the result of &int;<sub>a</sub><sup style="position: relative; left: -1ex">b</sup>|f'(t)| dt.<br />

Datei anzeigen

@ -28,19 +28,19 @@ public interface FlatRegion extends Region {
*
* @return the Y value
*/
public int getMinimumY();
int getMinimumY();
/**
* Gets the maximum Y value
*
* @return the Y value
*/
public int getMaximumY();
int getMaximumY();
/**
* Get this region as an iterable flat region.
*
* @return a flat region iterable
*/
public Iterable<Vector2D> asFlatRegion();
Iterable<Vector2D> asFlatRegion();
}

Datei anzeigen

@ -44,14 +44,14 @@ public interface RegionSelector {
* @return a world, which may be null
*/
@Nullable
public World getWorld();
World getWorld();
/**
* Set the world for the region selector.
*
* @param world the world, which may be null
*/
public void setWorld(@Nullable World world);
void setWorld(@Nullable World world);
/**
* Called when the first point is selected.
@ -59,7 +59,7 @@ public interface RegionSelector {
* @param position the position
* @return true if something changed
*/
public boolean selectPrimary(Vector position, SelectorLimits limits);
boolean selectPrimary(Vector position, SelectorLimits limits);
/**
* Called when the second point is selected.
@ -67,7 +67,7 @@ public interface RegionSelector {
* @param position the position
* @return true if something changed
*/
public boolean selectSecondary(Vector position, SelectorLimits limits);
boolean selectSecondary(Vector position, SelectorLimits limits);
/**
* Tell the player information about his/her primary selection.
@ -76,7 +76,7 @@ public interface RegionSelector {
* @param session the session
* @param position position
*/
public void explainPrimarySelection(Actor actor, LocalSession session, Vector position);
void explainPrimarySelection(Actor actor, LocalSession session, Vector position);
/**
* Tell the player information about his/her secondary selection.
@ -85,7 +85,7 @@ public interface RegionSelector {
* @param session the session
* @param position position
*/
public void explainSecondarySelection(Actor actor, LocalSession session, Vector position);
void explainSecondarySelection(Actor actor, LocalSession session, Vector position);
/**
* The the player information about the region's changes. This may resend
@ -94,7 +94,7 @@ public interface RegionSelector {
* @param actor the actor
* @param session the session
*/
public void explainRegionAdjust(Actor actor, LocalSession session);
void explainRegionAdjust(Actor actor, LocalSession session);
/**
* Get the primary position.
@ -102,7 +102,7 @@ public interface RegionSelector {
* @return the primary position
* @throws IncompleteRegionException thrown if a region has not been fully defined
*/
public BlockVector getPrimaryPosition() throws IncompleteRegionException;
BlockVector getPrimaryPosition() throws IncompleteRegionException;
/**
* Get the selection.
@ -110,51 +110,51 @@ public interface RegionSelector {
* @return the created region
* @throws IncompleteRegionException thrown if a region has not been fully defined
*/
public Region getRegion() throws IncompleteRegionException;
Region getRegion() throws IncompleteRegionException;
/**
* Get the region even if it's not fully defined.
*
* @return an incomplete region object that is incomplete
*/
public Region getIncompleteRegion();
Region getIncompleteRegion();
/**
* Returns whether the region has been fully defined.
*
* @return true if a selection is available
*/
public boolean isDefined();
boolean isDefined();
/**
* Get the number of blocks inside the region.
*
* @return number of blocks, or -1 if undefined
*/
public int getArea();
int getArea();
/**
* Update the selector with changes to the region.
*/
public void learnChanges();
void learnChanges();
/**
* Clear the selection.
*/
public void clear();
void clear();
/**
* Get a lowercase name of this region selector type.
*
* @return a lower case name of the type
*/
public String getTypeName();
String getTypeName();
/**
* Get lines of information about the selection.
*
* @return a list of lines describing the region
*/
public List<String> getInformationLines();
List<String> getInformationLines();
}

Datei anzeigen

@ -36,7 +36,7 @@ public enum RegionSelectorType {
private final Class<? extends RegionSelector> selectorClass;
private RegionSelectorType(Class<? extends RegionSelector> selectorClass) {
RegionSelectorType(Class<? extends RegionSelector> selectorClass) {
this.selectorClass = selectorClass;
}

Datei anzeigen

@ -24,10 +24,10 @@ import java.util.Map;
import javax.script.ScriptException;
public interface CraftScriptEngine {
public void setTimeLimit(int milliseconds);
void setTimeLimit(int milliseconds);
public int getTimeLimit();
int getTimeLimit();
public Object evaluate(String script, String filename, Map<String, Object> args)
Object evaluate(String script, String filename, Map<String, Object> args)
throws ScriptException, Throwable;
}

Datei anzeigen

@ -104,7 +104,7 @@ public class SessionManager {
checkNotNull(name);
for (SessionHolder holder : sessions.values()) {
String test = holder.key.getName();
if (test != null && name.equals(test)) {
if (name.equals(test)) {
return holder.session;
}
}

Datei anzeigen

@ -22,7 +22,6 @@ package com.sk89q.worldedit.util;
import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.entity.Player;
import com.sk89q.worldedit.world.World;
import com.sk89q.worldedit.world.block.BlockTypes;
/**
* This class uses an inefficient method to figure out what block a player

Datei anzeigen

@ -120,7 +120,7 @@ public class YAMLConfiguration extends LocalConfiguration {
}
String type = config.getString("shell-save-type", "").trim();
shellSaveType = type.equals("") ? null : type;
shellSaveType = type.isEmpty() ? null : type;
}

Datei anzeigen

@ -61,6 +61,6 @@ public interface Parameter {
*
* @return a default value, or null if none is set
*/
public String[] getDefaultValue();
String[] getDefaultValue();
}

Datei anzeigen

@ -136,11 +136,11 @@ public enum Style {
private final static Map<Integer, Style> BY_ID = Maps.newHashMap();
private final static Map<Character, Style> BY_CHAR = Maps.newHashMap();
private Style(char code, int intCode) {
Style(char code, int intCode) {
this(code, intCode, false);
}
private Style(char code, int intCode, boolean isFormat) {
Style(char code, int intCode, boolean isFormat) {
this.code = code;
this.intCode = intCode;
this.isFormat = isFormat;
@ -183,7 +183,7 @@ public enum Style {
* Gets the color represented by the specified color code
*
* @param code Code to check
* @return Associative {@link org.bukkit.ChatColor} with the given code, or null if it doesn't exist
* @return Associative Style with the given code, or null if it doesn't exist
*/
public static Style getByChar(char code) {
return BY_CHAR.get(code);
@ -193,7 +193,7 @@ public enum Style {
* Gets the color represented by the specified color code
*
* @param code Code to check
* @return Associative {@link org.bukkit.ChatColor} with the given code, or null if it doesn't exist
* @return Associative Style with the given code, or null if it doesn't exist
*/
public static Style getByChar(String code) {
checkNotNull(code);

Datei anzeigen

@ -25,7 +25,6 @@ import com.sk89q.jnbt.CompoundTag;
import com.sk89q.jnbt.StringTag;
import com.sk89q.jnbt.Tag;
import com.sk89q.worldedit.blocks.TileEntityBlock;
import com.sk89q.worldedit.function.mask.Mask;
import com.sk89q.worldedit.registry.state.Property;
import java.util.Map;

Datei anzeigen

@ -200,7 +200,7 @@ public class Snapshot implements Comparable<Snapshot> {
public int compareTo(Snapshot o) {
if (o.date == null || date == null) {
// Remove the folder from the name
int i = name.indexOf("/"), j = o.name.indexOf("/");
int i = name.indexOf('/'), j = o.name.indexOf('/');
return name.substring((i > 0 ? 0 : i)).compareTo(o.name.substring((j > 0 ? 0 : j)));
} else {
return date.compareTo(o.date);

Datei anzeigen

@ -36,6 +36,6 @@ public interface SnapshotDateParser {
* @return date or null
*/
@Nullable
public Calendar detectDate(File file);
Calendar detectDate(File file);
}

Datei anzeigen

@ -88,7 +88,7 @@ public class TrueZipLegacyChunkStore extends LegacyChunkStore {
// Detect subfolder for the world's files
if (folder != null) {
if (!folder.equals("")) {
if (!folder.isEmpty()) {
file = folder + "/" + file;
}
} else {

Datei anzeigen

@ -87,7 +87,7 @@ public class TrueZipMcRegionChunkStore extends McRegionChunkStore {
protected InputStream getInputStream(String name, String worldName) throws IOException, DataException {
// Detect subfolder for the world's files
if (folder != null) {
if (!folder.equals("")) {
if (!folder.isEmpty()) {
name = folder + "/" + name;
}
} else {
@ -100,7 +100,7 @@ public class TrueZipMcRegionChunkStore extends McRegionChunkStore {
if (worldPattern.matcher(worldName).matches()) {
// Check for file
if (pattern.matcher(testEntry.getName()).matches()) {
folder = testEntry.getName().substring(0, testEntry.getName().lastIndexOf("/"));
folder = testEntry.getName().substring(0, testEntry.getName().lastIndexOf('/'));
name = folder + "/" + name;
break;
}

Datei anzeigen

@ -82,7 +82,7 @@ public class ZippedLegacyChunkStore extends LegacyChunkStore {
// Detect subfolder for the world's files
if (folder != null) {
if (!folder.equals("")) {
if (!folder.isEmpty()) {
file = folder + "/" + file;
}
} else {

Datei anzeigen

@ -76,7 +76,7 @@ public class ZippedMcRegionChunkStore extends McRegionChunkStore {
protected InputStream getInputStream(String name, String worldName) throws IOException, DataException {
// Detect subfolder for the world's files
if (folder != null) {
if (!folder.equals("")) {
if (!folder.isEmpty()) {
name = folder + "/" + name;
}
} else {
@ -86,7 +86,7 @@ public class ZippedMcRegionChunkStore extends McRegionChunkStore {
// Check for world
if (testEntry.getName().startsWith(worldName + "/")) {
if (pattern.matcher(testEntry.getName()).matches()) { // does entry end in .mca
folder = testEntry.getName().substring(0, testEntry.getName().lastIndexOf("/"));
folder = testEntry.getName().substring(0, testEntry.getName().lastIndexOf('/'));
name = folder + "/" + name;
break;
}