Skip to content

Commit

Permalink
Add builder for CameraSetInstruction & respect default optional values
Browse files Browse the repository at this point in the history
  • Loading branch information
Alemiz112 committed Oct 22, 2024
1 parent 68f5aff commit 0385f6b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
@NoArgsConstructor
public class CameraPreset {
private String identifier;
@Builder.Default
private String parentPreset = "";
// All the values below are optional, and will not be encoded if null is used
private Vector3f pos;
Expand All @@ -28,6 +29,7 @@ public class CameraPreset {
*/
private Float radius;
private CameraAudioListener listener;
@Builder.Default
private OptionalBoolean playEffect = OptionalBoolean.empty();
/**
* @since v729
Expand All @@ -36,6 +38,7 @@ public class CameraPreset {
/**
* @since v729
*/
@Builder.Default
private OptionalBoolean snapToTarget = OptionalBoolean.empty();
/**
* @since v729
Expand All @@ -52,9 +55,11 @@ public class CameraPreset {
/**
* @since v748
*/
@Builder.Default
private OptionalBoolean continueTargeting = OptionalBoolean.empty();
/**
* @since v748
*/
@Builder.Default
private OptionalBoolean alignTargetAndCameraForward = OptionalBoolean.empty();
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.cloudburstmc.protocol.bedrock.data.camera;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.cloudburstmc.math.vector.Vector2f;
Expand All @@ -9,6 +10,7 @@
import org.cloudburstmc.protocol.common.util.OptionalBoolean;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class CameraSetInstruction {
Expand All @@ -25,6 +27,7 @@ public class CameraSetInstruction {
* @since v748
*/
private Vector3f entityOffset;
@Builder.Default
private OptionalBoolean defaultPreset = OptionalBoolean.empty();

@Data
Expand Down

0 comments on commit 0385f6b

Please sign in to comment.