Finish basic server and client impl
This commit is contained in:
parent
a082210fa9
commit
178cc201c1
4 changed files with 213 additions and 57 deletions
|
@ -15,7 +15,7 @@ class NbtUtils {
|
|||
}
|
||||
|
||||
static bool readBoolean(CompoundTag tag, String name) {
|
||||
if (tag.contains(name)) {
|
||||
if (tag.containsKey(name)) {
|
||||
return tag.get(name)!.asByte() == 1 ? true : false;
|
||||
} else {
|
||||
return false;
|
||||
|
@ -30,7 +30,7 @@ class NbtUtils {
|
|||
}
|
||||
|
||||
static Vector2d readVector2d(CompoundTag tag, String name) {
|
||||
if (tag.contains(name)) {
|
||||
if (tag.containsKey(name)) {
|
||||
ListTag lst = tag.get(name)! as ListTag;
|
||||
return Vector2d(X: lst.get(0).asDouble(), Z: lst.get(1).asDouble());
|
||||
} else {
|
||||
|
@ -46,7 +46,7 @@ class NbtUtils {
|
|||
}
|
||||
|
||||
static Vector2i readVector2i(CompoundTag tag, String name) {
|
||||
if (tag.contains(name)) {
|
||||
if (tag.containsKey(name)) {
|
||||
ListTag lst = tag.get(name)! as ListTag;
|
||||
return Vector2i(X: lst.get(0).asInt(), Z: lst.get(1).asInt());
|
||||
} else {
|
||||
|
@ -63,7 +63,7 @@ class NbtUtils {
|
|||
}
|
||||
|
||||
static Vector3d readVector3d(CompoundTag tag, String name) {
|
||||
if (tag.contains(name)) {
|
||||
if (tag.containsKey(name)) {
|
||||
ListTag lst = tag.get(name)! as ListTag;
|
||||
return Vector3d(
|
||||
X: lst.get(0).asDouble(),
|
||||
|
@ -83,7 +83,7 @@ class NbtUtils {
|
|||
}
|
||||
|
||||
static Vector3i readVector3i(CompoundTag tag, String name) {
|
||||
if (tag.contains(name)) {
|
||||
if (tag.containsKey(name)) {
|
||||
ListTag lst = tag.get(name)! as ListTag;
|
||||
return Vector3i(
|
||||
X: lst.get(0).asInt(), Y: lst.get(1).asInt(), Z: lst.get(2).asInt());
|
||||
|
@ -111,7 +111,7 @@ class NbtUtils {
|
|||
}
|
||||
|
||||
static NbtUUID readUUID(CompoundTag tag, String name) {
|
||||
if (!tag.contains(name)) {
|
||||
if (!tag.containsKey(name)) {
|
||||
return NbtUUID.ZERO;
|
||||
} else {
|
||||
return _uuidFromIntArray(tag.get(name)!.asIntArray());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue