From 2810721fb69618ad5d38e7f67915ca8ae385476e Mon Sep 17 00:00:00 2001 From: bluefireoly Date: Sun, 11 Oct 2020 18:18:48 +0200 Subject: [PATCH] Updated particle utils --- .../net/axay/kspigot/particles/KSpigotParticles.kt | 11 +++++------ 1 file changed, 5 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 f2e16d24..398779fa 100644 --- a/src/main/kotlin/net/axay/kspigot/particles/KSpigotParticles.kt +++ b/src/main/kotlin/net/axay/kspigot/particles/KSpigotParticles.kt @@ -1,6 +1,7 @@ package net.axay.kspigot.particles import net.axay.kspigot.extensions.geometry.worldOrException +import net.axay.kspigot.kotlinextensions.apply import org.bukkit.Location import org.bukkit.Particle import org.bukkit.entity.Player @@ -64,23 +65,21 @@ 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) /** * Accesses the particle builder and then immediately * spawns the particle at the given location. * @see KSpigotParticle - * @see KSpigotParticle.spawnAt */ -fun Location.particle(particle: Particle, builder: KSpigotParticle.() -> Unit) +fun Location.particle(particle: Particle, builder: (KSpigotParticle.() -> Unit)?) = KSpigotParticle(particle).apply(builder).spawnAt(this) /** * Accesses the particle builder and then immediately * spawns the particle for the player. * @see KSpigotParticle - * @see KSpigotParticle.spawnFor */ -fun Player.particle(particle: Particle, builder: KSpigotParticle.() -> Unit) - = KSpigotParticle(particle).apply(builder).spawnFor(this) +fun Player.particle(particle: Particle, builder: (KSpigotParticle.() -> Unit)?) + = KSpigotParticle(particle).apply(builder).spawnFor(this) \ No newline at end of file