diff --git a/Dockerfile b/Dockerfile index e3ffbb2..8902760 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ # for the Dockerfile that is run on our CI/CD pipeline, see production.Dockerfile # Build the project into an executable JAR -FROM gradle:jdk21 as build +FROM gradle:jdk25 as build # Copy build files and source code COPY . /work WORKDIR /work @@ -13,7 +13,7 @@ RUN --mount=target=/home/gradle/.gradle,type=cache \ /usr/bin/gradle --console=plain --info --stacktrace --no-daemon -x test --build-cache build # Run the built JAR and expose port 25565 -FROM eclipse-temurin:21-jre-alpine +FROM eclipse-temurin:25-jre-alpine EXPOSE 25565 EXPOSE 50051 WORKDIR /server diff --git a/README.md b/README.md index e5e27f3..6d587b2 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ available [here](https://wiki.minestom.net). ## Usage Build with `./gradlew build` and run the JAR created at `build/libs/Server-x.x.x-all.jar`. -Requires Java 21 or higher. +Requires Java 25 or higher. ## Development diff --git a/build-logic/src/main/kotlin/server.common-conventions.gradle.kts b/build-logic/src/main/kotlin/server.common-conventions.gradle.kts index 02eec2a..c89c07d 100644 --- a/build-logic/src/main/kotlin/server.common-conventions.gradle.kts +++ b/build-logic/src/main/kotlin/server.common-conventions.gradle.kts @@ -7,6 +7,6 @@ plugins { tasks.withType { compilerOptions { - jvmTarget.set(JvmTarget.JVM_21) + jvmTarget.set(JvmTarget.JVM_25) } } diff --git a/build.gradle.kts b/build.gradle.kts index 4c3cbbb..beb9605 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,7 +1,7 @@ plugins { id("server.common-conventions") - id("com.gradleup.shadow") version "9.0.1" - kotlin("plugin.serialization") version "2.1.10" + id("com.gradleup.shadow") version "9.4.0" + kotlin("plugin.serialization") version "2.3.0" id("net.kyori.blossom") version "2.1.0" `maven-publish` } @@ -75,7 +75,7 @@ publishing { kotlin { jvmToolchain { - languageVersion.set(JavaLanguageVersion.of(21)) + languageVersion.set(JavaLanguageVersion.of(25)) } } diff --git a/common/build.gradle.kts b/common/build.gradle.kts index 0931526..cc590fe 100644 --- a/common/build.gradle.kts +++ b/common/build.gradle.kts @@ -1,6 +1,6 @@ plugins { id("server.common-conventions") - kotlin("plugin.serialization") version "2.1.10" + kotlin("plugin.serialization") version "2.3.0" `maven-publish` } @@ -24,6 +24,7 @@ dependencies { implementation(libs.bundles.messaging) implementation(libs.serialization.json) implementation(libs.bundles.tinylog) + implementation(libs.fastutil) } publishing { @@ -40,4 +41,10 @@ publishing { tasks.getByName("test") { useJUnitPlatform() -} \ No newline at end of file +} + +kotlin { + jvmToolchain { + languageVersion.set(JavaLanguageVersion.of(25)) + } +} diff --git a/common/src/main/kotlin/com/bluedragonmc/server/CustomPlayer.kt b/common/src/main/kotlin/com/bluedragonmc/server/CustomPlayer.kt index 76ddf50..cf398b5 100644 --- a/common/src/main/kotlin/com/bluedragonmc/server/CustomPlayer.kt +++ b/common/src/main/kotlin/com/bluedragonmc/server/CustomPlayer.kt @@ -10,7 +10,7 @@ import net.minestom.server.coordinate.Pos import net.minestom.server.entity.Entity import net.minestom.server.entity.GameMode import net.minestom.server.entity.Player -import net.minestom.server.entity.metadata.PlayerMeta +import net.minestom.server.entity.metadata.avatar.PlayerMeta import net.minestom.server.instance.Instance import net.minestom.server.instance.block.Block import net.minestom.server.network.player.GameProfile diff --git a/common/src/main/kotlin/com/bluedragonmc/server/module/combat/CustomDeathMessageModule.kt b/common/src/main/kotlin/com/bluedragonmc/server/module/combat/CustomDeathMessageModule.kt index 3efbf9f..63a3d5d 100644 --- a/common/src/main/kotlin/com/bluedragonmc/server/module/combat/CustomDeathMessageModule.kt +++ b/common/src/main/kotlin/com/bluedragonmc/server/module/combat/CustomDeathMessageModule.kt @@ -28,7 +28,7 @@ class CustomDeathMessageModule : GameModule() { if (playerName != null) { Component.translatable("death.attack.player", BRAND_COLOR_PRIMARY_2, player.name, playerName) } else { - Component.translatable("death.attack.mob", BRAND_COLOR_PRIMARY_2, player.name, Component.translatable(src.source.entityType.registry().translationKey())) + Component.translatable("death.attack.mob", BRAND_COLOR_PRIMARY_2, player.name, Component.translatable(src.source!!.entityType.registry()!!.translationKey())) } } is EntityProjectileDamage -> { @@ -36,7 +36,7 @@ class CustomDeathMessageModule : GameModule() { if (playerName != null) { Component.translatable("death.attack.arrow", BRAND_COLOR_PRIMARY_2, player.name, playerName) } else if (src.shooter != null) { - Component.translatable("death.attack.arrow", BRAND_COLOR_PRIMARY_2, player.name, Component.translatable(src.shooter!!.entityType.registry().translationKey())) + Component.translatable("death.attack.arrow", BRAND_COLOR_PRIMARY_2, player.name, Component.translatable(src.shooter!!.entityType.registry()!!.translationKey())) } else { Component.translatable("death.attack.generic", BRAND_COLOR_PRIMARY_2, player.name) } diff --git a/common/src/main/kotlin/com/bluedragonmc/server/module/combat/ProjectileModule.kt b/common/src/main/kotlin/com/bluedragonmc/server/module/combat/ProjectileModule.kt index 64891b5..b60e42c 100644 --- a/common/src/main/kotlin/com/bluedragonmc/server/module/combat/ProjectileModule.kt +++ b/common/src/main/kotlin/com/bluedragonmc/server/module/combat/ProjectileModule.kt @@ -346,7 +346,7 @@ class ProjectileModule : GameModule() { ).filter { pos -> // Check if the block should be destroyed based on the radius val distance = pos.distanceSquared(centerX.toDouble(), centerY.toDouble(), centerZ.toDouble()) - val resistance = instance.getBlock(pos).registry().explosionResistance() + val resistance = instance.getBlock(pos).registry()!!.explosionResistance() val maxStrength = strength * 1.5 - resistance / 2.0 if (maxStrength <= 0 || Random.nextDouble(0.0, maxStrength) < distance) return@filter false @@ -359,7 +359,7 @@ class ProjectileModule : GameModule() { parent.callEvent(event) if (dropItems && !event.isCancelled) { - val material = block.registry().material() + val material = block.registry()!!.material() if (material != null) parent.getModule().dropItem(ItemStack.of(material), instance, pos) } diff --git a/common/src/main/kotlin/com/bluedragonmc/server/module/gameplay/NPCModule.kt b/common/src/main/kotlin/com/bluedragonmc/server/module/gameplay/NPCModule.kt index 90e7557..356f58f 100644 --- a/common/src/main/kotlin/com/bluedragonmc/server/module/gameplay/NPCModule.kt +++ b/common/src/main/kotlin/com/bluedragonmc/server/module/gameplay/NPCModule.kt @@ -11,7 +11,7 @@ import net.minestom.server.MinecraftServer import net.minestom.server.coordinate.Pos import net.minestom.server.entity.* import net.minestom.server.entity.damage.DamageType -import net.minestom.server.entity.metadata.PlayerMeta +import net.minestom.server.entity.metadata.avatar.PlayerMeta import net.minestom.server.entity.metadata.display.AbstractDisplayMeta import net.minestom.server.entity.metadata.display.TextDisplayMeta import net.minestom.server.event.Event @@ -144,7 +144,8 @@ class NPCModule : GameModule() { GameMode.CREATIVE, Component.text("[NPC] $randomName", NamedTextColor.DARK_GRAY, TextDecoration.ITALIC), null, - 0 + 0, + true ) ) diff --git a/common/src/main/kotlin/com/bluedragonmc/server/module/vanilla/DoorsModule.kt b/common/src/main/kotlin/com/bluedragonmc/server/module/vanilla/DoorsModule.kt index 66fb877..5b25b26 100644 --- a/common/src/main/kotlin/com/bluedragonmc/server/module/vanilla/DoorsModule.kt +++ b/common/src/main/kotlin/com/bluedragonmc/server/module/vanilla/DoorsModule.kt @@ -70,7 +70,7 @@ class DoorsModule : GameModule() { val shouldPlaySound = playEffect && (block.getProperty("open").equals("true")) != open if (shouldPlaySound) { - val (openSound, closeSound) = (getSounds(block.registry().material() ?: return) ?: return) + val (openSound, closeSound) = (getSounds(block.registry()!!.material() ?: return) ?: return) val soundEvent = if (open) openSound else closeSound val audience = mutableListOf() diff --git a/common/src/main/kotlin/com/bluedragonmc/server/module/vanilla/FallDamageModule.kt b/common/src/main/kotlin/com/bluedragonmc/server/module/vanilla/FallDamageModule.kt index 45b302d..05ed903 100644 --- a/common/src/main/kotlin/com/bluedragonmc/server/module/vanilla/FallDamageModule.kt +++ b/common/src/main/kotlin/com/bluedragonmc/server/module/vanilla/FallDamageModule.kt @@ -94,7 +94,7 @@ class FallDamageModule : GameModule() { val blockPos = Pos(x.toDouble(), y.toDouble(), z.toDouble()) val blockCenter = blockPos.add(0.5, 0.5, 0.5) - val blockBoundingBox = player.instance.getBlock(blockPos).registry().collisionShape() + val blockBoundingBox = player.instance.getBlock(blockPos).registry()!!.collisionShape() val collides = blockBoundingBox.intersectBox(player.position.sub(blockPos), expandedBoundingBox) if (!collides) continue diff --git a/common/src/main/kotlin/com/bluedragonmc/server/module/vanilla/ItemDropModule.kt b/common/src/main/kotlin/com/bluedragonmc/server/module/vanilla/ItemDropModule.kt index fb34127..eb5135b 100644 --- a/common/src/main/kotlin/com/bluedragonmc/server/module/vanilla/ItemDropModule.kt +++ b/common/src/main/kotlin/com/bluedragonmc/server/module/vanilla/ItemDropModule.kt @@ -81,7 +81,7 @@ class ItemDropModule(var dropBlocksOnBreak: Boolean = true, var dropAllOnDeath: } eventNode.addListener(PlayerBlockBreakEvent::class.java) { event -> if (dropBlocksOnBreak && !event.isCancelled && !excludedBlocks.contains(event.block)) { - val itemStack = ItemStack.of(event.block.registry().material() ?: Material.AIR, 1) + val itemStack = ItemStack.of(event.block.registry()!!.material() ?: Material.AIR, 1) val dropEvent = BlockItemDropEvent(event.instance, event.block, event.blockPosition, itemStack) parent.callCancellable(dropEvent) { dropItem( diff --git a/common/src/main/kotlin/com/bluedragonmc/server/utils/BlockUtils.kt b/common/src/main/kotlin/com/bluedragonmc/server/utils/BlockUtils.kt index 2395e36..cf82b5c 100644 --- a/common/src/main/kotlin/com/bluedragonmc/server/utils/BlockUtils.kt +++ b/common/src/main/kotlin/com/bluedragonmc/server/utils/BlockUtils.kt @@ -2,7 +2,7 @@ package com.bluedragonmc.server.utils import net.minestom.server.instance.block.Block -fun Block.isFullCube() = registry().collisionShape().run { +fun Block.isFullCube() = registry()!!.collisionShape().run { val start = relativeStart().isZero val end = relativeEnd().samePoint(1.0, 1.0, 1.0) start && end diff --git a/common/src/main/kotlin/com/bluedragonmc/server/utils/TextUtils.kt b/common/src/main/kotlin/com/bluedragonmc/server/utils/TextUtils.kt index d4e6159..996df12 100644 --- a/common/src/main/kotlin/com/bluedragonmc/server/utils/TextUtils.kt +++ b/common/src/main/kotlin/com/bluedragonmc/server/utils/TextUtils.kt @@ -51,17 +51,17 @@ fun Component.hoverEventTranslatable(key: String, color: TextColor): Component = hoverEvent(Component.translatable(key, color)) fun Component.clickEvent(command: String): Component = - clickEvent(ClickEvent.clickEvent(ClickEvent.Action.RUN_COMMAND, command)) + clickEvent(ClickEvent.clickEvent(ClickEvent.Action.RUN_COMMAND, ClickEvent.Payload.string(command))) fun Component.clickEvent(action: ClickEvent.Action, value: String): Component { if (action == ClickEvent.Action.COPY_TO_CLIPBOARD && hoverEvent() == null) { - return clickEvent(ClickEvent.clickEvent(action, value)).hoverEventTranslatable( + return clickEvent(ClickEvent.clickEvent(action, ClickEvent.Payload.string(value))).hoverEventTranslatable( "command.click_to_copy", ALT_COLOR_1 ) } if (action == ClickEvent.Action.OPEN_URL && hoverEvent() == null) { - return clickEvent(ClickEvent.clickEvent(action, value)).hoverEvent( + return clickEvent(ClickEvent.clickEvent(action, ClickEvent.Payload.string(value))).hoverEvent( Component.translatable( "command.click_to_open_url", ALT_COLOR_1, @@ -69,11 +69,11 @@ fun Component.clickEvent(action: ClickEvent.Action, value: String): Component { ) ) } - return clickEvent(ClickEvent.clickEvent(action, value)) + return clickEvent(ClickEvent.clickEvent(action, ClickEvent.Payload.string(value))) } -fun Material.displayName() = Component.translatable(registry().translationKey()) -fun Material.displayName(color: TextColor) = Component.translatable(registry().translationKey(), color) +fun Material.displayName() = Component.translatable(registry()!!.translationKey()) +fun Material.displayName(color: TextColor) = Component.translatable(registry()!!.translationKey(), color) fun Component.noItalic() = decoration(TextDecoration.ITALIC, false) fun Component.noBold() = decoration(TextDecoration.BOLD, false) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 012a3d7..67a7e1d 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,8 +1,8 @@ metadata.format.version = "1.1" [versions] -kotlin = "2.1.10" -minestom = "2025.07.27-1.21.8" +kotlin = "2.3.0" +minestom = "2026.03.03-1.21.11" jukebox = "a941945c86" configurate = "4.2.0" minimessage = "4.19.0" @@ -12,6 +12,7 @@ okhttp = "4.12.0" serialization = "1.8.0" tinylog = "2.7.0" atlas-projectiles = "2.1.2" +fastutil = "8.5.18" # Auto-generated GRPC/Protobuf messaging code rpc = "d40ac743b5" # Messaging dependencies @@ -19,7 +20,7 @@ grpc = "1.71.0" grpc-kotlin-stub = "1.4.1" protobuf-kotlin = "4.30.1" # Testing dependencies -mockk = "1.13.11" +mockk = "1.14.9" junit = "5.9.0" [libraries] @@ -31,6 +32,7 @@ configurate = { group = "org.spongepowered", name = "configurate-yaml", version. configurate-extra-kotlin = { group = "org.spongepowered", name = "configurate-extra-kotlin", version.ref = "configurate" } minimessage = { group = "net.kyori", name = "adventure-text-minimessage", version.ref = "minimessage" } atlas-projectiles = { group = "ca.atlasengine", name = "atlas-projectiles", version.ref = "atlas-projectiles" } +fastutil = { group = "it.unimi.dsi", name = "fastutil", version.ref = "fastutil" } kmongo = { group = "org.litote.kmongo", name = "kmongo-coroutine-serialization", version.ref = "kmongo" } serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "serialization" } caffeine = { group = "com.github.ben-manes.caffeine", name = "caffeine", version.ref = "caffeine" } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 9bbc975..8bdaf60 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 2a84e18..c61a118 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index faf9300..ef07e01 100755 --- a/gradlew +++ b/gradlew @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright © 2015-2021 the original authors. +# Copyright © 2015 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -114,7 +114,7 @@ case "$( uname )" in #( NONSTOP* ) nonstop=true ;; esac -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +CLASSPATH="\\\"\\\"" # Determine the Java command to use to start the JVM. @@ -213,7 +213,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ "$@" # Stop when "xargs" is not available. diff --git a/gradlew.bat b/gradlew.bat index 9b42019..5eed7ee 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -70,11 +70,11 @@ goto fail :execute @rem Setup the command line -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +set CLASSPATH= @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* :end @rem End local scope for the variables with windows NT shell diff --git a/jitpack.yml b/jitpack.yml index a202792..c39ce5d 100644 --- a/jitpack.yml +++ b/jitpack.yml @@ -1,2 +1,2 @@ jdk: - - openjdk21 \ No newline at end of file + - openjdk25 \ No newline at end of file diff --git a/production.Dockerfile b/production.Dockerfile index 0ddaaaa..5bcca66 100644 --- a/production.Dockerfile +++ b/production.Dockerfile @@ -2,7 +2,7 @@ # This Dockerfile runs on the CI/CD pipeline when the Server is being deployed. # Build the project into an executable JAR -FROM docker.io/library/gradle:8.13-jdk21 as build +FROM docker.io/library/gradle:9.4-jdk25 as build # Copy build files and source code COPY . /work WORKDIR /work @@ -10,7 +10,7 @@ WORKDIR /work RUN /usr/bin/gradle --console=plain --info --stacktrace --no-daemon build # Run the built JAR and expose port 25565 -FROM docker.io/library/eclipse-temurin:21-jre-alpine +FROM docker.io/library/eclipse-temurin:25-jre-alpine EXPOSE 25565 EXPOSE 50051 WORKDIR /server diff --git a/settings.gradle.kts b/settings.gradle.kts index 65263f3..5661cc4 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -5,4 +5,3 @@ pluginManagement { } include("common") - diff --git a/src/main/kotlin/com/bluedragonmc/server/Server.kt b/src/main/kotlin/com/bluedragonmc/server/Server.kt index dfdefd4..8e64bdb 100644 --- a/src/main/kotlin/com/bluedragonmc/server/Server.kt +++ b/src/main/kotlin/com/bluedragonmc/server/Server.kt @@ -3,13 +3,12 @@ package com.bluedragonmc.server import com.bluedragonmc.server.api.Environment import com.bluedragonmc.server.bootstrap.* import com.bluedragonmc.server.bootstrap.dev.DevInstanceRouter -import com.bluedragonmc.server.bootstrap.dev.MojangAuthentication import com.bluedragonmc.server.bootstrap.dev.OpenToLAN import com.bluedragonmc.server.bootstrap.prod.AgonesIntegration import com.bluedragonmc.server.bootstrap.prod.InitialInstanceRouter -import com.bluedragonmc.server.bootstrap.prod.VelocityForwarding import com.bluedragonmc.server.queue.GameLoader import com.bluedragonmc.server.queue.createEnvironment +import net.minestom.server.Auth import net.minestom.server.MinecraftServer import org.slf4j.LoggerFactory import java.text.DateFormat @@ -38,7 +37,20 @@ fun start() { Environment.setEnvironment(createEnvironment()) logger.info("Starting Minecraft server in environment ${Environment.current::class.simpleName}") - val minecraftServer = MinecraftServer.init() + lateinit var auth: Auth + val velocitySecret: String? = System.getenv("PUFFIN_VELOCITY_SECRET") + + if (velocitySecret != null) { + auth = Auth.Velocity(System.getenv("PUFFIN_VELOCITY_SECRET").trim()) + MinecraftServer.setCompressionThreshold(0) // Disable compression because packets are being proxied + } else { + if (!Environment.isDev) { + logger.warn("Warning: Running in a production-like environment without Velocity forwarding!") + } + auth = Auth.Online() + } + + val minecraftServer = MinecraftServer.init(auth) val eventNode = MinecraftServer.getGlobalEventHandler() val services = listOf( @@ -55,13 +67,11 @@ fun start() { InitialInstanceRouter, IntegrationsInit, Jukebox, - MojangAuthentication, OpenToLAN, PerInstanceChat, PerInstanceTabList, ServerListPingHandler, TabListFormat, - VelocityForwarding ).filter { it.canHook() } // Load game plugins and preinitialize their main classes diff --git a/src/main/kotlin/com/bluedragonmc/server/bootstrap/PerInstanceTabList.kt b/src/main/kotlin/com/bluedragonmc/server/bootstrap/PerInstanceTabList.kt index 0a3a66b..8e25d6f 100644 --- a/src/main/kotlin/com/bluedragonmc/server/bootstrap/PerInstanceTabList.kt +++ b/src/main/kotlin/com/bluedragonmc/server/bootstrap/PerInstanceTabList.kt @@ -79,6 +79,7 @@ object PerInstanceTabList : Bootstrap() { player.gameMode, player.name, null, - 1024 + 1024, + true ) } \ No newline at end of file diff --git a/src/main/kotlin/com/bluedragonmc/server/bootstrap/dev/MojangAuthentication.kt b/src/main/kotlin/com/bluedragonmc/server/bootstrap/dev/MojangAuthentication.kt deleted file mode 100644 index d9b357f..0000000 --- a/src/main/kotlin/com/bluedragonmc/server/bootstrap/dev/MojangAuthentication.kt +++ /dev/null @@ -1,14 +0,0 @@ -package com.bluedragonmc.server.bootstrap.dev - -import com.bluedragonmc.server.bootstrap.Bootstrap -import net.minestom.server.event.Event -import net.minestom.server.event.EventNode -import net.minestom.server.extras.MojangAuth - -object MojangAuthentication : Bootstrap() { - override fun hook(eventNode: EventNode) { - if (System.getenv("PUFFIN_VELOCITY_SECRET") == null) { - MojangAuth.init() - } - } -} \ No newline at end of file diff --git a/src/main/kotlin/com/bluedragonmc/server/bootstrap/prod/VelocityForwarding.kt b/src/main/kotlin/com/bluedragonmc/server/bootstrap/prod/VelocityForwarding.kt deleted file mode 100644 index f1461ec..0000000 --- a/src/main/kotlin/com/bluedragonmc/server/bootstrap/prod/VelocityForwarding.kt +++ /dev/null @@ -1,19 +0,0 @@ -package com.bluedragonmc.server.bootstrap.prod - -import com.bluedragonmc.server.api.Environment -import com.bluedragonmc.server.bootstrap.Bootstrap -import net.minestom.server.MinecraftServer -import net.minestom.server.event.Event -import net.minestom.server.event.EventNode -import net.minestom.server.extras.velocity.VelocityProxy - -object VelocityForwarding : Bootstrap() { - override fun hook(eventNode: EventNode) { - if (System.getenv("PUFFIN_VELOCITY_SECRET") != null) { - VelocityProxy.enable(System.getenv("PUFFIN_VELOCITY_SECRET").trim()) - MinecraftServer.setCompressionThreshold(0) // Disable compression because packets are being proxied - } else if (!Environment.current.isDev) { - logger.warn("Warning: Running in a production-like environment without Velocity forwarding!") - } - } -} \ No newline at end of file diff --git a/src/main/kotlin/com/bluedragonmc/server/command/GiveCommand.kt b/src/main/kotlin/com/bluedragonmc/server/command/GiveCommand.kt index 367db63..c0d30bd 100644 --- a/src/main/kotlin/com/bluedragonmc/server/command/GiveCommand.kt +++ b/src/main/kotlin/com/bluedragonmc/server/command/GiveCommand.kt @@ -17,7 +17,7 @@ class GiveCommand(name: String, usageString: String, vararg aliases: String) : sender.sendMessage(formatMessageTranslated("command.give.self", 1, - Component.translatable(itemStack.material().registry().translationKey()))) + Component.translatable(itemStack.material().registry()!!.translationKey()))) }.requirePlayers() syntax(itemArgument, amountArgument) { @@ -28,7 +28,7 @@ class GiveCommand(name: String, usageString: String, vararg aliases: String) : sender.sendMessage(formatMessageTranslated("command.give.self", amount, - Component.translatable(itemStack.material().registry().translationKey()))) + Component.translatable(itemStack.material().registry()!!.translationKey()))) }.requirePlayers() syntax(playerArgument, itemArgument) { @@ -40,7 +40,7 @@ class GiveCommand(name: String, usageString: String, vararg aliases: String) : sender.sendMessage(formatMessageTranslated("command.give.other", player.name, 1, - Component.translatable(itemStack.material().registry().translationKey()))) + Component.translatable(itemStack.material().registry()!!.translationKey()))) } syntax(playerArgument, itemArgument, amountArgument) { @@ -53,6 +53,6 @@ class GiveCommand(name: String, usageString: String, vararg aliases: String) : sender.sendMessage(formatMessageTranslated("command.give.other", player.name, amount, - Component.translatable(itemStack.material().registry().translationKey()))) + Component.translatable(itemStack.material().registry()!!.translationKey()))) } }) \ No newline at end of file diff --git a/src/main/kotlin/com/bluedragonmc/server/command/SetBlockCommand.kt b/src/main/kotlin/com/bluedragonmc/server/command/SetBlockCommand.kt index 7cc70aa..a127db1 100644 --- a/src/main/kotlin/com/bluedragonmc/server/command/SetBlockCommand.kt +++ b/src/main/kotlin/com/bluedragonmc/server/command/SetBlockCommand.kt @@ -22,7 +22,7 @@ class SetBlockCommand( formatMessageTranslated( "command.setblock.response", formatPos(pos), - Component.translatable(block.registry().translationKey()) + Component.translatable(block.registry()!!.translationKey()) ) ) }.requirePlayers()