Skip to content

Commit

Permalink
fix: move minestom example to own module
Browse files Browse the repository at this point in the history
  • Loading branch information
Bloeckchengrafik committed Jan 5, 2025
1 parent aecc003 commit 810d10a
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 24 deletions.
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ afterEvaluate {
configureDistribution()
}
project(":platforms:bukkit:common").configureDistribution()
project(":platforms:minestom:example").configureDistribution()
forSubProjects(":common:addons") {
apply(plugin = "com.gradleup.shadow")

Expand Down
20 changes: 0 additions & 20 deletions platforms/minestom/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,14 @@ plugins {
application
}

val javaMainClass = "com.dfsek.terra.minestom.TerraMinestomExample"

dependencies {
shadedApi(project(":common:implementation:base"))
shadedApi("com.github.ben-manes.caffeine", "caffeine", Versions.Libraries.caffeine)
shadedImplementation("com.google.guava", "guava", Versions.Libraries.Internal.guava)

compileOnly("net.minestom", "minestom-snapshots", Versions.Minestom.minestom)
compileOnly("org.slf4j", "slf4j-simple", Versions.Libraries.slf4j)
}

tasks.withType<Jar> {
entryCompression = ZipEntryCompression.STORED
manifest {
attributes(
"Main-Class" to javaMainClass,
)
}
}

application {
mainClass.set(javaMainClass)
}

tasks.named("jar") {
finalizedBy("installAddonsIntoDefaultJar")
}

tasks.getByName("run").setProperty("workingDir", file("./run"))

addonDir(project.file("./run/terra/addons"), tasks.named("run").get())
28 changes: 28 additions & 0 deletions platforms/minestom/example/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
plugins {
application
}

val javaMainClass = "com.dfsek.terra.minestom.TerraMinestomExample"

dependencies {
shadedApi(project(":platforms:minestom"))

implementation("net.minestom", "minestom-snapshots", Versions.Minestom.minestom)
implementation("org.slf4j", "slf4j-simple", Versions.Libraries.slf4j)
}

tasks.withType<Jar> {
entryCompression = ZipEntryCompression.STORED
manifest {
attributes(
"Main-Class" to javaMainClass,
)
}
}

application {
mainClass.set(javaMainClass)
}

tasks.getByName("run").setProperty("workingDir", file("./run"))
addonDir(project.file("./run/terra/addons"), tasks.named("run").get())
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
package com.dfsek.terra.minestom;

import com.dfsek.terra.minestom.world.TerraMinestomWorld;
import com.dfsek.terra.minestom.world.TerraMinestomWorldBuilder;

import net.kyori.adventure.text.Component;
import net.minestom.server.MinecraftServer;
import net.minestom.server.command.builder.Command;
import net.minestom.server.command.builder.arguments.number.ArgumentInteger;
import net.minestom.server.coordinate.Pos;
import net.minestom.server.entity.GameMode;
import net.minestom.server.event.player.AsyncPlayerConfigurationEvent;
Expand All @@ -19,6 +15,9 @@
import java.time.Duration;
import java.util.concurrent.atomic.AtomicInteger;

import com.dfsek.terra.minestom.world.TerraMinestomWorld;
import com.dfsek.terra.minestom.world.TerraMinestomWorldBuilder;


public class TerraMinestomExample {
private static final Logger logger = LoggerFactory.getLogger(TerraMinestomExample.class);
Expand Down
1 change: 1 addition & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ includeImmediateChildren(file("platforms"), "platform")
includeImmediateChildren(file("platforms/bukkit/nms"), "Bukkit NMS")

include(":platforms:bukkit:common")
include(":platforms:minestom:example")

pluginManagement {
repositories {
Expand Down

0 comments on commit 810d10a

Please sign in to comment.