3
0
Mirror von https://github.com/Moulberry/AxiomPaperPlugin.git synchronisiert 2024-09-29 07:50:05 +02:00

Update ImageAnnotationData to include opacity

Dieser Commit ist enthalten in:
Moulberry 2024-09-04 14:28:04 +08:00
Ursprung 8b70de5bab
Commit 306bde1ec6
2 geänderte Dateien mit 5 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -8,7 +8,7 @@ plugins {
} }
group = "com.moulberry.axiom" group = "com.moulberry.axiom"
version = "4.0.0" version = "4.0.1"
description = "Serverside component for Axiom on Paper" description = "Serverside component for Axiom on Paper"
java { java {

Datei anzeigen

@ -5,7 +5,7 @@ import net.minecraft.network.FriendlyByteBuf;
import org.joml.Quaternionf; import org.joml.Quaternionf;
import org.joml.Vector3f; import org.joml.Vector3f;
public record ImageAnnotationData(String imageUrl, Vector3f position, Quaternionf rotation, Direction direction, float fallbackYaw, float width, int billboardMode) implements AnnotationData { public record ImageAnnotationData(String imageUrl, Vector3f position, Quaternionf rotation, Direction direction, float fallbackYaw, float width, float opacity, int billboardMode) implements AnnotationData {
@Override @Override
public void setPosition(Vector3f position) { public void setPosition(Vector3f position) {
@ -31,6 +31,7 @@ public record ImageAnnotationData(String imageUrl, Vector3f position, Quaternion
friendlyByteBuf.writeByte(this.direction.get3DDataValue()); friendlyByteBuf.writeByte(this.direction.get3DDataValue());
friendlyByteBuf.writeFloat(this.fallbackYaw); friendlyByteBuf.writeFloat(this.fallbackYaw);
friendlyByteBuf.writeFloat(this.width); friendlyByteBuf.writeFloat(this.width);
friendlyByteBuf.writeFloat(this.opacity);
friendlyByteBuf.writeByte(this.billboardMode); friendlyByteBuf.writeByte(this.billboardMode);
} }
@ -46,8 +47,9 @@ public record ImageAnnotationData(String imageUrl, Vector3f position, Quaternion
Direction direction = Direction.from3DDataValue(friendlyByteBuf.readByte()); Direction direction = Direction.from3DDataValue(friendlyByteBuf.readByte());
float fallbackYaw = friendlyByteBuf.readFloat(); float fallbackYaw = friendlyByteBuf.readFloat();
float width = friendlyByteBuf.readFloat(); float width = friendlyByteBuf.readFloat();
float opacity = friendlyByteBuf.readFloat();
int billboardMode = friendlyByteBuf.readByte(); int billboardMode = friendlyByteBuf.readByte();
return new ImageAnnotationData(imageUrl, new Vector3f(x, y, z), new Quaternionf(rotX, rotY, rotZ, rotW), direction, fallbackYaw, width, billboardMode); return new ImageAnnotationData(imageUrl, new Vector3f(x, y, z), new Quaternionf(rotX, rotY, rotZ, rotW), direction, fallbackYaw, width, opacity, billboardMode);
} }
} }