Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vec3i serialization #187

Merged
merged 4 commits into from
Oct 30, 2023
Merged

vec3i serialization #187

merged 4 commits into from
Oct 30, 2023

Conversation

chyzman
Copy link
Member

@chyzman chyzman commented Oct 24, 2023

that it

* @return The deserialized vector
*/
public static Vector3f readi(PacketByteBuf buffer) {
return new Vector3f(buffer.readInt(), buffer.readInt(), buffer.readInt());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not the greatest idea to read integers from a buffer you've written floats to. Also like, don't write floats :poggus:

*/
public static NbtCompound puti(NbtCompound nbt, String key, Vec3i vec3i) {

NbtList vectorArray = new NbtList();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When serializing an array of integers, use an NbtIntArray

@gliscowo gliscowo merged commit e971ea5 into wisp-forest:1.20.2 Oct 30, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants