mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-02 22:06:05 +00:00
fix: move minestom example to own module
This commit is contained in:
@@ -44,6 +44,7 @@ afterEvaluate {
|
|||||||
configureDistribution()
|
configureDistribution()
|
||||||
}
|
}
|
||||||
project(":platforms:bukkit:common").configureDistribution()
|
project(":platforms:bukkit:common").configureDistribution()
|
||||||
|
project(":platforms:minestom:example").configureDistribution()
|
||||||
forSubProjects(":common:addons") {
|
forSubProjects(":common:addons") {
|
||||||
apply(plugin = "com.gradleup.shadow")
|
apply(plugin = "com.gradleup.shadow")
|
||||||
|
|
||||||
|
|||||||
@@ -2,34 +2,14 @@ plugins {
|
|||||||
application
|
application
|
||||||
}
|
}
|
||||||
|
|
||||||
val javaMainClass = "com.dfsek.terra.minestom.TerraMinestomExample"
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
shadedApi(project(":common:implementation:base"))
|
shadedApi(project(":common:implementation:base"))
|
||||||
shadedApi("com.github.ben-manes.caffeine", "caffeine", Versions.Libraries.caffeine)
|
shadedApi("com.github.ben-manes.caffeine", "caffeine", Versions.Libraries.caffeine)
|
||||||
shadedImplementation("com.google.guava", "guava", Versions.Libraries.Internal.guava)
|
shadedImplementation("com.google.guava", "guava", Versions.Libraries.Internal.guava)
|
||||||
|
|
||||||
compileOnly("net.minestom", "minestom-snapshots", Versions.Minestom.minestom)
|
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") {
|
tasks.named("jar") {
|
||||||
finalizedBy("installAddonsIntoDefaultJar")
|
finalizedBy("installAddonsIntoDefaultJar")
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.getByName("run").setProperty("workingDir", file("./run"))
|
|
||||||
|
|
||||||
addonDir(project.file("./run/terra/addons"), tasks.named("run").get())
|
|
||||||
|
|||||||
28
platforms/minestom/example/build.gradle.kts
Normal file
28
platforms/minestom/example/build.gradle.kts
Normal file
@@ -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())
|
||||||
@@ -1,12 +1,8 @@
|
|||||||
package com.dfsek.terra.minestom;
|
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.kyori.adventure.text.Component;
|
||||||
import net.minestom.server.MinecraftServer;
|
import net.minestom.server.MinecraftServer;
|
||||||
import net.minestom.server.command.builder.Command;
|
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.coordinate.Pos;
|
||||||
import net.minestom.server.entity.GameMode;
|
import net.minestom.server.entity.GameMode;
|
||||||
import net.minestom.server.event.player.AsyncPlayerConfigurationEvent;
|
import net.minestom.server.event.player.AsyncPlayerConfigurationEvent;
|
||||||
@@ -19,6 +15,9 @@ import org.slf4j.LoggerFactory;
|
|||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
|
import com.dfsek.terra.minestom.world.TerraMinestomWorld;
|
||||||
|
import com.dfsek.terra.minestom.world.TerraMinestomWorldBuilder;
|
||||||
|
|
||||||
|
|
||||||
public class TerraMinestomExample {
|
public class TerraMinestomExample {
|
||||||
private static final Logger logger = LoggerFactory.getLogger(TerraMinestomExample.class);
|
private static final Logger logger = LoggerFactory.getLogger(TerraMinestomExample.class);
|
||||||
@@ -21,6 +21,7 @@ includeImmediateChildren(file("platforms"), "platform")
|
|||||||
includeImmediateChildren(file("platforms/bukkit/nms"), "Bukkit NMS")
|
includeImmediateChildren(file("platforms/bukkit/nms"), "Bukkit NMS")
|
||||||
|
|
||||||
include(":platforms:bukkit:common")
|
include(":platforms:bukkit:common")
|
||||||
|
include(":platforms:minestom:example")
|
||||||
|
|
||||||
pluginManagement {
|
pluginManagement {
|
||||||
repositories {
|
repositories {
|
||||||
|
|||||||
Reference in New Issue
Block a user