Now using worldOrException

This commit is contained in:
bluefireoly
2020-09-05 20:09:26 +02:00
parent 2b43474de5
commit 70e7476d45
2 changed files with 5 additions and 3 deletions

View File

@@ -3,6 +3,7 @@
package net.axay.kspigot.structures
import net.axay.kspigot.extensions.geometry.SimpleLocation2D
import net.axay.kspigot.extensions.geometry.worldOrException
import net.axay.kspigot.particles.KSpigotParticle
import org.bukkit.Location
import org.bukkit.Material
@@ -87,6 +88,6 @@ class ParticleCircle(radius: Number, val particle: KSpigotParticle) : Circle(rad
class EntityCircle(radius: Number, val entityType: EntityType) : Circle(radius) {
override fun setAt(loc: Location) {
loc.world?.spawnEntity(loc, entityType) ?: throw IllegalArgumentException("The world of the given location is null!")
loc.worldOrException.spawnEntity(loc, entityType)
}
}