Skip to content
This repository has been archived by the owner on Jun 4, 2023. It is now read-only.

Commit

Permalink
Bump raycast + other misc tiny changes
Browse files Browse the repository at this point in the history
  • Loading branch information
emortaldev committed Apr 11, 2023
1 parent bb0a38d commit f311011
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 13 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions src/main/kotlin/dev/emortal/immortal/game/GameManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -80,7 +78,7 @@ object GameManager {
fun findOrCreateGame(
player: Player,
gameTypeName: String
): CompletableFuture<Game>? {
): CompletableFuture<Game> {
val firstAvailableGame = getGames(gameTypeName)?.firstOrNull {
it.canBeJoined(player)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
8 changes: 4 additions & 4 deletions src/main/kotlin/dev/emortal/immortal/util/FireworkUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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<FireworkEffect>) = listOf(this).showFirework(instance, position, effects)
fun Player.showFireworkWithDuration(instance: Instance, position: Pos, ticks: Int, effects: MutableList<FireworkEffect>) = listOf(this).showFireworkWithDuration(instance, position, ticks, effects)
fun Player.showFirework(instance: Instance, position: Pos, effects: List<FireworkEffect>) = listOf(this).showFirework(instance, position, effects)
fun Player.showFireworkWithDuration(instance: Instance, position: Pos, ticks: Int, effects: List<FireworkEffect>) = listOf(this).showFireworkWithDuration(instance, position, ticks, effects)

fun Collection<Player>.showFirework(
instance: Instance,
position: Pos,
effects: MutableList<FireworkEffect>
effects: List<FireworkEffect>
) {
val fireworkMeta = FireworkMeta.Builder().effects(effects).build()
val fireworkItemStack = ItemStack.builder(Material.FIREWORK_ROCKET).meta(fireworkMeta).build()
Expand All @@ -45,7 +45,7 @@ fun Collection<Player>.showFireworkWithDuration(
instance: Instance,
position: Pos,
ticks: Int,
effects: MutableList<FireworkEffect>
effects: List<FireworkEffect>
) {
val fireworkMeta = FireworkMeta.Builder().effects(effects).build()
val fireworkItemStack = ItemStack.builder(Material.FIREWORK_ROCKET).meta(fireworkMeta).build()
Expand Down
5 changes: 1 addition & 4 deletions src/main/kotlin/dev/emortal/immortal/util/PointUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
fun Point.roundToBlock(): Point = Vec(blockX().toDouble(), blockY().toDouble(), blockZ().toDouble())

0 comments on commit f311011

Please sign in to comment.