Add author tag to constructed book nbt

Fixes #2640
This commit is contained in:
kennytv 2021-07-27 11:58:24 +02:00
parent 8fb51bf3b7
commit 46ca469a4a
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B
2 changed files with 3 additions and 8 deletions

View File

@ -263,14 +263,6 @@ public class WorldPackets {
}
}
}
private Byte[] fromPrimitiveArray(byte[] bytes) {
Byte[] newArray = new Byte[bytes.length];
for (int i = 0; i < bytes.length; i++) {
newArray[i] = bytes[i];
}
return newArray;
}
});
}
});

View File

@ -109,6 +109,9 @@ public final class Protocol1_17_1To1_17 extends AbstractProtocol<ClientboundPack
String title = wrapper.read(TITLE_STRING_TYPE);
tag.put("title", new StringTag(title));
// Even if unused, legacy servers check for the author tag
tag.put("author", new StringTag(wrapper.user().getProtocolInfo().getUsername()));
// Write signing
wrapper.write(Type.BOOLEAN, true);
} else {