Minor code changes

This commit is contained in:
MattBDev 2020-01-29 17:53:34 -05:00
parent 7236b0a026
commit 336e411e10
14 changed files with 28 additions and 31 deletions

View File

@ -19,10 +19,10 @@
package com.sk89q.jnbt; package com.sk89q.jnbt;
import static com.google.common.base.Preconditions.checkNotNull;
import java.util.Locale; import java.util.Locale;
import static com.google.common.base.Preconditions.checkNotNull;
/** /**
* The {@code TAG_Int_Array} tag. * The {@code TAG_Int_Array} tag.
*/ */

View File

@ -30,7 +30,7 @@ import javax.annotation.Nullable;
/** /**
* The {@code TAG_List} tag. * The {@code TAG_List} tag.
*/ */
public class ListTag extends Tag { public final class ListTag extends Tag {
@Override @Override
public int getTypeCode() { public int getTypeCode() {
@ -437,7 +437,7 @@ public class ListTag extends Tag {
@Override @Override
public String toString() { public String toString() {
StringBuilder bldr = new StringBuilder(); StringBuilder bldr = new StringBuilder();
bldr.append("TAG_List").append(": ").append(value.size()).append(" entries of type ").append(type.getTypeName()).append("\r\n{\r\n"); bldr.append("TAG_List").append(": ").append(value.size()).append(" entries of type ").append(NBTUtils.getTypeName(type)).append("\r\n{\r\n");
for (Tag t : value) { for (Tag t : value) {
bldr.append(" ").append(t.toString().replaceAll("\r\n", "\r\n ")).append("\r\n"); bldr.append(" ").append(t.toString().replaceAll("\r\n", "\r\n ")).append("\r\n");
} }

View File

@ -19,10 +19,10 @@
package com.sk89q.jnbt; package com.sk89q.jnbt;
import static com.google.common.base.Preconditions.checkNotNull;
import java.util.Locale; import java.util.Locale;
import static com.google.common.base.Preconditions.checkNotNull;
/** /**
* The {@code TAG_Long_Array} tag. * The {@code TAG_Long_Array} tag.
*/ */

View File

@ -80,4 +80,5 @@ public final class NBTConstants {
throw new IllegalArgumentException("Unknown tag type ID of " + id); throw new IllegalArgumentException("Unknown tag type ID of " + id);
} }
} }
} }

View File

@ -53,7 +53,7 @@ public class CommandException extends Exception {
/** /**
* Gets the command that was called, which will include the sub-command * Gets the command that was called, which will include the sub-command
* (i.e., "/br sphere"). * (i.e. "/br sphere").
* *
* @param prefix the command shebang character (such as "/") -- may be empty * @param prefix the command shebang character (such as "/") -- may be empty
* @param spacedSuffix a suffix to put at the end (optional) -- may be null * @param spacedSuffix a suffix to put at the end (optional) -- may be null

View File

@ -47,8 +47,4 @@ public class CommandLocals {
return locals.put(key, value); return locals.put(key, value);
} }
public Object putIfAbsent(Object key, Object value) {
return locals.putIfAbsent(key, value);
}
} }

View File

@ -20,6 +20,9 @@
package com.sk89q.minecraft.util.commands; package com.sk89q.minecraft.util.commands;
import com.sk89q.util.StringUtil; import com.sk89q.util.StringUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.lang.reflect.Modifier; import java.lang.reflect.Modifier;
@ -30,9 +33,6 @@ import java.util.List;
import java.util.Locale; import java.util.Locale;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import org.enginehub.piston.inject.InjectedValueAccess;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** /**
* Manager for handling commands. This allows you to easily process commands, * Manager for handling commands. This allows you to easily process commands,

View File

@ -129,7 +129,7 @@ public class CuboidRegionSelector implements RegionSelector, CUIRegion {
public boolean selectPrimary(BlockVector3 position, SelectorLimits limits) { public boolean selectPrimary(BlockVector3 position, SelectorLimits limits) {
checkNotNull(position); checkNotNull(position);
if (position.equals(position1)) { if (position1 != null && position.equals(position1)) {
return false; return false;
} }
@ -142,7 +142,7 @@ public class CuboidRegionSelector implements RegionSelector, CUIRegion {
public boolean selectSecondary(BlockVector3 position, SelectorLimits limits) { public boolean selectSecondary(BlockVector3 position, SelectorLimits limits) {
checkNotNull(position); checkNotNull(position);
if (position.equals(position2)) { if (position2 != null && position.equals(position2)) {
return false; return false;
} }