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

@ -21,7 +21,7 @@ package com.sk89q.jnbt;
/**
* The {@code TAG_Double} tag.
*
*
*/
public final class DoubleTag extends NumberTag {
@Override

View File

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

View File

@ -30,7 +30,7 @@ import javax.annotation.Nullable;
/**
* The {@code TAG_List} tag.
*/
public class ListTag extends Tag {
public final class ListTag extends Tag {
@Override
public int getTypeCode() {
@ -79,7 +79,7 @@ public class ListTag extends Tag {
/**
* Get the tag if it exists at the given index.
*
*
* @param index the index
* @return the tag or null
*/
@ -437,7 +437,7 @@ public class ListTag extends Tag {
@Override
public String toString() {
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) {
bldr.append(" ").append(t.toString().replaceAll("\r\n", "\r\n ")).append("\r\n");
}

View File

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

View File

@ -21,7 +21,7 @@ package com.sk89q.jnbt;
/**
* The {@code TAG_Long} tag.
*
*
*/
public final class LongTag extends NumberTag {
@Override

View File

@ -40,10 +40,10 @@ public final class NBTConstants {
private NBTConstants() {
}
/**
* Convert a type ID to its corresponding {@link Tag} class.
*
*
* @param id type ID
* @return tag class
* @throws IllegalArgumentException thrown if the tag ID is not valid
@ -80,4 +80,5 @@ public final class NBTConstants {
throw new IllegalArgumentException("Unknown tag type ID of " + id);
}
}
}

View File

@ -36,7 +36,7 @@ import java.util.Map;
* This class reads <strong>NBT</strong>, or <strong>Named Binary Tag</strong>
* streams, and produces an object graph of subclasses of the {@code Tag}
* object.
*
*
* <p>The NBT format was created by Markus Persson, and the specification may be
* found at <a href="http://www.minecraft.net/docs/NBT.txt">
* http://www.minecraft.net/docs/NBT.txt</a>.</p>
@ -48,7 +48,7 @@ public final class NBTInputStream implements Closeable {
/**
* Creates a new {@code NBTInputStream}, which will source its data
* from the specified input stream.
*
*
* @param is the input stream
*/
public NBTInputStream(InputStream is) {
@ -61,7 +61,7 @@ public final class NBTInputStream implements Closeable {
/**
* Reads an NBT tag from the stream.
*
*
* @return The tag that was read.
* @throws IOException if an I/O error occurs.
*/