Skip to content

Commit

Permalink
[6.0.11][publish] Experimental > 1.20.1 & update effect & fix particl…
Browse files Browse the repository at this point in the history
…e packet
  • Loading branch information
Bkm016 committed Jun 18, 2023
1 parent d726902 commit 95861ba
Show file tree
Hide file tree
Showing 9 changed files with 126 additions and 185 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.gradle
.idea
.tools
build
Binary file added .tools/servergen.jar
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@file:Isolated

package taboolib.module.effect

import taboolib.common.Isolated
Expand All @@ -22,19 +23,13 @@ fun createTwoRankBezierCurve(
p2: Location,
step: Double = 1.0,
period: Long = 20,
spawner: (Location) -> Unit
spawner: (p: Location) -> Unit = {}
): TwoRankBezierCurve {
return TwoRankBezierCurve(
p0,
p1,
p2,
step,
object : ParticleSpawner {

override fun spawn(location: Location) {
spawner(location)
}
}).also { it.period = period }
return TwoRankBezierCurve(p0, p1, p2, step, object : ParticleSpawner {
override fun spawn(location: Location) {
spawner(location)
}
}).also { it.period = period }
}

/**
Expand All @@ -54,20 +49,13 @@ fun createThreeRankBezierCurve(
p3: Location,
step: Double = 1.0,
period: Long = 20,
spawner: (Location) -> Unit
spawner: (p: Location) -> Unit = {}
): ThreeRankBezierCurve {
return ThreeRankBezierCurve(
p0,
p1,
p2,
p3,
step,
object : ParticleSpawner {

override fun spawn(location: Location) {
spawner(location)
}
}).also { it.period = period }
return ThreeRankBezierCurve(p0, p1, p2, p3, step, object : ParticleSpawner {
override fun spawn(location: Location) {
spawner(location)
}
}).also { it.period = period }
}

/**
Expand All @@ -81,10 +69,9 @@ fun createNRankBezierCurve(
points: List<Location>,
step: Double = 1.0,
period: Long = 20,
spawner: (Location) -> Unit
spawner: (p: Location) -> Unit = {}
): NRankBezierCurve {
return NRankBezierCurve(points, step, object : ParticleSpawner {

override fun spawn(location: Location) {
spawner(location)
}
Expand All @@ -102,15 +89,11 @@ fun createNRankBezierCurve(
vararg points: Location,
step: Double = 1.0,
period: Long = 20,
spawner: (Location) -> Unit
spawner: (p: Location) -> Unit = {}
): NRankBezierCurve {
return NRankBezierCurve(
points.toList(),
step,
object : ParticleSpawner {

override fun spawn(location: Location) {
spawner(location)
}
}).also { it.period = period }
return NRankBezierCurve(points.toList(), step, object : ParticleSpawner {
override fun spawn(location: Location) {
spawner(location)
}
}).also { it.period = period }
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ import taboolib.module.effect.shape.Ray.RayStopType
fun createLotus(
origin: Location,
period: Long = 20,
spawner: (p: Location) -> Unit
spawner: (p: Location) -> Unit = {}
): Lotus {
return Lotus(origin , period , object:ParticleSpawner{
return Lotus(origin, period, object : ParticleSpawner {
override fun spawn(location: Location) {
spawn(origin)
spawner(origin)
}
}).also {
it.period = period
Expand All @@ -37,43 +37,27 @@ fun createRay(
range: Double = 0.5,
stopType: RayStopType,
period: Long = 20L,
spawner: (p: Location) -> Unit
): Ray{
return Ray(
origin,
direction,
maxLength,
step,
range,
stopType,
period,
object : ParticleSpawner{
override fun spawn(location: Location) {
spawn(location)
}

spawner: (p: Location) -> Unit = {}
): Ray {
return Ray(origin, direction, maxLength, step, range, stopType, period, object : ParticleSpawner {
override fun spawn(location: Location) {
spawner(location)
}
)
})
}

fun createStar(
origin: Location,
radius: Double,
step: Double,
period: Long = 20L,
spawner: (p: Location) -> Unit
): Star{
return Star(
origin,
radius,
step,
period,
object : ParticleSpawner{
override fun spawn(location: Location) {
spawn(location)
}
spawner: (p: Location) -> Unit = {}
): Star {
return Star(origin, radius, step, period, object : ParticleSpawner {
override fun spawn(location: Location) {
spawner(location)
}
)
})
}

/*
Expand All @@ -89,20 +73,15 @@ fun createHeart(
yScaleRate: Double,
origin: Location,
period: Long,
spawner: (p: Location) -> Unit
spawner: (p: Location) -> Unit = {}
): Heart {
return Heart(
xScaleRate,
yScaleRate,
origin,
period,
object :ParticleSpawner{
override fun spawn(location: Location) {
spawn(location)
}
return Heart(xScaleRate, yScaleRate, origin, period, object : ParticleSpawner {
override fun spawn(location: Location) {
spawner(location)
}
)
})
}

/**
* 创建一个弧
*
Expand All @@ -120,21 +99,13 @@ fun createArc(
radius: Double = 1.0,
step: Double = 1.0,
period: Long = 20,
spawner: (p: Location) -> Unit
spawner: (p: Location) -> Unit = {}
): Arc {
return Arc(
origin,
startAngle,
angle,
radius,
step,
period,
object : ParticleSpawner {

override fun spawn(location: Location) {
spawner(location)
}
})
return Arc(origin, startAngle, angle, radius, step, period, object : ParticleSpawner {
override fun spawn(location: Location) {
spawner(location)
}
})
}

/**
Expand All @@ -150,10 +121,9 @@ fun createAstroid(
radius: Double = 1.0,
step: Double = 1.0,
period: Long = 20,
spawner: (p: Location) -> Unit
spawner: (p: Location) -> Unit = {}
): Astroid {
return Astroid(radius, origin, object : ParticleSpawner {

override fun spawn(location: Location) {
spawner(location)
}
Expand All @@ -176,19 +146,13 @@ fun createCircle(
radius: Double = 1.0,
step: Double = 1.0,
period: Long = 20,
spawner: (p: Location) -> Unit
spawner: (p: Location) -> Unit = {}
): Circle {
return Circle(
origin,
radius,
step,
period,
object : ParticleSpawner {

override fun spawn(location: Location) {
spawner(location)
}
})
return Circle(origin, radius, step, period, object : ParticleSpawner {
override fun spawn(location: Location) {
spawner(location)
}
})
}

/**
Expand All @@ -204,18 +168,13 @@ fun createFilledCircle(
radius: Double = 1.0,
sample: Int = 100,
period: Long = 20,
spawner: (p: Location) -> Unit
spawner: (p: Location) -> Unit = {}
): FilledCircle {
return FilledCircle(
origin,
radius,
sample,
object : ParticleSpawner {

override fun spawn(location: Location) {
spawner(location)
}
}).also { it.period = period }
return FilledCircle(origin, radius, sample, object : ParticleSpawner {
override fun spawn(location: Location) {
spawner(location)
}
}).also { it.period = period }
}

/**
Expand All @@ -231,10 +190,9 @@ fun createCube(
max: Location,
step: Double = 1.0,
period: Long = 20,
spawner: (p: Location) -> Unit
spawner: (p: Location) -> Unit = {}
): Cube {
return Cube(min, max, step, object : ParticleSpawner {

override fun spawn(location: Location) {
spawner(location)
}
Expand All @@ -254,10 +212,9 @@ fun createLine(
end: Location,
step: Double = 1.0,
period: Long = 20,
spawner: (p: Location) -> Unit
spawner: (p: Location) -> Unit = {}
): Line {
return Line(start, end, step, period, object : ParticleSpawner {

override fun spawn(location: Location) {
spawner(location)
}
Expand All @@ -278,10 +235,9 @@ fun createPolygon(
sides: Int = 3,
step: Double = 1.0,
period: Long = 20,
spawner: (p: Location) -> Unit
spawner: (p: Location) -> Unit = {}
): Polygon {
return Polygon(sides, origin, step, object : ParticleSpawner {

override fun spawn(location: Location) {
spawner(location)
}
Expand All @@ -304,13 +260,11 @@ fun createSphere(
radius: Double = 1.0,
sample: Int = 100,
period: Long = 20,
spawner: (p: Location) -> Unit
spawner: (p: Location) -> Unit = {}
): Sphere {
return Sphere(origin, sample, radius, object : ParticleSpawner {

override fun spawn(location: Location) {
spawner(location)
}
}).also { it.period = period }

}
Loading

0 comments on commit 95861ba

Please sign in to comment.