1919 */
2020public abstract class ParticleObject {
2121
22- private Location origin ;
23-
24- private ShowType showType = ShowType .NONE ;
25- private TaskWrapper task ;
26- private long period ;
27- private boolean running = false ;
28-
29- private Particle particle = Particle .VILLAGER_HAPPY ;
30- private int count = 1 ;
31- private double offsetX = 0 ;
32- private double offsetY = 0 ;
33- private double offsetZ = 0 ;
34- private double extra = 0 ;
35- private Object data = null ;
36- private Color color ;
37- private Entity entity ;
22+ protected Location origin ;
23+
24+ protected ShowType showType = ShowType .NONE ;
25+ protected TaskWrapper showTask ;
26+ protected long period ;
27+ protected boolean running = false ;
28+
29+ protected Particle particle = Particle .VILLAGER_HAPPY ;
30+ protected int count = 1 ;
31+ protected double offsetX = 0 ;
32+ protected double offsetY = 0 ;
33+ protected double offsetZ = 0 ;
34+ protected double extra = 0 ;
35+ protected Object data = null ;
36+ protected Color color ;
37+ protected Entity entity ;
3838 /**
3939 * X的变化量
4040 */
41- private double incrementX ;
42- private double incrementY ;
43- private double incrementZ ;
41+ protected double incrementX ;
42+ protected double incrementY ;
43+ protected double incrementZ ;
4444 /**
4545 * 表示该特效对象所拥有的矩阵
4646 */
47- private Matrix matrix ;
47+ protected Matrix matrix ;
4848
4949 /**
5050 * 将计算好的粒子展示位置以列表的方式返回
@@ -67,7 +67,7 @@ public void alwaysShow() {
6767 // 此处的延迟 2tick 是为了防止turnOffTask还没把特效给关闭时的缓冲
6868 CrypticLibBukkit .scheduler ().syncLater (() -> {
6969 running = true ;
70- task = CrypticLibBukkit .scheduler ().syncTimer (() -> {
70+ showTask = CrypticLibBukkit .scheduler ().syncTimer (() -> {
7171 if (!running ) {
7272 return ;
7373 }
@@ -86,7 +86,7 @@ public void alwaysShowAsync() {
8686 // 此处的延迟 2tick 是为了防止turnOffTask还没把特效给关闭时的缓冲
8787 CrypticLibBukkit .scheduler ().syncLater (() -> {
8888 running = true ;
89- task = CrypticLibBukkit .scheduler ().asyncTimer (() -> {
89+ showTask = CrypticLibBukkit .scheduler ().asyncTimer (() -> {
9090 if (!running ) {
9191 return ;
9292 }
@@ -115,7 +115,7 @@ public void alwaysPlay() {
115115 // 此处的延迟 2tick 是为了防止turnOffTask还没把特效给关闭时的缓冲
116116 CrypticLibBukkit .scheduler ().syncLater (() -> {
117117 running = true ;
118- task = CrypticLibBukkit .scheduler ().syncTimer (() -> {
118+ showTask = CrypticLibBukkit .scheduler ().syncTimer (() -> {
119119 if (!running ) {
120120 return ;
121121 }
@@ -143,7 +143,7 @@ public void alwaysPlayAsync() {
143143 // 此处的延迟 2tick 是为了防止turnOffTask还没把特效给关闭时的缓冲
144144 CrypticLibBukkit .scheduler ().syncLater (() -> {
145145 running = true ;
146- task = CrypticLibBukkit .scheduler ().asyncTimer (() -> {
146+ showTask = CrypticLibBukkit .scheduler ().asyncTimer (() -> {
147147 if (!running ) {
148148 return ;
149149 }
@@ -157,9 +157,9 @@ public void alwaysPlayAsync() {
157157 * 将正在展示或播放的特效关闭
158158 */
159159 public void turnOffTask () {
160- if (task != null ) {
160+ if (showTask != null ) {
161161 running = false ;
162- task .cancel ();
162+ showTask .cancel ();
163163 setShowType (ShowType .NONE );
164164 }
165165 }
0 commit comments