Skip to content

Commit

Permalink
feat(build): Java 21
Browse files Browse the repository at this point in the history
chore(deps): Updated Minestom
fix(build)
  • Loading branch information
xGab0 committed Jun 10, 2024
1 parent 6c2eeb7 commit d762e6c
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 15 deletions.
20 changes: 13 additions & 7 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ base {
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21

toolchain {
languageVersion = JavaLanguageVersion.of(21)
}

tasks.withType<ProcessResources> {
filteringCharset = "UTF-8"
Expand Down Expand Up @@ -57,14 +61,16 @@ repositories {
}

dependencies {
val minestom_version = findProperty("minestom_version")
val jnoise_version = findProperty("jnoise_version")
val polar_version = findProperty("polar_version")
val minimessage_version = findProperty("minimessage_version")
val jackson_version = findProperty("jackson_version")
val minestom_version = findProperty("minestom_version")
val minestom_extensions_version = findProperty("minestom_extensions_version")
val jnoise_version = findProperty("jnoise_version")
val polar_version = findProperty("polar_version")
val minimessage_version = findProperty("minimessage_version")
val jackson_version = findProperty("jackson_version")

// Important
implementation("net.minestom", "minestom-snapshots", "$minestom_version")
implementation("dev.hollowcube", "minestom-ce-extensions", "$minestom_extensions_version")
implementation("de.articdive", "jnoise-pipeline", "$jnoise_version")

// World formats
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ description = A launcher made for Minestom

# libraries versions
minestom_version = b3aa996e1d
minestom_extensions_version = 1.2.0
jnoise_version = 4.1.0-SNAPSHOT
polar_version = 1.9.5
minimessage_version = 4.14.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
import com.thecrownstudios.minestomlauncher.util.FileUtil;
import com.thecrownstudios.minestomlauncher.util.InstanceGenUtil;
import com.thecrownstudios.minestomlauncher.util.ObjectTriple;
import net.hollowcube.minestom.extensions.ExtensionBootstrap;
import net.kyori.adventure.text.format.NamedTextColor;
import net.kyori.adventure.text.logger.slf4j.ComponentLogger;
import net.minestom.server.MinecraftServer;
import net.minestom.server.command.CommandManager;
import net.minestom.server.coordinate.Pos;
import net.minestom.server.entity.Player;
import net.minestom.server.event.player.PlayerLoginEvent;
import net.minestom.server.event.player.AsyncPlayerConfigurationEvent;
import net.minestom.server.extras.MojangAuth;
import net.minestom.server.extras.bungee.BungeeCordProxy;
import net.minestom.server.extras.lan.OpenToLAN;
import net.minestom.server.extras.optifine.OptifineSupport;
import net.minestom.server.extras.velocity.VelocityProxy;
import net.minestom.server.instance.InstanceContainer;
import net.minestom.server.instance.InstanceManager;
Expand Down Expand Up @@ -63,15 +63,20 @@ private void start(long startMillis, @NotNull FileResult result, @NotNull Minest
System.setProperty("minestom.chunk-view-distance", String.valueOf(serverData.chunkViewDistance()));
System.setProperty("minestom.entity-view-distance", String.valueOf(serverData.entityViewDistance()));

MinecraftServer minecraftServer = MinecraftServer.init();
// Without Extensions
// MinecraftServer minecraftServer = MinecraftServer.init();

// With Extensions
ExtensionBootstrap minecraftServer = ExtensionBootstrap.init();

if (networkData.openToLan()) {
OpenToLAN.open();
}

if (serverData.optifineSupport()) {
OptifineSupport.enable();
}
// Optifine is dead, going to remove it
//if (serverData.optifineSupport()) {
// OptifineSupport.enable();
//}

if (proxyData.enabled()) {
String proxyType = proxyData.type();
Expand All @@ -97,7 +102,7 @@ private void start(long startMillis, @NotNull FileResult result, @NotNull Minest
InstanceGenUtil.loadInstance(instanceTypeName, instanceContainer);
instanceManager.registerInstance(instanceContainer);

MinecraftServer.getGlobalEventHandler().addListener(PlayerLoginEvent.class, event -> {
MinecraftServer.getGlobalEventHandler().addListener(AsyncPlayerConfigurationEvent.class, event -> {
Player player = event.getPlayer();

event.setSpawningInstance(instanceContainer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.thecrownstudios.minestomlauncher.MinestomData;
import com.thecrownstudios.minestomlauncher.MinestomLauncher;
import net.hollowcube.minestom.extensions.ExtensionBootstrap;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.TextComponent;
import net.kyori.adventure.text.format.NamedTextColor;
Expand Down Expand Up @@ -140,7 +141,8 @@ private MessageUtil() {}
textBuilder
.append(ARROW_COMPONENT)
.append(text("extensions: ", NamedTextColor.GRAY))
.append(text(MinecraftServer.getExtensionManager().getExtensions().size(), NamedTextColor.WHITE))
//.append(text(MinecraftServer.getExtensionManager().getExtensions().size(), NamedTextColor.WHITE))
.append(text(ExtensionBootstrap.getExtensionManager().getExtensions().size(), NamedTextColor.WHITE))
.append(text(", ", NamedTextColor.GRAY))
.append(text("instances: ", NamedTextColor.GRAY))
.append(text(MinecraftServer.getInstanceManager().getInstances().size(), NamedTextColor.WHITE))
Expand Down

0 comments on commit d762e6c

Please sign in to comment.