com.parzivail.util.entity.TrackedDataHandlers Maven / Gradle / Ivy
package com.parzivail.util.entity;
import F;
import net.minecraft.class_2540;
import net.minecraft.class_2941;
import net.minecraft.class_2943;
import org.joml.Quaternionf;
public class TrackedDataHandlers
{
public static final class_2941 QUATERNION = new class_2941<>()
{
@Override
public void write(class_2540 data, Quaternionf q)
{
data.method_52941(q.w);
data.method_52941(q.x);
data.method_52941(q.y);
data.method_52941(q.z);
}
@Override
public Quaternionf method_12716(class_2540 buffer)
{
var a = buffer.readFloat();
var b = buffer.readFloat();
var c = buffer.readFloat();
var d = buffer.readFloat();
return new Quaternionf(b, c, d, a);
}
@Override
public Quaternionf copy(Quaternionf q)
{
return new Quaternionf(q);
}
};
public static final class_2941 SHORT = new class_2941<>()
{
@Override
public void write(class_2540 data, Short x)
{
data.method_52998(x);
}
@Override
public Short method_12716(class_2540 buffer)
{
return buffer.readShort();
}
@Override
public Short copy(Short x)
{
return x;
}
};
public static void register()
{
class_2943.method_12720(QUATERNION);
class_2943.method_12720(SHORT);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy