mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-02 11:26:42 +00:00
API improvements
This commit is contained in:
@ -25,10 +25,6 @@ import java.util.Locale;
|
||||
* The {@code TAG_Byte_Array} tag.
|
||||
*/
|
||||
public final class ByteArrayTag extends Tag {
|
||||
@Override
|
||||
public String getTypeName() {
|
||||
return "TAG_Byte_Array";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTypeCode() {
|
||||
|
@ -27,10 +27,6 @@ public final class ByteTag extends NumberTag {
|
||||
public int getTypeCode() {
|
||||
return NBTConstants.TYPE_BYTE;
|
||||
}
|
||||
@Override
|
||||
public String getTypeName() {
|
||||
return "TAG_Byte";
|
||||
}
|
||||
|
||||
private final byte value;
|
||||
|
||||
|
@ -32,10 +32,6 @@ import java.util.UUID;
|
||||
* The {@code TAG_Compound} tag.
|
||||
*/
|
||||
public class CompoundTag extends Tag {
|
||||
@Override
|
||||
public String getTypeName() {
|
||||
return "TAG_Compound";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTypeCode() {
|
||||
|
@ -21,17 +21,13 @@ package com.sk89q.jnbt;
|
||||
|
||||
/**
|
||||
* The {@code TAG_Double} tag.
|
||||
*
|
||||
*
|
||||
*/
|
||||
public final class DoubleTag extends NumberTag {
|
||||
@Override
|
||||
public int getTypeCode() {
|
||||
return NBTConstants.TYPE_DOUBLE;
|
||||
}
|
||||
@Override
|
||||
public String getTypeName() {
|
||||
return "TAG_Double";
|
||||
}
|
||||
|
||||
private final double value;
|
||||
|
||||
|
@ -23,10 +23,6 @@ package com.sk89q.jnbt;
|
||||
* The {@code TAG_End} tag.
|
||||
*/
|
||||
public final class EndTag extends Tag {
|
||||
@Override
|
||||
public String getTypeName() {
|
||||
return "TAG_End";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTypeCode() {
|
||||
|
@ -27,10 +27,6 @@ public final class FloatTag extends NumberTag {
|
||||
public int getTypeCode() {
|
||||
return NBTConstants.TYPE_FLOAT;
|
||||
}
|
||||
@Override
|
||||
public String getTypeName() {
|
||||
return "TAG_Float";
|
||||
}
|
||||
|
||||
private final float value;
|
||||
|
||||
|
@ -23,16 +23,10 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* The {@code TAG_Int_Array} tag.
|
||||
*/
|
||||
public final class IntArrayTag extends Tag {
|
||||
@Override
|
||||
public String getTypeName() {
|
||||
return "TAG_Int_Array";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTypeCode() {
|
||||
|
@ -27,10 +27,6 @@ public final class IntTag extends NumberTag {
|
||||
public int getTypeCode() {
|
||||
return NBTConstants.TYPE_INT;
|
||||
}
|
||||
@Override
|
||||
public String getTypeName() {
|
||||
return "TAG_Int";
|
||||
}
|
||||
|
||||
private final int value;
|
||||
|
||||
|
@ -31,10 +31,6 @@ import javax.annotation.Nullable;
|
||||
* The {@code TAG_List} tag.
|
||||
*/
|
||||
public class ListTag extends Tag {
|
||||
@Override
|
||||
public String getTypeName() {
|
||||
return "TAG_List";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTypeCode() {
|
||||
|
@ -23,16 +23,10 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* The {@code TAG_Long_Array} tag.
|
||||
*/
|
||||
public class LongArrayTag extends Tag {
|
||||
@Override
|
||||
public String getTypeName() {
|
||||
return "TAG_Long_Array";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTypeCode() {
|
||||
|
@ -21,17 +21,13 @@ package com.sk89q.jnbt;
|
||||
|
||||
/**
|
||||
* The {@code TAG_Long} tag.
|
||||
*
|
||||
*
|
||||
*/
|
||||
public final class LongTag extends NumberTag {
|
||||
@Override
|
||||
public int getTypeCode() {
|
||||
return NBTConstants.TYPE_LONG;
|
||||
}
|
||||
@Override
|
||||
public String getTypeName() {
|
||||
return "TAG_Long";
|
||||
}
|
||||
|
||||
private final long value;
|
||||
|
||||
|
@ -90,7 +90,7 @@ public final class NBTOutputStream extends OutputStream implements Closeable, Da
|
||||
checkNotNull(name);
|
||||
checkNotNull(tag);
|
||||
|
||||
int type = tag.getTypeCode();
|
||||
int type = NBTUtils.getTypeCode(tag.getClass());
|
||||
writeNamedTagName(name, type);
|
||||
|
||||
if (type == NBTConstants.TYPE_END) {
|
||||
@ -189,7 +189,7 @@ public final class NBTOutputStream extends OutputStream implements Closeable, Da
|
||||
}
|
||||
|
||||
public void writeTag(Tag tag) throws IOException {
|
||||
int type = tag.getTypeCode();
|
||||
int type = NBTUtils.getTypeCode(tag.getClass());
|
||||
os.writeByte(type);
|
||||
writeTagPayload(tag);
|
||||
}
|
||||
@ -207,7 +207,7 @@ public final class NBTOutputStream extends OutputStream implements Closeable, Da
|
||||
* if an I/O error occurs.
|
||||
*/
|
||||
public void writeTagPayload(Tag tag) throws IOException {
|
||||
int type = tag.getTypeCode();
|
||||
int type = NBTUtils.getTypeCode(tag.getClass());
|
||||
switch (type) {
|
||||
case NBTConstants.TYPE_END:
|
||||
writeEndTagPayload((EndTag) tag);
|
||||
|
@ -27,10 +27,6 @@ public final class ShortTag extends NumberTag {
|
||||
public int getTypeCode() {
|
||||
return NBTConstants.TYPE_SHORT;
|
||||
}
|
||||
@Override
|
||||
public String getTypeName() {
|
||||
return "TAG_Short";
|
||||
}
|
||||
|
||||
private final short value;
|
||||
|
||||
|
@ -25,10 +25,6 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||
* The {@code TAG_String} tag.
|
||||
*/
|
||||
public final class StringTag extends Tag {
|
||||
@Override
|
||||
public String getTypeName() {
|
||||
return "TAG_String";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTypeCode() {
|
||||
|
@ -37,6 +37,4 @@ public abstract class Tag {
|
||||
|
||||
public abstract int getTypeCode();
|
||||
|
||||
public abstract String getTypeName();
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user