Apply autofixes
This commit is contained in:
parent
5357da3746
commit
dd6ee1bf60
15 changed files with 36 additions and 30 deletions
|
@ -15,8 +15,9 @@ class NbtUtils {
|
|||
static bool readBoolean(CompoundTag tag, String name) {
|
||||
if (tag.contains(name)) {
|
||||
return tag.get(name)!.asByte() == 1 ? true : false;
|
||||
} else
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
static void writeVector2d(CompoundTag tag, String name, Vector2d pos) {
|
||||
|
@ -30,8 +31,9 @@ class NbtUtils {
|
|||
if (tag.contains(name)) {
|
||||
ListTag lst = tag.get(name)! as ListTag;
|
||||
return Vector2d(X: lst.get(0).asDouble(), Z: lst.get(1).asDouble());
|
||||
} else
|
||||
} else {
|
||||
return Vector2d.ZERO;
|
||||
}
|
||||
}
|
||||
|
||||
static void writeVector2i(CompoundTag tag, String name, Vector2i pos) {
|
||||
|
@ -45,8 +47,9 @@ class NbtUtils {
|
|||
if (tag.contains(name)) {
|
||||
ListTag lst = tag.get(name)! as ListTag;
|
||||
return Vector2i(X: lst.get(0).asInt(), Z: lst.get(1).asInt());
|
||||
} else
|
||||
} else {
|
||||
return Vector2i.ZERO;
|
||||
}
|
||||
}
|
||||
|
||||
static void writeVector3d(CompoundTag tag, String name, Vector3d pos) {
|
||||
|
@ -64,8 +67,9 @@ class NbtUtils {
|
|||
X: lst.get(0).asDouble(),
|
||||
Y: lst.get(1).asDouble(),
|
||||
Z: lst.get(2).asDouble());
|
||||
} else
|
||||
} else {
|
||||
return Vector3d.ZERO;
|
||||
}
|
||||
}
|
||||
|
||||
static void writeVector3i(CompoundTag tag, String name, Vector3i pos) {
|
||||
|
@ -81,7 +85,8 @@ class NbtUtils {
|
|||
ListTag lst = tag.get(name)! as ListTag;
|
||||
return Vector3i(
|
||||
X: lst.get(0).asInt(), Y: lst.get(1).asInt(), Z: lst.get(2).asInt());
|
||||
} else
|
||||
} else {
|
||||
return Vector3i.ZERO;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -279,10 +279,10 @@ class NBTAccountant {
|
|||
static void leaveTag(Tag tag) {
|
||||
if (tag is CompoundTag || tag is ListTag) {
|
||||
if (tag is CompoundTag) {
|
||||
CompoundTag ct = tag as CompoundTag;
|
||||
CompoundTag ct = tag;
|
||||
ct.endPrettyPrint(_prettyIndex);
|
||||
} else if (tag is ListTag) {
|
||||
ListTag lt = tag as ListTag;
|
||||
ListTag lt = tag;
|
||||
lt.endPrettyPrint(_prettyIndex);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,11 +39,11 @@ class ByteArrayTag extends Tag {
|
|||
void prettyPrint(int indent, bool recurse) {
|
||||
String array = "";
|
||||
for (int b in value) {
|
||||
array += "${b}, ";
|
||||
array += "$b, ";
|
||||
}
|
||||
array = array.substring(0, array.length - 2);
|
||||
|
||||
print(
|
||||
"${"".padLeft(indent, '\t')}${Tag.getCanonicalName(getTagType())}: [${array}]");
|
||||
"${"".padLeft(indent, '\t')}${Tag.getCanonicalName(getTagType())}: [$array]");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,6 +32,6 @@ class ByteTag extends Tag {
|
|||
@override
|
||||
void prettyPrint(int indent, bool recurse) {
|
||||
print(
|
||||
"${"".padLeft(indent, '\t')}${Tag.getCanonicalName(getTagType())}: ${value}");
|
||||
"${"".padLeft(indent, '\t')}${Tag.getCanonicalName(getTagType())}: $value");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,6 +32,6 @@ class DoubleTag extends Tag {
|
|||
@override
|
||||
void prettyPrint(int indent, bool recurse) {
|
||||
print(
|
||||
"${"".padLeft(indent, '\t')}${Tag.getCanonicalName(getTagType())}: ${value}");
|
||||
"${"".padLeft(indent, '\t')}${Tag.getCanonicalName(getTagType())}: $value");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,6 +31,6 @@ class FloatTag extends Tag {
|
|||
@override
|
||||
void prettyPrint(int indent, bool recurse) {
|
||||
print(
|
||||
"${"".padLeft(indent, '\t')}${Tag.getCanonicalName(getTagType())}: ${value}");
|
||||
"${"".padLeft(indent, '\t')}${Tag.getCanonicalName(getTagType())}: $value");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,11 +34,11 @@ class IntArrayTag extends Tag {
|
|||
void prettyPrint(int indent, bool recurse) {
|
||||
String array = "";
|
||||
for (int b in value) {
|
||||
array += "${b}, ";
|
||||
array += "$b, ";
|
||||
}
|
||||
array = array.substring(0, array.length - 2);
|
||||
|
||||
print(
|
||||
"${"".padLeft(indent, '\t')}${Tag.getCanonicalName(getTagType())}: [${array}]");
|
||||
"${"".padLeft(indent, '\t')}${Tag.getCanonicalName(getTagType())}: [$array]");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,6 +31,6 @@ class IntTag extends Tag {
|
|||
@override
|
||||
void prettyPrint(int indent, bool recurse) {
|
||||
print(
|
||||
"${"".padLeft(indent, '\t')}${Tag.getCanonicalName(getTagType())}: ${value}");
|
||||
"${"".padLeft(indent, '\t')}${Tag.getCanonicalName(getTagType())}: $value");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,10 +45,11 @@ class ListTag extends Tag {
|
|||
}
|
||||
|
||||
Tag get(int index) {
|
||||
if (size() > index)
|
||||
if (size() > index) {
|
||||
return value[index];
|
||||
else
|
||||
} else {
|
||||
return EndTag();
|
||||
}
|
||||
}
|
||||
|
||||
void remove(Tag tag) {
|
||||
|
|
|
@ -42,11 +42,11 @@ class LongArrayTag extends Tag {
|
|||
void prettyPrint(int indent, bool recurse) {
|
||||
String array = "";
|
||||
for (int b in value) {
|
||||
array += "${b}, ";
|
||||
array += "$b, ";
|
||||
}
|
||||
array = array.substring(0, array.length - 2);
|
||||
|
||||
print(
|
||||
"${"".padLeft(indent, '\t')}${Tag.getCanonicalName(getTagType())}: [${array}]");
|
||||
"${"".padLeft(indent, '\t')}${Tag.getCanonicalName(getTagType())}: [$array]");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,6 +31,6 @@ class LongTag extends Tag {
|
|||
@override
|
||||
void prettyPrint(int indent, bool recurse) {
|
||||
print(
|
||||
"${"".padLeft(indent, '\t')}${Tag.getCanonicalName(getTagType())}: ${value}");
|
||||
"${"".padLeft(indent, '\t')}${Tag.getCanonicalName(getTagType())}: $value");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,6 +31,6 @@ class ShortTag extends Tag {
|
|||
@override
|
||||
void prettyPrint(int indent, bool recurse) {
|
||||
print(
|
||||
"${"".padLeft(indent, '\t')}${Tag.getCanonicalName(getTagType())}: ${value}");
|
||||
"${"".padLeft(indent, '\t')}${Tag.getCanonicalName(getTagType())}: $value");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,6 +31,6 @@ class StringTag extends Tag {
|
|||
@override
|
||||
void prettyPrint(int indent, bool recurse) {
|
||||
print(
|
||||
"${"".padLeft(indent, '\t')}${Tag.getCanonicalName(getTagType())}: ${value}");
|
||||
"${"".padLeft(indent, '\t')}${Tag.getCanonicalName(getTagType())}: $value");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue