From 39620b6f55945d71ca230d432831aecc8c8f3114 Mon Sep 17 00:00:00 2001 From: bluefireoly Date: Sun, 11 Oct 2020 18:21:00 +0200 Subject: [PATCH] Updated particle and sound utils --- .../kotlin/net/axay/kspigot/particles/KSpigotParticles.kt | 6 +++--- src/main/kotlin/net/axay/kspigot/sound/KSpigotSound.kt | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/kotlin/net/axay/kspigot/particles/KSpigotParticles.kt b/src/main/kotlin/net/axay/kspigot/particles/KSpigotParticles.kt index 398779fa..fe2a5116 100644 --- a/src/main/kotlin/net/axay/kspigot/particles/KSpigotParticles.kt +++ b/src/main/kotlin/net/axay/kspigot/particles/KSpigotParticles.kt @@ -65,7 +65,7 @@ data class KSpigotParticle( * Accesses the particle builder. * @see KSpigotParticle */ -fun particle(particle: Particle, builder: (KSpigotParticle.() -> Unit)?) +fun particle(particle: Particle, builder: KSpigotParticle.() -> Unit) = KSpigotParticle(particle).apply(builder) /** @@ -73,7 +73,7 @@ fun particle(particle: Particle, builder: (KSpigotParticle.() -> Unit)?) * spawns the particle at the given location. * @see KSpigotParticle */ -fun Location.particle(particle: Particle, builder: (KSpigotParticle.() -> Unit)?) +fun Location.particle(particle: Particle, builder: (KSpigotParticle.() -> Unit)? = null) = KSpigotParticle(particle).apply(builder).spawnAt(this) /** @@ -81,5 +81,5 @@ fun Location.particle(particle: Particle, builder: (KSpigotParticle.() -> Unit)? * spawns the particle for the player. * @see KSpigotParticle */ -fun Player.particle(particle: Particle, builder: (KSpigotParticle.() -> Unit)?) +fun Player.particle(particle: Particle, builder: (KSpigotParticle.() -> Unit)? = null) = KSpigotParticle(particle).apply(builder).spawnFor(this) \ No newline at end of file diff --git a/src/main/kotlin/net/axay/kspigot/sound/KSpigotSound.kt b/src/main/kotlin/net/axay/kspigot/sound/KSpigotSound.kt index 67d1f662..467b410d 100644 --- a/src/main/kotlin/net/axay/kspigot/sound/KSpigotSound.kt +++ b/src/main/kotlin/net/axay/kspigot/sound/KSpigotSound.kt @@ -44,7 +44,7 @@ data class KSpigotSound( * Accesses the sound builder. * @see KSpigotSound */ -fun sound(sound: Sound, builder: (KSpigotSound.() -> Unit)?) +fun sound(sound: Sound, builder: KSpigotSound.() -> Unit) = KSpigotSound(sound).apply(builder) /** @@ -52,7 +52,7 @@ fun sound(sound: Sound, builder: (KSpigotSound.() -> Unit)?) * plays the sound at the given location. * @see KSpigotSound */ -fun Location.sound(sound: Sound, builder: (KSpigotSound.() -> Unit)?) +fun Location.sound(sound: Sound, builder: (KSpigotSound.() -> Unit)? = null) = KSpigotSound(sound).apply(builder).playAt(this) /** @@ -60,5 +60,5 @@ fun Location.sound(sound: Sound, builder: (KSpigotSound.() -> Unit)?) * plays the sound for the player. * @see KSpigotSound */ -fun Player.sound(sound: Sound, builder: (KSpigotSound.() -> Unit)?) +fun Player.sound(sound: Sound, builder: (KSpigotSound.() -> Unit)? = null) = KSpigotSound(sound).apply(builder).playFor(this)