Attempt to fix web viewer being unable to load NBT
This commit is contained in:
parent
4a8d515f4d
commit
b1063f5057
4 changed files with 16 additions and 7 deletions
|
@ -264,6 +264,7 @@ class SessionData {
|
|||
|
||||
Map<String, dynamic> payload = {
|
||||
"cmd": "create",
|
||||
"type": "nbt",
|
||||
"data": base64Encoder.encode(nbtData),
|
||||
};
|
||||
|
||||
|
@ -444,6 +445,7 @@ class SessionData {
|
|||
if (cType == "application/json") {
|
||||
return LoadData(reply.data as Map<String, dynamic>);
|
||||
} else if (cType == "application/nbt") {
|
||||
print("Data is in NBT Format");
|
||||
Uint8List lst = base64Encoder.decode(reply.data as String);
|
||||
// Convert this to a CompoundTag
|
||||
CompoundTag ct = await NbtIo.readFromStream(lst) as CompoundTag;
|
||||
|
@ -451,7 +453,11 @@ class SessionData {
|
|||
return true;
|
||||
} else
|
||||
return false;
|
||||
} catch (E) {
|
||||
} catch (E, stack) {
|
||||
print(E);
|
||||
|
||||
print(stack);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue