DREAMFIRE Docs ← Back to site
Loading...
Searching...
No Matches
ArmorStandAnimationFrameDataBuilder.java
Go to the documentation of this file.
1/*
2 * MIT License
3 *
4 * Copyright (c) 2025 Dreamfire Studio
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights
9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 * copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in all
14 * copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 * SOFTWARE.
23 */
24package com.dreamfirestudios.dreamcore.DreamArmorStand;
25
26import org.bukkit.util.EulerAngle;
27
47
48 private long durationTicks = 20;
49 private EulerAngle headStart;
50 private EulerAngle headEnd;
51 private EulerAngle bodyStart;
52 private EulerAngle bodyEnd;
53 private EulerAngle leftArmStart;
54 private EulerAngle leftArmEnd;
55 private EulerAngle rightArmStart;
56 private EulerAngle rightArmEnd;
57 private EulerAngle leftLegStart;
58 private EulerAngle leftLegEnd;
59 private EulerAngle rightLegStart;
60 private EulerAngle rightLegEnd;
61
70 public ArmorStandAnimationFrameDataBuilder duration(long durationTicks) {
71 if (durationTicks <= 0) throw new IllegalArgumentException("durationTicks must be > 0");
72 this.durationTicks = durationTicks;
73 return this;
74 }
75
82 public ArmorStandAnimationFrameDataBuilder head(EulerAngle start, EulerAngle end) {
83 this.headStart = start;
84 this.headEnd = end;
85 return this;
86 }
87
94 public ArmorStandAnimationFrameDataBuilder body(EulerAngle start, EulerAngle end) {
95 this.bodyStart = start;
96 this.bodyEnd = end;
97 return this;
98 }
99
106 public ArmorStandAnimationFrameDataBuilder leftArm(EulerAngle start, EulerAngle end) {
107 this.leftArmStart = start;
108 this.leftArmEnd = end;
109 return this;
110 }
111
118 public ArmorStandAnimationFrameDataBuilder rightArm(EulerAngle start, EulerAngle end) {
119 this.rightArmStart = start;
120 this.rightArmEnd = end;
121 return this;
122 }
123
130 public ArmorStandAnimationFrameDataBuilder leftLeg(EulerAngle start, EulerAngle end) {
131 this.leftLegStart = start;
132 this.leftLegEnd = end;
133 return this;
134 }
135
142 public ArmorStandAnimationFrameDataBuilder rightLeg(EulerAngle start, EulerAngle end) {
143 this.rightLegStart = start;
144 this.rightLegEnd = end;
145 return this;
146 }
147
155 durationTicks,
156 headStart, headEnd,
157 bodyStart, bodyEnd,
158 leftArmStart, leftArmEnd,
159 rightArmStart, rightArmEnd,
160 leftLegStart, leftLegEnd,
161 rightLegStart, rightLegEnd
162 );
163 }
164}
ArmorStandAnimationFrameData build()
Builds and returns a new ArmorStandAnimationFrameData instance configured with the provided parameter...
ArmorStandAnimationFrameDataBuilder leftArm(EulerAngle start, EulerAngle end)
Sets the start and end angles for the left arm.
ArmorStandAnimationFrameDataBuilder head(EulerAngle start, EulerAngle end)
Sets the start and end angles for the head.
ArmorStandAnimationFrameDataBuilder body(EulerAngle start, EulerAngle end)
Sets the start and end angles for the body.
ArmorStandAnimationFrameDataBuilder rightLeg(EulerAngle start, EulerAngle end)
Sets the start and end angles for the right leg.
ArmorStandAnimationFrameDataBuilder leftLeg(EulerAngle start, EulerAngle end)
Sets the start and end angles for the left leg.
ArmorStandAnimationFrameDataBuilder rightArm(EulerAngle start, EulerAngle end)
Sets the start and end angles for the right arm.
ArmorStandAnimationFrameDataBuilder duration(long durationTicks)
Sets the duration (in ticks) for this frame.
Represents a single animation frame for an armor stand, defining start and end angles for each body p...