mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-16 05:02:19 +01:00
hollow-cube/gradle-rework (#8)
* in order to make an omelet, you have to break a few eggs. aka absolutely decimate the gradle project * far more sane gradle, no publishing yet tho * attempt maven deploy * fix publish url and use snapshot repo * fix secret names * release, and properly set version * attempt to set group correctly * more gradle fixups
This commit is contained in:
parent
6524476a81
commit
381d89497a
@ -1,16 +1,12 @@
|
||||
name: Build and test Minestom
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up JDK 17
|
31
.github/workflows/snapshot-deploy.yaml
vendored
Normal file
31
.github/workflows/snapshot-deploy.yaml
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
name: Gradle Publish to Maven Central
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
|
||||
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
|
||||
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
|
||||
GPG_PASSPHRASE: ${{ secrets.GPG_PASSWORD }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
java-version: '17'
|
||||
distribution: 'temurin'
|
||||
- name: Set outputs
|
||||
id: vars
|
||||
run: |
|
||||
echo "short_commit_hash=${GITHUB_SHA::10}" >> $GITHUB_OUTPUT
|
||||
- name: Publish to Sonatype
|
||||
env:
|
||||
SHORT_COMMIT_HASH: ${{ steps.vars.outputs.short_commit_hash }}
|
||||
run: |
|
||||
./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
|
||||
echo "Version: ${SHORT_COMMIT_HASH}" >> $GITHUB_STEP_SUMMARY
|
4
.github/workflows/trigger-jitpack-build.yml
vendored
4
.github/workflows/trigger-jitpack-build.yml
vendored
@ -1,7 +1,7 @@
|
||||
name: Trigger Jitpack Build
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
branches: [ main ]
|
||||
|
||||
workflow_dispatch:
|
||||
jobs:
|
||||
@ -9,4 +9,4 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Trigger Jitpack Build
|
||||
run: curl "https://jitpack.io/com/github/hollow-cube/Minestom/${GITHUB_SHA:0:10}/build.log"
|
||||
run: curl "https://jitpack.io/com/github/hollow-cube/minestom-ce/${GITHUB_SHA:0:10}/build.log"
|
||||
|
@ -1,16 +0,0 @@
|
||||
plugins {
|
||||
`kotlin-dsl`
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
val indraVersion = "2.0.6"
|
||||
implementation("org.jetbrains.kotlin", "kotlin-gradle-plugin", "1.6.10")
|
||||
implementation("net.kyori", "indra-common", indraVersion)
|
||||
implementation("net.kyori", "indra-publishing-sonatype", indraVersion)
|
||||
implementation("org.graalvm.buildtools", "native-gradle-plugin", "0.9.9")
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
plugins {
|
||||
java
|
||||
}
|
||||
|
||||
// Always exclude checker-qual. This is the single most annoying thing that always reappears.
|
||||
configurations.all {
|
||||
// We only use Jetbrains Annotations
|
||||
exclude("org.checkerframework", "checker-qual")
|
||||
}
|
||||
|
||||
java {
|
||||
toolchain {
|
||||
languageVersion.set(JavaLanguageVersion.of(17))
|
||||
}
|
||||
}
|
||||
|
||||
tasks {
|
||||
withType<JavaCompile> {
|
||||
// We are fully aware, that we should be suppressing these instead of ignoring them here, but man keep my terminal clean.
|
||||
options.compilerArgs.addAll(listOf("-Xlint:none", "-Xlint:-deprecation", "-Xlint:-unchecked"))
|
||||
}
|
||||
withType<Test> {
|
||||
useJUnitPlatform()
|
||||
// Viewable packets make tracking harder. Could be re-enabled later.
|
||||
jvmArgs("-Dminestom.viewable-packet=false")
|
||||
jvmArgs("-Dminestom.inside-test=true")
|
||||
}
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
plugins {
|
||||
id("minestom.common-conventions")
|
||||
id("org.graalvm.buildtools.native")
|
||||
}
|
||||
|
||||
graalvmNative {
|
||||
binaries {
|
||||
named("main") {
|
||||
buildArgs.add("--allow-incomplete-classpath")
|
||||
// One day toolchains will support getting this automagically, but that day is not today.
|
||||
toolchainDetection.set(false)
|
||||
}
|
||||
}
|
||||
}
|
@ -1,32 +0,0 @@
|
||||
plugins {
|
||||
id("net.kyori.indra")
|
||||
id("net.kyori.indra.publishing")
|
||||
id("net.kyori.indra.publishing.sonatype")
|
||||
}
|
||||
|
||||
indra {
|
||||
javaVersions {
|
||||
target(17)
|
||||
testWith(17)
|
||||
}
|
||||
|
||||
github("Minestom", "Minestom") {
|
||||
ci(true)
|
||||
}
|
||||
apache2License()
|
||||
|
||||
configurePublications {
|
||||
pom {
|
||||
developers {
|
||||
developer {
|
||||
id.set("TheMode")
|
||||
name.set("TheMode")
|
||||
}
|
||||
developer {
|
||||
id.set("jglrxavpok")
|
||||
name.set("jglrxavpok")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
191
build.gradle.kts
191
build.gradle.kts
@ -1,27 +1,79 @@
|
||||
plugins {
|
||||
`java-library`
|
||||
id("minestom.publishing-conventions")
|
||||
id("minestom.native-conventions")
|
||||
alias(libs.plugins.blossom)
|
||||
|
||||
`maven-publish`
|
||||
signing
|
||||
alias(libs.plugins.nexuspublish)
|
||||
}
|
||||
|
||||
version = System.getenv("SHORT_COMMIT_HASH") ?: "dev"
|
||||
|
||||
allprojects {
|
||||
group = "net.minestom.server"
|
||||
version = "1.0"
|
||||
apply(plugin = "java")
|
||||
|
||||
group = "net.minestom"
|
||||
version = rootProject.version
|
||||
description = "Lightweight and multi-threaded Minecraft server implementation"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven(url = "https://jitpack.io")
|
||||
}
|
||||
|
||||
configurations.all {
|
||||
// We only use Jetbrains Annotations
|
||||
exclude("org.checkerframework", "checker-qual")
|
||||
}
|
||||
|
||||
java {
|
||||
withSourcesJar()
|
||||
withJavadocJar()
|
||||
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
}
|
||||
|
||||
tasks.withType<Zip> {
|
||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||
}
|
||||
|
||||
tasks.withType<Test> {
|
||||
useJUnitPlatform()
|
||||
|
||||
// Viewable packets make tracking harder. Could be re-enabled later.
|
||||
jvmArgs("-Dminestom.viewable-packet=false")
|
||||
jvmArgs("-Dminestom.inside-test=true")
|
||||
}
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
java {
|
||||
srcDir(file("src/autogenerated/java"))
|
||||
}
|
||||
java.srcDir(file("src/main/java"))
|
||||
java.srcDir(file("src/autogenerated/java"))
|
||||
}
|
||||
}
|
||||
|
||||
java {
|
||||
withJavadocJar()
|
||||
withSourcesJar()
|
||||
dependencies {
|
||||
// Core dependencies
|
||||
api(libs.slf4j)
|
||||
api(libs.jetbrainsAnnotations)
|
||||
api(libs.bundles.adventure)
|
||||
api(libs.hydrazine)
|
||||
api(libs.bundles.kotlin)
|
||||
api(libs.bundles.hephaistos)
|
||||
implementation(libs.minestomData)
|
||||
|
||||
// Performance/data structures
|
||||
implementation(libs.caffeine)
|
||||
api(libs.fastutil)
|
||||
implementation(libs.bundles.flare)
|
||||
api(libs.gson)
|
||||
implementation(libs.jcTools)
|
||||
|
||||
// Testing
|
||||
testImplementation(libs.bundles.junit)
|
||||
testImplementation(project(":testing"))
|
||||
}
|
||||
|
||||
tasks {
|
||||
@ -37,55 +89,92 @@ tasks {
|
||||
links("https://jd.adventure.kyori.net/api/${libs.versions.adventure.get()}/")
|
||||
}
|
||||
}
|
||||
withType<Zip> {
|
||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||
}
|
||||
|
||||
blossom {
|
||||
val git = "src/main/java/net/minestom/server/Git.java"
|
||||
val gitFile = "src/main/java/net/minestom/server/Git.java"
|
||||
|
||||
val gitCommit = System.getenv("GIT_COMMIT")
|
||||
val gitBranch = System.getenv("GIT_BRANCH")
|
||||
val group = System.getenv("GROUP")
|
||||
val artifact = System.getenv("ARTIFACT")
|
||||
|
||||
replaceToken("\"&COMMIT\"", if (gitCommit == null) "null" else "\"${gitCommit}\"", git)
|
||||
replaceToken("\"&BRANCH\"", if (gitBranch == null) "null" else "\"${gitBranch}\"", git)
|
||||
replaceToken("\"&GROUP\"", if (group == null) "null" else "\"${group}\"", git)
|
||||
replaceToken("\"&ARTIFACT\"", if (artifact == null) "null" else "\"${artifact}\"", git)
|
||||
replaceToken("\"&COMMIT\"", if (gitCommit == null) "null" else "\"${gitCommit}\"", gitFile)
|
||||
replaceToken("\"&BRANCH\"", if (gitBranch == null) "null" else "\"${gitBranch}\"", gitFile)
|
||||
replaceToken("\"&GROUP\"", if (group == null) "null" else "\"${group}\"", gitFile)
|
||||
replaceToken("\"&ARTIFACT\"", if (artifact == null) "null" else "\"${artifact}\"", gitFile)
|
||||
}
|
||||
|
||||
nexusPublishing{
|
||||
useStaging.set(true)
|
||||
this.packageGroup.set("dev.hollowcube")
|
||||
|
||||
repositories.sonatype {
|
||||
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
|
||||
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
|
||||
|
||||
if (System.getenv("SONATYPE_USERNAME") != null) {
|
||||
username.set(System.getenv("SONATYPE_USERNAME"))
|
||||
password.set(System.getenv("SONATYPE_PASSWORD"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
publishing.publications.create<MavenPublication>("maven") {
|
||||
groupId = "dev.hollowcube"
|
||||
artifactId = "minestom-ce"
|
||||
version = project.version.toString()
|
||||
|
||||
from(project.components["java"])
|
||||
|
||||
pom {
|
||||
name.set("minestom-ce")
|
||||
description.set("Lightweight and multi-threaded 1.19.3 Minecraft server")
|
||||
url.set("https://github.com/hollow-cube/minestom-ce")
|
||||
|
||||
licenses {
|
||||
license {
|
||||
name.set("Apache 2.0")
|
||||
url.set("https://github.com/hollow-cube/minestom-ce/blob/main/LICENSE")
|
||||
}
|
||||
}
|
||||
|
||||
developers {
|
||||
developer {
|
||||
id.set("TheMode")
|
||||
}
|
||||
developer {
|
||||
id.set("mworzala")
|
||||
name.set("Matt Worzala")
|
||||
email.set("matt@hollowcube.dev")
|
||||
}
|
||||
}
|
||||
|
||||
issueManagement {
|
||||
system.set("GitHub")
|
||||
url.set("https://github.com/hollow-cube/minestom-ce/issues")
|
||||
}
|
||||
|
||||
scm {
|
||||
connection.set("scm:git:git://github.com/hollow-cube/minestom-ce.git")
|
||||
developerConnection.set("scm:git:git@github.com:hollow-cube/minestom-ce.git")
|
||||
url.set("https://github.com/hollow-cube/minestom-ce")
|
||||
tag.set("HEAD")
|
||||
}
|
||||
|
||||
ciManagement {
|
||||
system.set("Github Actions")
|
||||
url.set("https://github.com/hollow-cube/minestom-ce/actions")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
signing {
|
||||
isRequired = System.getenv("CI") != null
|
||||
|
||||
val privateKey = System.getenv("GPG_PRIVATE_KEY")
|
||||
val keyPassphrase = System.getenv()["GPG_PASSPHRASE"]
|
||||
useInMemoryPgpKeys(privateKey, keyPassphrase)
|
||||
|
||||
sign(publishing.publications)
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// Testing Framework
|
||||
testImplementation(project(mapOf("path" to ":testing")))
|
||||
// Only here to ensure J9 module support for extensions and our classloaders
|
||||
testCompileOnly(libs.mockito.core)
|
||||
|
||||
// Performance improving libraries
|
||||
implementation(libs.caffeine)
|
||||
api(libs.fastutil)
|
||||
implementation(libs.bundles.flare)
|
||||
|
||||
// Libraries
|
||||
api(libs.gson)
|
||||
implementation(libs.jcTools)
|
||||
// Path finding
|
||||
api(libs.hydrazine)
|
||||
implementation("org.slf4j:slf4j-api:2.0.6")
|
||||
|
||||
// Adventure, for user-interface
|
||||
api(libs.bundles.adventure)
|
||||
|
||||
// Kotlin Libraries
|
||||
api(libs.bundles.kotlin)
|
||||
|
||||
// Minestom Data (From MinestomDataGenerator)
|
||||
implementation(libs.minestomData)
|
||||
|
||||
// NBT parsing/manipulation/saving
|
||||
api("io.github.jglrxavpok.hephaistos:common:${libs.versions.hephaistos.get()}")
|
||||
api("io.github.jglrxavpok.hephaistos:gson:${libs.versions.hephaistos.get()}")
|
||||
}
|
||||
|
||||
|
@ -1,24 +1,28 @@
|
||||
plugins {
|
||||
application
|
||||
id("minestom.common-conventions")
|
||||
}
|
||||
|
||||
application {
|
||||
mainClass.set("net.minestom.codegen.Generators")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(libs.gson)
|
||||
implementation(libs.jetbrainsAnnotations)
|
||||
implementation(libs.javaPoet)
|
||||
// Contains the json files
|
||||
// Provides the input JSON to generate from
|
||||
implementation(libs.minestomData)
|
||||
|
||||
implementation("org.slf4j:slf4j-api:2.0.6")
|
||||
// Common
|
||||
implementation(libs.jetbrainsAnnotations)
|
||||
implementation(libs.slf4j)
|
||||
runtimeOnly(libs.bundles.logback)
|
||||
|
||||
// Parsing and generation
|
||||
implementation(libs.gson)
|
||||
implementation(libs.javaPoet)
|
||||
}
|
||||
|
||||
tasks {
|
||||
|
||||
application {
|
||||
mainClass.set("net.minestom.codegen.Generators")
|
||||
}
|
||||
|
||||
getByName<JavaExec>("run") {
|
||||
args = listOf(project.rootProject.projectDir.resolve("src").resolve("autogenerated").resolve("java").absolutePath)
|
||||
args = listOf(rootProject.projectDir.resolve("src/autogenerated/java").absolutePath)
|
||||
}
|
||||
}
|
||||
|
@ -2,25 +2,21 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||
|
||||
plugins {
|
||||
application
|
||||
id("minestom.common-conventions")
|
||||
id("minestom.native-conventions")
|
||||
id("com.github.johnrengelman.shadow") version ("7.1.1")
|
||||
}
|
||||
|
||||
application {
|
||||
mainClass.set("net.minestom.demo.Main")
|
||||
// This is included because Shadow is buggy. Wait for https://github.com/johnrengelman/shadow/issues/613 to befixed.
|
||||
@Suppress("DEPRECATION")
|
||||
mainClassName = "net.minestom.demo.Main"
|
||||
alias(libs.plugins.shadow)
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(rootProject)
|
||||
implementation(libs.jNoise)
|
||||
implementation("ch.qos.logback:logback-core:1.4.5")
|
||||
implementation("ch.qos.logback:logback-classic:1.4.5")
|
||||
|
||||
runtimeOnly(libs.bundles.logback)
|
||||
}
|
||||
|
||||
tasks.withType<ShadowJar> {
|
||||
archiveFileName.set("minestom-demo.jar")
|
||||
tasks {
|
||||
application {
|
||||
mainClass.set("net.minestom.demo.Main")
|
||||
}
|
||||
|
||||
withType<ShadowJar> {
|
||||
archiveFileName.set("minestom-demo.jar")
|
||||
}
|
||||
}
|
@ -1,45 +0,0 @@
|
||||
package net.minestom.demo;
|
||||
|
||||
import net.minestom.demo.commands.GamemodeCommand;
|
||||
import net.minestom.demo.commands.SaveCommand;
|
||||
import net.minestom.server.MinecraftServer;
|
||||
import net.minestom.server.coordinate.Pos;
|
||||
import net.minestom.server.entity.Player;
|
||||
import net.minestom.server.event.GlobalEventHandler;
|
||||
import net.minestom.server.event.player.PlayerLoginEvent;
|
||||
import net.minestom.server.instance.AnvilLoader;
|
||||
import net.minestom.server.instance.InstanceContainer;
|
||||
import net.minestom.server.instance.InstanceManager;
|
||||
import net.minestom.server.instance.block.Block;
|
||||
import net.minestom.server.utils.NamespaceID;
|
||||
import net.minestom.server.world.biomes.Biome;
|
||||
import net.minestom.server.world.biomes.BiomeManager;
|
||||
|
||||
public class MainDemo {
|
||||
|
||||
public static void main(String[] args) {
|
||||
// Initialization
|
||||
MinecraftServer minecraftServer = MinecraftServer.init();
|
||||
|
||||
MinecraftServer.getCommandManager().register(new GamemodeCommand());
|
||||
MinecraftServer.getCommandManager().register(new SaveCommand());
|
||||
|
||||
InstanceManager instanceManager = MinecraftServer.getInstanceManager();
|
||||
// Create the instance
|
||||
InstanceContainer instanceContainer = instanceManager.createInstanceContainer();
|
||||
// Set the ChunkGenerator
|
||||
instanceContainer.setGenerator(unit -> unit.modifier().fillHeight(0, 40, Block.STONE));
|
||||
|
||||
// Add an event callback to specify the spawning instance (and the spawn position)
|
||||
GlobalEventHandler globalEventHandler = MinecraftServer.getGlobalEventHandler();
|
||||
globalEventHandler.addListener(PlayerLoginEvent.class, event -> {
|
||||
final Player player = event.getPlayer();
|
||||
player.setPermissionLevel(2);
|
||||
event.setSpawningInstance(instanceContainer);
|
||||
player.setRespawnPoint(new Pos(0, 42, 0));
|
||||
});
|
||||
|
||||
// Start the server on port 25565
|
||||
minecraftServer.start("0.0.0.0", 25565);
|
||||
}
|
||||
}
|
@ -1,142 +0,0 @@
|
||||
package net.minestom.demo.generator;
|
||||
|
||||
import de.articdive.jnoise.generators.noise_parameters.interpolation.Interpolation;
|
||||
import de.articdive.jnoise.generators.noisegen.opensimplex.FastSimplexNoiseGenerator;
|
||||
import de.articdive.jnoise.generators.noisegen.perlin.PerlinNoiseGenerator;
|
||||
import de.articdive.jnoise.pipeline.JNoise;
|
||||
import net.minestom.server.coordinate.Point;
|
||||
import net.minestom.server.coordinate.Vec;
|
||||
import net.minestom.server.instance.Chunk;
|
||||
import net.minestom.server.instance.block.Block;
|
||||
import net.minestom.server.instance.generator.GenerationUnit;
|
||||
import net.minestom.server.instance.generator.Generator;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class NoiseTestGenerator implements Generator {
|
||||
|
||||
private final JNoise treeNoise = JNoise.newBuilder()
|
||||
.fastSimplex(FastSimplexNoiseGenerator.newBuilder().setSeed(123).build())
|
||||
.scale(999)
|
||||
.build();
|
||||
|
||||
private final JNoise jNoise = JNoise.newBuilder()
|
||||
.perlin(PerlinNoiseGenerator.newBuilder().setSeed(123).setInterpolation(Interpolation.LINEAR).build())
|
||||
.scale(0.4).build();
|
||||
|
||||
public int getHeight(int x, int z) {
|
||||
double preHeight = jNoise.evaluateNoise(x / 16.0, z / 16.0);
|
||||
return (int) ((preHeight > 0 ? preHeight * 6 : preHeight * 4) + 64);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate(@NotNull GenerationUnit unit) {
|
||||
Point start = unit.absoluteStart();
|
||||
for (int x = 0; x < Chunk.CHUNK_SIZE_X; x++) {
|
||||
for (int z = 0; z < Chunk.CHUNK_SIZE_Z; z++) {
|
||||
Point pos;
|
||||
{
|
||||
int absX = start.blockX() + x;
|
||||
int absZ = start.blockZ() + z;
|
||||
final int height = getHeight(absX, absZ);
|
||||
pos = new Vec(absX, height, absZ);
|
||||
}
|
||||
Point posp1 = pos.add(1, 0, 1);
|
||||
|
||||
// Water
|
||||
if (pos.y() < 61) {
|
||||
unit.modifier().fill(pos, posp1.withY(61), Block.WATER);
|
||||
unit.modifier().fill(pos.withY(0), posp1, Block.AIR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Regular terrain
|
||||
unit.modifier().fill(pos.withY(0), posp1, Block.STONE);
|
||||
unit.modifier().fill(pos.withY(pos.y() - 7), posp1, Block.DIRT);
|
||||
unit.modifier().fill(pos.withY(pos.y() - 1), posp1, Block.GRASS_BLOCK);
|
||||
unit.modifier().fill(pos.withY(0), posp1.withY(1), Block.BEDROCK);
|
||||
|
||||
if (treeNoise.evaluateNoise(pos.x(), pos.z()) > 0.8) {
|
||||
TreePopulator.populate(pos, unit);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static class TreePopulator {
|
||||
private static void populate(Point origin, GenerationUnit unit) {
|
||||
unit.fork(setter -> {
|
||||
setter.setBlock(origin.add(0, -1, 0), Block.DIRT);
|
||||
setter.setBlock(origin.add(0, -1, 0), Block.DIRT);
|
||||
setter.setBlock(origin.add(0, 0, 0), Block.OAK_LOG);
|
||||
setter.setBlock(origin.add(0, 1, 0), Block.OAK_LOG);
|
||||
setter.setBlock(origin.add(0, 2, 0), Block.OAK_LOG);
|
||||
setter.setBlock(origin.add(0, 3, 0), Block.OAK_LOG);
|
||||
setter.setBlock(origin.add(1, 1, 0), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(2, 1, 0), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(-1, 1, 0), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(-2, 1, 0), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(1, 1, 1), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(2, 1, 1), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(0, 1, 1), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(-1, 1, 1), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(-2, 1, 1), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(1, 1, 2), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(2, 1, 2), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(0, 1, 2), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(-1, 1, 2), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(-2, 1, 2), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(1, 1, -1), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(2, 1, -1), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(0, 1, -1), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(-1, 1, -1), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(-2, 1, -1), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(1, 1, -2), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(2, 1, -2), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(0, 1, -2), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(-1, 1, -2), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(-2, 1, -2), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(1, 2, 0), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(2, 2, 0), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(-1, 2, 0), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(-2, 2, 0), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(1, 2, 1), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(2, 2, 1), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(0, 2, 1), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(-1, 2, 1), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(-2, 2, 1), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(1, 2, 2), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(2, 2, 2), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(0, 2, 2), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(-1, 2, 2), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(-2, 2, 2), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(1, 2, -1), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(2, 2, -1), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(0, 2, -1), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(-1, 2, -1), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(-2, 2, -1), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(1, 2, -2), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(2, 2, -2), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(0, 2, -2), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(-1, 2, -2), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(-2, 2, -2), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(1, 3, 0), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(-1, 3, 0), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(1, 3, 1), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(0, 3, 1), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(-1, 3, 1), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(1, 3, -1), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(0, 3, -1), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(-1, 3, -1), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(1, 4, 0), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(0, 4, 0), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(-1, 4, 0), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(0, 4, 1), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(0, 4, -1), Block.OAK_LEAVES);
|
||||
setter.setBlock(origin.add(-1, 4, -1), Block.OAK_LEAVES);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -3,39 +3,37 @@ metadata.format.version = "1.1"
|
||||
[versions]
|
||||
|
||||
# Important dependencies
|
||||
minestomData = "53e0da5be1"
|
||||
adventure = "4.12.0"
|
||||
kotlin = "1.7.22"
|
||||
hydrazine = "1.7.2"
|
||||
minestomData = "53e0da5be1"
|
||||
hephaistos = "2.5.3"
|
||||
jetbrainsAnnotations = "23.0.0"
|
||||
slf4j = "2.0.7"
|
||||
|
||||
# Performance / Data Structures
|
||||
caffeine = "3.1.2"
|
||||
fastutil = "8.5.9"
|
||||
caffeine = "3.1.6"
|
||||
fastutil = "8.5.12"
|
||||
flare = "2.0.1"
|
||||
gson = "2.9.1"
|
||||
gson = "2.10.1"
|
||||
jcTools = "4.0.1"
|
||||
|
||||
# Test
|
||||
junit-jupiter = "5.8.2"
|
||||
junit-platform = "1.8.2"
|
||||
mockito = "4.2.0"
|
||||
# Quality
|
||||
junit-jupiter = "5.9.3"
|
||||
junit-platform = "1.9.3"
|
||||
jmh = "1.36"
|
||||
jcstress = "0.16"
|
||||
|
||||
# Code Generation
|
||||
javaPoet = "1.13.0"
|
||||
|
||||
# Demo
|
||||
jNoise = "b93008e35e"
|
||||
|
||||
# JMH
|
||||
jmh = "1.35"
|
||||
|
||||
# JCStress
|
||||
jcstress = "0.8"
|
||||
# Log impl (for demo & codegen)
|
||||
logback = "1.4.5"
|
||||
|
||||
# Gradle plugins
|
||||
blossom = "1.3.0"
|
||||
shadow = "8.1.1"
|
||||
nexuspublish = "1.3.0"
|
||||
|
||||
[libraries]
|
||||
|
||||
@ -55,6 +53,9 @@ kotlin-stdlib-jdk8 = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib-jdk
|
||||
hydrazine = { group = "com.github.MadMartian", name = "hydrazine-path-finding", version.ref = "hydrazine" }
|
||||
minestomData = { group = "com.github.Minestom", name = "MinestomDataGenerator", version.ref = "minestomData" }
|
||||
jetbrainsAnnotations = { group = "org.jetbrains", name = "annotations", version.ref = "jetbrainsAnnotations" }
|
||||
hephaistos-common = { group = "io.github.jglrxavpok.hephaistos", name = "common", version.ref = "hephaistos" }
|
||||
hephaistos-gson = { group = "io.github.jglrxavpok.hephaistos", name = "gson", version.ref = "hephaistos" }
|
||||
slf4j = { group = "org.slf4j", name = "slf4j-api", version.ref = "slf4j"}
|
||||
|
||||
# Performance / Data Structures
|
||||
caffeine = { group = "com.github.ben-manes.caffeine", name = "caffeine", version.ref = "caffeine" }
|
||||
@ -64,33 +65,34 @@ flare-fastutil = { group = "space.vectrix.flare", name = "flare-fastutil", versi
|
||||
gson = { group = "com.google.code.gson", name = "gson", version.ref = "gson" }
|
||||
jcTools = { group = "org.jctools", name = "jctools-core", version.ref = "jcTools" }
|
||||
|
||||
# Test
|
||||
# Code quality
|
||||
junit-api = { group = "org.junit.jupiter", name = "junit-jupiter-api", version.ref = "junit-jupiter" }
|
||||
junit-engine = { group = "org.junit.jupiter", name = "junit-jupiter-engine", version.ref = "junit-jupiter" }
|
||||
junit-params = { group = "org.junit.jupiter", name = "junit-jupiter-params", version.ref = "junit-jupiter" }
|
||||
junit-suite-api = { group = "org.junit.platform", name = "junit-platform-suite-api", version.ref = "junit-platform" }
|
||||
junit-suite-engine = { group = "org.junit.platform", name = "junit-platform-suite-engine", version.ref = "junit-platform" }
|
||||
mockito-core = { group = "org.mockito", name = "mockito-core", version.ref = "mockito" }
|
||||
jmh-core = { group = "org.openjdk.jmh", name = "jmh-core", version.ref = "jmh" }
|
||||
jmh-annotationprocessor = { group = "org.openjdk.jmh", name = "jmh-generator-annprocess", version.ref = "jmh" }
|
||||
jcstress-core = { group = "org.openjdk.jcstress", name = "jcstress-core", version.ref = "jcstress" }
|
||||
|
||||
# Code Generation
|
||||
javaPoet = { group = "com.squareup", name = "javapoet", version.ref = "javaPoet" }
|
||||
|
||||
# Demo
|
||||
jNoise = { group = "com.github.Articdive.JNoise", name = "jnoise-pipeline", version.ref = "jNoise" }
|
||||
|
||||
# JMH
|
||||
jmh-core = { group = "org.openjdk.jmh", name = "jmh-core", version.ref = "jmh" }
|
||||
jmh-annotationprocessor = { group = "org.openjdk.jmh", name = "jmh-generator-annprocess", version.ref = "jmh" }
|
||||
|
||||
# JCStress
|
||||
jcstress-core = { group = "org.openjdk.jcstress", name = "jcstress-core", version.ref = "jcstress" }
|
||||
# Log impl (for demo & codegen)
|
||||
logback-core = { group = "ch.qos.logback", name = "logback-core", version.ref = "logback" }
|
||||
logback-classic = { group = "ch.qos.logback", name = "logback-classic", version.ref = "logback" }
|
||||
|
||||
[bundles]
|
||||
|
||||
kotlin = ["kotlin-stdlib-jdk8", "kotlin-reflect"]
|
||||
flare = ["flare", "flare-fastutil"]
|
||||
adventure = ["adventure-api", "adventure-serializer-gson", "adventure-serializer-legacy", "adventure-serializer-plain", "adventure-text-logger-slf4j"]
|
||||
junit = ["junit-api", "junit-engine", "junit-params", "junit-suite-api", "junit-suite-engine"]
|
||||
hephaistos = ["hephaistos-common", "hephaistos-gson"]
|
||||
logback = ["logback-core", "logback-classic"]
|
||||
|
||||
[plugins]
|
||||
|
||||
blossom = { id = "net.kyori.blossom", version.ref = "blossom" }
|
||||
shadow = { id = "com.github.johnrengelman.shadow", version.ref = "shadow" }
|
||||
nexuspublish = { id = "io.github.gradle-nexus.publish-plugin", version.ref = "nexuspublish" }
|
||||
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
@ -1,24 +1,8 @@
|
||||
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
|
||||
enableFeaturePreview("VERSION_CATALOGS")
|
||||
rootProject.name = "minestom-ce"
|
||||
|
||||
dependencyResolutionManagement {
|
||||
repositories {
|
||||
maven("https://jitpack.io")
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
pluginManagement {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
includeBuild("build-logic")
|
||||
}
|
||||
|
||||
rootProject.name = "Minestom"
|
||||
include("code-generators")
|
||||
include("jmh-benchmarks")
|
||||
include("jcstress-tests")
|
||||
include("demo")
|
||||
include("testing")
|
||||
include("code-generators")
|
||||
//include("jmh-benchmarks")
|
||||
//include("jcstress-tests")
|
||||
|
||||
include("demo")
|
||||
|
@ -1,32 +1,14 @@
|
||||
plugins {
|
||||
id("java-library")
|
||||
`maven-publish`
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
create<MavenPublication>("maven") {
|
||||
groupId = "net.minestom.testing"
|
||||
artifactId = "testing"
|
||||
version = "1.0"
|
||||
|
||||
from(components["java"])
|
||||
}
|
||||
}
|
||||
`java-library`
|
||||
// `maven-publish`
|
||||
}
|
||||
|
||||
group = "net.minestom.testing"
|
||||
version = "1.0"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven(url = "https://jitpack.io")
|
||||
}
|
||||
// version declared by root project
|
||||
|
||||
dependencies {
|
||||
// Minestom API
|
||||
api(project(mapOf("path" to ":")))
|
||||
// Junit Testing Framework
|
||||
api(rootProject)
|
||||
|
||||
api(libs.junit.api)
|
||||
api(libs.junit.params)
|
||||
api(libs.junit.suite.api)
|
||||
@ -34,6 +16,14 @@ dependencies {
|
||||
runtimeOnly(libs.junit.suite.engine)
|
||||
}
|
||||
|
||||
tasks.getByName<Test>("test") {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
//publishing {
|
||||
// publications {
|
||||
// create<MavenPublication>("maven") {
|
||||
// groupId = "net.minestom.testing"
|
||||
// artifactId = "testing"
|
||||
// version = "1.0"
|
||||
//
|
||||
// from(components["java"])
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
Loading…
Reference in New Issue
Block a user