Skip to content

Commit

Permalink
Remove resource pack test
Browse files Browse the repository at this point in the history
  • Loading branch information
andantet committed Oct 17, 2024
1 parent 045ddb3 commit c239bad
Showing 1 changed file with 0 additions and 38 deletions.
38 changes: 0 additions & 38 deletions src/test/kotlin/dev/andante/audience/test/AudienceTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,13 @@ import com.mojang.serialization.JsonOps
import dev.andante.audience.Audience
import dev.andante.audience.player.PlayerSet
import dev.andante.audience.player.StandalonePlayerReference
import dev.andante.audience.resource.ByteResourcePack
import net.fabricmc.api.ModInitializer
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents
import org.slf4j.LoggerFactory
import java.nio.file.Path
import kotlin.io.path.readBytes
import kotlin.math.sin
import kotlin.time.measureTimedValue

object AudienceTest : ModInitializer {
private const val TEST_RESOURCE_PACK: Boolean = false

private val logger = LoggerFactory.getLogger("Audience Test")

override fun onInitialize() {
Expand All @@ -32,38 +26,6 @@ object AudienceTest : ModInitializer {
}
}

if (TEST_RESOURCE_PACK) {
val byteArray = try {
Path.of("resources.zip").readBytes()
} catch (exception: Exception) {
logger.error("No resources.zip", exception)
throw exception
}

val resourcePack = ByteResourcePack(byteArray)

val otherByteArray = try {
Path.of("resources2.zip").readBytes()
} catch (exception: Exception) {
logger.error("No resources2.zip", exception)
throw exception
}

val otherResourcePack = ByteResourcePack(otherByteArray)

val resourcePackServer = ResourcePackServer("localhost", 25566).apply {
registerResourcePack(resourcePack)
registerResourcePack(otherResourcePack)
}

resourcePackServer.startServer()
println("Started server on port ${resourcePackServer.port}")

ServerLifecycleEvents.SERVER_STOPPING.register {
resourcePackServer.stopServer()
}
}

// test player reference codec IO (ensure possible migration of old uuids)
val input = "{\"uuid\":\"50c7e7c5-2407-4102-875f-e4b1f49ea61a\"}"
val inputJson = JsonParser.parseString(input)
Expand Down

0 comments on commit c239bad

Please sign in to comment.