Skip to content

Commit b4746ee

Browse files
committed
更新: 给 ParticleObject 增加一些 Getter 方法
1 parent 2b8521e commit b4746ee

1 file changed

Lines changed: 82 additions & 46 deletions

File tree

src/main/java/top/zoyn/particlelib/pobject/ParticleObject.java

Lines changed: 82 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,34 @@ public ParticleObject addMatrix(Matrix matrix) {
196196
return this;
197197
}
198198

199+
/**
200+
* 移除该特效对象的矩阵
201+
*
202+
* @return {@link ParticleObject}
203+
*/
204+
public ParticleObject removeMatrix() {
205+
matrix = null;
206+
return this;
207+
}
208+
209+
/**
210+
* 判断该特效对象是否拥有矩阵
211+
*
212+
* @return 当拥有矩阵时返回 true
213+
*/
214+
public boolean hasMatrix() {
215+
return matrix != null;
216+
}
217+
218+
/**
219+
* 得到该特效对象的矩阵
220+
*
221+
* @return {@link Matrix}
222+
*/
223+
public Matrix getMatrix() {
224+
return matrix;
225+
}
226+
199227
/**
200228
* 给该特效对象设置一个矩阵
201229
* <p>
@@ -210,22 +238,69 @@ public ParticleObject setMatrix(Matrix matrix) {
210238
}
211239

212240
/**
213-
* 移除该特效对象的矩阵
241+
* 得到 X 轴上的增量
242+
*
243+
* @return X 轴的增量
244+
*/
245+
public double getIncrementX() {
246+
return incrementX;
247+
}
248+
249+
/**
250+
* 设置 {@link ParticleObject#spawnParticle(Location, Particle, int, double, double, double, double, Object)} 时 X 轴上的增量
251+
* <p>
252+
* 换言之是在 X 轴上固定移动 incrementX 个单位
214253
*
254+
* @param incrementX X 轴的增量
215255
* @return {@link ParticleObject}
216256
*/
217-
public ParticleObject removeMatrix() {
218-
matrix = null;
257+
public ParticleObject setIncrementX(double incrementX) {
258+
this.incrementX = incrementX;
219259
return this;
220260
}
221261

222262
/**
223-
* 判断该特效对象是否拥有矩阵
263+
* 得到 Y 轴上的增量
224264
*
225-
* @return 当拥有矩阵时返回 true
265+
* @return Y 轴的增量
226266
*/
227-
public boolean hasMatrix() {
228-
return matrix != null;
267+
public double getIncrementY() {
268+
return incrementY;
269+
}
270+
271+
/**
272+
* 设置 {@link ParticleObject#spawnParticle(Location, Particle, int, double, double, double, double, Object)} 时 Y 轴上的增量
273+
* <p>
274+
* 换言之是在 Y 轴上固定移动 incrementY 个单位
275+
*
276+
* @param incrementY Y 轴的增量
277+
* @return {@link ParticleObject}
278+
*/
279+
public ParticleObject setIncrementY(double incrementY) {
280+
this.incrementY = incrementY;
281+
return this;
282+
}
283+
284+
/**
285+
* 得到 Z 轴上的增量
286+
*
287+
* @return Z 轴的增量
288+
*/
289+
public double getIncrementZ() {
290+
return incrementZ;
291+
}
292+
293+
/**
294+
* 设置 {@link ParticleObject#spawnParticle(Location, Particle, int, double, double, double, double, Object)} 时 Z 轴上的增量
295+
* <p>
296+
* 换言之是在 Z 轴上固定移动 incrementZ 个单位
297+
*
298+
* @param incrementZ Z 轴的增量
299+
* @return {@link ParticleObject}
300+
*/
301+
public ParticleObject setIncrementZ(double incrementZ) {
302+
this.incrementZ = incrementZ;
303+
return this;
229304
}
230305

231306
/**
@@ -485,45 +560,6 @@ public ParticleObject attachEntity(Entity entity) {
485560
return this;
486561
}
487562

488-
/**
489-
* 设置 {@link ParticleObject#spawnParticle(Location, Particle, int, double, double, double, double, Object)} 时 X 轴上的增量
490-
* <p>
491-
* 换言之是在 X 轴上固定移动 incrementX 个单位
492-
*
493-
* @param incrementX X 轴的增量
494-
* @return {@link ParticleObject}
495-
*/
496-
public ParticleObject setIncrementX(double incrementX) {
497-
this.incrementX = incrementX;
498-
return this;
499-
}
500-
501-
/**
502-
* 设置 {@link ParticleObject#spawnParticle(Location, Particle, int, double, double, double, double, Object)} 时 Y 轴上的增量
503-
* <p>
504-
* 换言之是在 Y 轴上固定移动 incrementY 个单位
505-
*
506-
* @param incrementY Y 轴的增量
507-
* @return {@link ParticleObject}
508-
*/
509-
public ParticleObject setIncrementY(double incrementY) {
510-
this.incrementY = incrementY;
511-
return this;
512-
}
513-
514-
/**
515-
* 设置 {@link ParticleObject#spawnParticle(Location, Particle, int, double, double, double, double, Object)} 时 Z 轴上的增量
516-
* <p>
517-
* 换言之是在 Z 轴上固定移动 incrementZ 个单位
518-
*
519-
* @param incrementZ Z 轴的增量
520-
* @return {@link ParticleObject}
521-
*/
522-
public ParticleObject setIncrementZ(double incrementZ) {
523-
this.incrementZ = incrementZ;
524-
return this;
525-
}
526-
527563
/**
528564
* 通过给定一个坐标就可以使用已经指定的参数来播放粒子
529565
*

0 commit comments

Comments
 (0)