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

Commit

Permalink
idek
Browse files Browse the repository at this point in the history
  • Loading branch information
emortal committed Mar 6, 2022
1 parent 33d521e commit aa287f7
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 28 deletions.
16 changes: 8 additions & 8 deletions build.gradle.kts
Expand Up @@ -2,18 +2,18 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
// Apply the Kotlin JVM plugin to add support for Kotlin.
id("org.jetbrains.kotlin.jvm") version "1.5.20"
id("org.jetbrains.kotlin.jvm") version "1.6.10"
// Kotlinx serialization for any data format
kotlin("plugin.serialization") version "1.4.21"
kotlin("plugin.serialization") version "1.6.10"
// Shade the plugin
id("com.github.johnrengelman.shadow") version "7.0.0"
id("com.github.johnrengelman.shadow") version "7.1.2"
// Allow publishing
`maven-publish`

// Apply the application plugin to add support for building a jar
java
// Dokka documentation w/ kotlin
id("org.jetbrains.dokka") version "1.5.0"
id("org.jetbrains.dokka") version "1.6.10"
}

repositories {
Expand All @@ -36,11 +36,11 @@ dependencies {
// Use the Kotlin reflect library.
compileOnly(kotlin("reflect"))

compileOnly("com.github.Minestom:Minestom:0bcfc39a9d")
compileOnly("com.github.EmortalMC:Immortal:a226a09091")
compileOnly("com.github.Minestom:Minestom:dab6ec6000")
compileOnly("com.github.EmortalMC:Immortal:81dfdace2b")

// import kotlinx serialization
compileOnly("org.jetbrains.kotlinx:kotlinx-serialization-json:1.2.2")
compileOnly("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2")
}
tasks.withType<Test> {
useJUnitPlatform()
Expand Down Expand Up @@ -82,7 +82,7 @@ java {
}

val compileKotlin: KotlinCompile by tasks
compileKotlin.kotlinOptions.jvmTarget = JavaVersion.VERSION_16.toString()
compileKotlin.kotlinOptions.jvmTarget = JavaVersion.VERSION_17.toString()

compileKotlin.kotlinOptions {
freeCompilerArgs = listOf("-Xinline-classes")
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
1 change: 1 addition & 0 deletions src/main/kotlin/emortal/holeymoley/HoleyMoleyExtension.kt
Expand Up @@ -27,6 +27,7 @@ class HoleyMoleyExtension : Extension() {
"holeymoley",
"<gradient:gold:yellow><bold>HoleyMoley".asMini(),
true,
true,
WhenToRegisterEvents.GAME_START,
GameOptions(
maxPlayers = 15,
Expand Down
5 changes: 4 additions & 1 deletion src/main/kotlin/emortal/holeymoley/command/doEvent.kt
Expand Up @@ -8,6 +8,9 @@ import world.cepi.kstom.command.arguments.suggest
import world.cepi.kstom.command.kommand.Kommand

object doEvent : Kommand({

onlyPlayers

val eventArg = ArgumentType.StringArray("event").suggest {
Event.eventList.map { it.name }
}
Expand All @@ -19,6 +22,6 @@ object doEvent : Kommand({
return@syntax
}

event.performEvent(sender.asPlayer().game!! as HoleyMoleyGame)
event.performEvent(player.game!! as HoleyMoleyGame)
}
}, "doevent")
1 change: 0 additions & 1 deletion src/main/kotlin/emortal/holeymoley/game/HoleyMoleyGame.kt
Expand Up @@ -54,7 +54,6 @@ class HoleyMoleyGame(gameOptions: GameOptions) : PvpGame(gameOptions) {

var eventLoopTask: Task? = null

val maxChests = 0.01 * (instance.getTag(MapCreator.mapSizeTag)!!).toDouble().pow(3)
var uncoveredChests = mutableListOf<Block>()

val blocksPlacedByPlayer = mutableListOf<Point>()
Expand Down
10 changes: 6 additions & 4 deletions src/main/kotlin/emortal/holeymoley/item/Item.kt
Expand Up @@ -6,6 +6,9 @@ import net.minestom.server.item.ItemStack
import net.minestom.server.item.ItemStackBuilder
import net.minestom.server.item.Material
import net.minestom.server.tag.Tag
import world.cepi.kstom.adventure.noItalic
import world.cepi.kstom.item.item
import world.cepi.kstom.item.withMeta
import java.util.concurrent.ThreadLocalRandom

sealed class Item(val id: String, val material: Material, val rarity: Rarity, val itemCreate: (ItemStackBuilder) -> Unit = { }) {
Expand Down Expand Up @@ -46,11 +49,10 @@ sealed class Item(val id: String, val material: Material, val rarity: Rarity, va

fun createItemStack(): ItemStack {
return ItemStack.builder(material)
.meta {
it.setTag(itemIdTag, id)
it
.withMeta {
setTag(itemIdTag, id)
}
.lore(rarity.component.decoration(TextDecoration.ITALIC, false))
.lore(rarity.component.noItalic())
.also { itemCreate.invoke(it) }
.build()
}
Expand Down
5 changes: 3 additions & 2 deletions src/main/kotlin/emortal/holeymoley/item/Shovel.kt
Expand Up @@ -2,12 +2,13 @@ package emortal.holeymoley.item

import net.minestom.server.item.Enchantment
import net.minestom.server.item.Material
import world.cepi.kstom.item.withMeta

object Shovel : Item(
"shovel",
Material.STONE_SHOVEL,
Rarity.IMPOSSIBLE,
{ it.meta { meta ->
meta.enchantment(Enchantment.EFFICIENCY, 5)
{ it.withMeta {
enchantment(Enchantment.EFFICIENCY, 5)
} }
)
2 changes: 0 additions & 2 deletions src/main/kotlin/emortal/holeymoley/map/HoleyMoleyGenerator.kt
Expand Up @@ -30,7 +30,5 @@ class HoleyMoleyGenerator(private val mapSize: Int) : ChunkGenerator {
}
}

override fun fillBiomes(biomes: Array<out Biome>, chunkX: Int, chunkZ: Int) = Arrays.fill(biomes, Biome.PLAINS)

override fun getPopulators(): MutableList<ChunkPopulator>? = null
}
9 changes: 0 additions & 9 deletions src/main/kotlin/emortal/holeymoley/util/PotionUtil.kt

This file was deleted.

0 comments on commit aa287f7

Please sign in to comment.