From f31101193e7dc648f8b66b53745ad2c6ee1210c4 Mon Sep 17 00:00:00 2001 From: emortaldev Date: Wed, 12 Apr 2023 00:59:00 +0100 Subject: [PATCH] Bump raycast + other misc tiny changes --- build.gradle.kts | 2 +- src/main/kotlin/dev/emortal/immortal/game/GameManager.kt | 4 +--- .../kotlin/dev/emortal/immortal/util/DefaultFontInfo.kt | 2 +- .../kotlin/dev/emortal/immortal/util/FireworkUtils.kt | 8 ++++---- src/main/kotlin/dev/emortal/immortal/util/PointUtils.kt | 5 +---- 5 files changed, 8 insertions(+), 13 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 0b4cf15..5289804 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -24,7 +24,7 @@ dependencies { // Util // api("com.github.EmortalMC:KStom:50b2b882fa") api("com.github.emortaldev:Particable:f7212f39fb") - api("com.github.EmortalMC:Rayfast:684e854a48") + api("com.github.EmortalMC:rayfast:9e5accbdfd") api("net.kyori:adventure-text-minimessage:4.12.0") // DB diff --git a/src/main/kotlin/dev/emortal/immortal/game/GameManager.kt b/src/main/kotlin/dev/emortal/immortal/game/GameManager.kt index d12a318..90c9d1b 100644 --- a/src/main/kotlin/dev/emortal/immortal/game/GameManager.kt +++ b/src/main/kotlin/dev/emortal/immortal/game/GameManager.kt @@ -17,8 +17,6 @@ import kotlin.reflect.full.primaryConstructor object GameManager { -// private val createGameScope = CoroutineScope(Dispatchers.IO) - private val LOGGER = LoggerFactory.getLogger(GameManager::class.java) // Instance Tags @@ -80,7 +78,7 @@ object GameManager { fun findOrCreateGame( player: Player, gameTypeName: String - ): CompletableFuture? { + ): CompletableFuture { val firstAvailableGame = getGames(gameTypeName)?.firstOrNull { it.canBeJoined(player) } diff --git a/src/main/kotlin/dev/emortal/immortal/util/DefaultFontInfo.kt b/src/main/kotlin/dev/emortal/immortal/util/DefaultFontInfo.kt index c1a77cd..bcc632a 100644 --- a/src/main/kotlin/dev/emortal/immortal/util/DefaultFontInfo.kt +++ b/src/main/kotlin/dev/emortal/immortal/util/DefaultFontInfo.kt @@ -72,7 +72,7 @@ internal enum class DefaultFontInfo(val character: Char, val length: Int) { AMPERSAND('&', 5), ASTERISK('*', 5), LEFT_PARENTHESIS('(', 4), - RIGHT_PERENTHESIS(')', 4), + RIGHT_PARENTHESIS(')', 4), MINUS('-', 5), UNDERSCORE('_', 5), PLUS_SIGN('+', 5), diff --git a/src/main/kotlin/dev/emortal/immortal/util/FireworkUtils.kt b/src/main/kotlin/dev/emortal/immortal/util/FireworkUtils.kt index 2ff3850..8f0299d 100644 --- a/src/main/kotlin/dev/emortal/immortal/util/FireworkUtils.kt +++ b/src/main/kotlin/dev/emortal/immortal/util/FireworkUtils.kt @@ -18,13 +18,13 @@ import net.minestom.server.timer.TaskSchedule import net.minestom.server.utils.PacketUtils.sendGroupedPacket import java.util.concurrent.ThreadLocalRandom -fun Player.showFirework(instance: Instance, position: Pos, effects: MutableList) = listOf(this).showFirework(instance, position, effects) -fun Player.showFireworkWithDuration(instance: Instance, position: Pos, ticks: Int, effects: MutableList) = listOf(this).showFireworkWithDuration(instance, position, ticks, effects) +fun Player.showFirework(instance: Instance, position: Pos, effects: List) = listOf(this).showFirework(instance, position, effects) +fun Player.showFireworkWithDuration(instance: Instance, position: Pos, ticks: Int, effects: List) = listOf(this).showFireworkWithDuration(instance, position, ticks, effects) fun Collection.showFirework( instance: Instance, position: Pos, - effects: MutableList + effects: List ) { val fireworkMeta = FireworkMeta.Builder().effects(effects).build() val fireworkItemStack = ItemStack.builder(Material.FIREWORK_ROCKET).meta(fireworkMeta).build() @@ -45,7 +45,7 @@ fun Collection.showFireworkWithDuration( instance: Instance, position: Pos, ticks: Int, - effects: MutableList + effects: List ) { val fireworkMeta = FireworkMeta.Builder().effects(effects).build() val fireworkItemStack = ItemStack.builder(Material.FIREWORK_ROCKET).meta(fireworkMeta).build() diff --git a/src/main/kotlin/dev/emortal/immortal/util/PointUtils.kt b/src/main/kotlin/dev/emortal/immortal/util/PointUtils.kt index 532debe..635ad45 100644 --- a/src/main/kotlin/dev/emortal/immortal/util/PointUtils.kt +++ b/src/main/kotlin/dev/emortal/immortal/util/PointUtils.kt @@ -14,7 +14,4 @@ operator fun Point.times(other: Double): Point = this.mul(other) operator fun Point.div(other: Point): Point = this.div(other) operator fun Point.div(other: Double): Point = this.div(other) -fun Point.roundToBlock(): Point = Vec(blockX().toDouble(), blockY().toDouble(), blockZ().toDouble()) - -fun Point.asVec(): Vec = Vec.fromPoint(this) -fun Point.asPos(): Pos = Pos.fromPoint(this) \ No newline at end of file +fun Point.roundToBlock(): Point = Vec(blockX().toDouble(), blockY().toDouble(), blockZ().toDouble()) \ No newline at end of file