переименование метода

This commit is contained in:
2020-04-21 23:30:23 +03:00
parent 2aa7a2bd07
commit c5064be7ea
3 changed files with 4 additions and 4 deletions

View File

@@ -22,7 +22,7 @@ public enum TypeTag {
LONG_ARRAY(12, TagLongArray.class); LONG_ARRAY(12, TagLongArray.class);
public static Tag getTagById(int id) { public static Tag getTagById(int id) {
TypeTag type = getTypeById(id); TypeTag type = valueOfTypeId(id);
try { try {
return type.classTag.newInstance(); return type.classTag.newInstance();
} catch (InstantiationException | IllegalAccessException e) { } catch (InstantiationException | IllegalAccessException e) {
@@ -30,7 +30,7 @@ public enum TypeTag {
} }
} }
public static TypeTag getTypeById(int id) { public static TypeTag valueOfTypeId(int id) {
for (TypeTag type : TypeTag.values()) { for (TypeTag type : TypeTag.values()) {
if (type.id == id) { if (type.id == id) {
return type; return type;

View File

@@ -15,7 +15,7 @@ public class TagListCodec implements Codec<TagList> {
@Override @Override
public TagList decode(NbtInputStream in) throws IOException { public TagList decode(NbtInputStream in) throws IOException {
final Codec typeCodec = CodecEnum.valueOfTypeTag(TypeTag.getTypeById(in.readByte())).getCodec(); final Codec typeCodec = CodecEnum.valueOfTypeTag(TypeTag.valueOfTypeId(in.readByte())).getCodec();
final int size = in.readInt(); final int size = in.readInt();
List<Tag> tagList; List<Tag> tagList;

View File

@@ -28,7 +28,7 @@ public class NbtInputStream extends InputStream {
} }
public Tag readTag() throws IOException { public Tag readTag() throws IOException {
final TypeTag typeTag = TypeTag.getTypeById(read()); final TypeTag typeTag = TypeTag.valueOfTypeId(read());
if (typeTag == TypeTag.END) { if (typeTag == TypeTag.END) {
return TagEnd.INSTANCE; return TagEnd.INSTANCE;
} else { } else {