Skip to content

Commit 95861ba

Browse files
committed
[6.0.11][publish] Experimental > 1.20.1 & update effect & fix particle packet
1 parent d726902 commit 95861ba

File tree

9 files changed

+126
-185
lines changed

9 files changed

+126
-185
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
.gradle
22
.idea
3-
.tools
43
build

.tools/servergen.jar

1.63 MB
Binary file not shown.

module/module-effect/src/main/kotlin/taboolib/module/effect/EffectBezier.kt

Lines changed: 20 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@file:Isolated
2+
23
package taboolib.module.effect
34

45
import taboolib.common.Isolated
@@ -22,19 +23,13 @@ fun createTwoRankBezierCurve(
2223
p2: Location,
2324
step: Double = 1.0,
2425
period: Long = 20,
25-
spawner: (Location) -> Unit
26+
spawner: (p: Location) -> Unit = {}
2627
): TwoRankBezierCurve {
27-
return TwoRankBezierCurve(
28-
p0,
29-
p1,
30-
p2,
31-
step,
32-
object : ParticleSpawner {
33-
34-
override fun spawn(location: Location) {
35-
spawner(location)
36-
}
37-
}).also { it.period = period }
28+
return TwoRankBezierCurve(p0, p1, p2, step, object : ParticleSpawner {
29+
override fun spawn(location: Location) {
30+
spawner(location)
31+
}
32+
}).also { it.period = period }
3833
}
3934

4035
/**
@@ -54,20 +49,13 @@ fun createThreeRankBezierCurve(
5449
p3: Location,
5550
step: Double = 1.0,
5651
period: Long = 20,
57-
spawner: (Location) -> Unit
52+
spawner: (p: Location) -> Unit = {}
5853
): ThreeRankBezierCurve {
59-
return ThreeRankBezierCurve(
60-
p0,
61-
p1,
62-
p2,
63-
p3,
64-
step,
65-
object : ParticleSpawner {
66-
67-
override fun spawn(location: Location) {
68-
spawner(location)
69-
}
70-
}).also { it.period = period }
54+
return ThreeRankBezierCurve(p0, p1, p2, p3, step, object : ParticleSpawner {
55+
override fun spawn(location: Location) {
56+
spawner(location)
57+
}
58+
}).also { it.period = period }
7159
}
7260

7361
/**
@@ -81,10 +69,9 @@ fun createNRankBezierCurve(
8169
points: List<Location>,
8270
step: Double = 1.0,
8371
period: Long = 20,
84-
spawner: (Location) -> Unit
72+
spawner: (p: Location) -> Unit = {}
8573
): NRankBezierCurve {
8674
return NRankBezierCurve(points, step, object : ParticleSpawner {
87-
8875
override fun spawn(location: Location) {
8976
spawner(location)
9077
}
@@ -102,15 +89,11 @@ fun createNRankBezierCurve(
10289
vararg points: Location,
10390
step: Double = 1.0,
10491
period: Long = 20,
105-
spawner: (Location) -> Unit
92+
spawner: (p: Location) -> Unit = {}
10693
): NRankBezierCurve {
107-
return NRankBezierCurve(
108-
points.toList(),
109-
step,
110-
object : ParticleSpawner {
111-
112-
override fun spawn(location: Location) {
113-
spawner(location)
114-
}
115-
}).also { it.period = period }
94+
return NRankBezierCurve(points.toList(), step, object : ParticleSpawner {
95+
override fun spawn(location: Location) {
96+
spawner(location)
97+
}
98+
}).also { it.period = period }
11699
}

module/module-effect/src/main/kotlin/taboolib/module/effect/EffectGeneric.kt

Lines changed: 44 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ import taboolib.module.effect.shape.Ray.RayStopType
1818
fun createLotus(
1919
origin: Location,
2020
period: Long = 20,
21-
spawner: (p: Location) -> Unit
21+
spawner: (p: Location) -> Unit = {}
2222
): Lotus {
23-
return Lotus(origin , period , object:ParticleSpawner{
23+
return Lotus(origin, period, object : ParticleSpawner {
2424
override fun spawn(location: Location) {
25-
spawn(origin)
25+
spawner(origin)
2626
}
2727
}).also {
2828
it.period = period
@@ -37,43 +37,27 @@ fun createRay(
3737
range: Double = 0.5,
3838
stopType: RayStopType,
3939
period: Long = 20L,
40-
spawner: (p: Location) -> Unit
41-
): Ray{
42-
return Ray(
43-
origin,
44-
direction,
45-
maxLength,
46-
step,
47-
range,
48-
stopType,
49-
period,
50-
object : ParticleSpawner{
51-
override fun spawn(location: Location) {
52-
spawn(location)
53-
}
54-
40+
spawner: (p: Location) -> Unit = {}
41+
): Ray {
42+
return Ray(origin, direction, maxLength, step, range, stopType, period, object : ParticleSpawner {
43+
override fun spawn(location: Location) {
44+
spawner(location)
5545
}
56-
)
46+
})
5747
}
5848

5949
fun createStar(
6050
origin: Location,
6151
radius: Double,
6252
step: Double,
6353
period: Long = 20L,
64-
spawner: (p: Location) -> Unit
65-
): Star{
66-
return Star(
67-
origin,
68-
radius,
69-
step,
70-
period,
71-
object : ParticleSpawner{
72-
override fun spawn(location: Location) {
73-
spawn(location)
74-
}
54+
spawner: (p: Location) -> Unit = {}
55+
): Star {
56+
return Star(origin, radius, step, period, object : ParticleSpawner {
57+
override fun spawn(location: Location) {
58+
spawner(location)
7559
}
76-
)
60+
})
7761
}
7862

7963
/*
@@ -89,20 +73,15 @@ fun createHeart(
8973
yScaleRate: Double,
9074
origin: Location,
9175
period: Long,
92-
spawner: (p: Location) -> Unit
76+
spawner: (p: Location) -> Unit = {}
9377
): Heart {
94-
return Heart(
95-
xScaleRate,
96-
yScaleRate,
97-
origin,
98-
period,
99-
object :ParticleSpawner{
100-
override fun spawn(location: Location) {
101-
spawn(location)
102-
}
78+
return Heart(xScaleRate, yScaleRate, origin, period, object : ParticleSpawner {
79+
override fun spawn(location: Location) {
80+
spawner(location)
10381
}
104-
)
82+
})
10583
}
84+
10685
/**
10786
* 创建一个弧
10887
*
@@ -120,21 +99,13 @@ fun createArc(
12099
radius: Double = 1.0,
121100
step: Double = 1.0,
122101
period: Long = 20,
123-
spawner: (p: Location) -> Unit
102+
spawner: (p: Location) -> Unit = {}
124103
): Arc {
125-
return Arc(
126-
origin,
127-
startAngle,
128-
angle,
129-
radius,
130-
step,
131-
period,
132-
object : ParticleSpawner {
133-
134-
override fun spawn(location: Location) {
135-
spawner(location)
136-
}
137-
})
104+
return Arc(origin, startAngle, angle, radius, step, period, object : ParticleSpawner {
105+
override fun spawn(location: Location) {
106+
spawner(location)
107+
}
108+
})
138109
}
139110

140111
/**
@@ -150,10 +121,9 @@ fun createAstroid(
150121
radius: Double = 1.0,
151122
step: Double = 1.0,
152123
period: Long = 20,
153-
spawner: (p: Location) -> Unit
124+
spawner: (p: Location) -> Unit = {}
154125
): Astroid {
155126
return Astroid(radius, origin, object : ParticleSpawner {
156-
157127
override fun spawn(location: Location) {
158128
spawner(location)
159129
}
@@ -176,19 +146,13 @@ fun createCircle(
176146
radius: Double = 1.0,
177147
step: Double = 1.0,
178148
period: Long = 20,
179-
spawner: (p: Location) -> Unit
149+
spawner: (p: Location) -> Unit = {}
180150
): Circle {
181-
return Circle(
182-
origin,
183-
radius,
184-
step,
185-
period,
186-
object : ParticleSpawner {
187-
188-
override fun spawn(location: Location) {
189-
spawner(location)
190-
}
191-
})
151+
return Circle(origin, radius, step, period, object : ParticleSpawner {
152+
override fun spawn(location: Location) {
153+
spawner(location)
154+
}
155+
})
192156
}
193157

194158
/**
@@ -204,18 +168,13 @@ fun createFilledCircle(
204168
radius: Double = 1.0,
205169
sample: Int = 100,
206170
period: Long = 20,
207-
spawner: (p: Location) -> Unit
171+
spawner: (p: Location) -> Unit = {}
208172
): FilledCircle {
209-
return FilledCircle(
210-
origin,
211-
radius,
212-
sample,
213-
object : ParticleSpawner {
214-
215-
override fun spawn(location: Location) {
216-
spawner(location)
217-
}
218-
}).also { it.period = period }
173+
return FilledCircle(origin, radius, sample, object : ParticleSpawner {
174+
override fun spawn(location: Location) {
175+
spawner(location)
176+
}
177+
}).also { it.period = period }
219178
}
220179

221180
/**
@@ -231,10 +190,9 @@ fun createCube(
231190
max: Location,
232191
step: Double = 1.0,
233192
period: Long = 20,
234-
spawner: (p: Location) -> Unit
193+
spawner: (p: Location) -> Unit = {}
235194
): Cube {
236195
return Cube(min, max, step, object : ParticleSpawner {
237-
238196
override fun spawn(location: Location) {
239197
spawner(location)
240198
}
@@ -254,10 +212,9 @@ fun createLine(
254212
end: Location,
255213
step: Double = 1.0,
256214
period: Long = 20,
257-
spawner: (p: Location) -> Unit
215+
spawner: (p: Location) -> Unit = {}
258216
): Line {
259217
return Line(start, end, step, period, object : ParticleSpawner {
260-
261218
override fun spawn(location: Location) {
262219
spawner(location)
263220
}
@@ -278,10 +235,9 @@ fun createPolygon(
278235
sides: Int = 3,
279236
step: Double = 1.0,
280237
period: Long = 20,
281-
spawner: (p: Location) -> Unit
238+
spawner: (p: Location) -> Unit = {}
282239
): Polygon {
283240
return Polygon(sides, origin, step, object : ParticleSpawner {
284-
285241
override fun spawn(location: Location) {
286242
spawner(location)
287243
}
@@ -304,13 +260,11 @@ fun createSphere(
304260
radius: Double = 1.0,
305261
sample: Int = 100,
306262
period: Long = 20,
307-
spawner: (p: Location) -> Unit
263+
spawner: (p: Location) -> Unit = {}
308264
): Sphere {
309265
return Sphere(origin, sample, radius, object : ParticleSpawner {
310-
311266
override fun spawn(location: Location) {
312267
spawner(location)
313268
}
314269
}).also { it.period = period }
315-
316270
}

0 commit comments

Comments
 (0)