Tidy up buildscript and dependencies, fix spongeworld world-folder being wrong

This commit is contained in:
Lukas Rieger (Blue) 2024-02-07 23:01:31 +01:00
parent 74c68c3428
commit e02a43a521
No known key found for this signature in database
GPG Key ID: 2D09EC5ED2687FF2
14 changed files with 24 additions and 4 deletions

View File

@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
networkTimeout=10000 networkTimeout=10000
validateDistributionUrl=true validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME

View File

@ -88,6 +88,7 @@ tasks.shadowJar {
relocate ("io.leangen.geantyref", "de.bluecolored.shadow.geantyref") relocate ("io.leangen.geantyref", "de.bluecolored.shadow.geantyref")
relocate ("io.airlift", "de.bluecolored.shadow.airlift") relocate ("io.airlift", "de.bluecolored.shadow.airlift")
relocate ("org.apache.commons", "de.bluecolored.shadow.apache.commons") relocate ("org.apache.commons", "de.bluecolored.shadow.apache.commons")
relocate ("net.jpountz", "de.bluecolored.shadow.jpountz")
} }
tasks.register("release") { tasks.register("release") {

View File

@ -115,6 +115,7 @@ tasks.shadowJar {
relocate ("org.codehaus", "de.bluecolored.shadow.codehaus") relocate ("org.codehaus", "de.bluecolored.shadow.codehaus")
relocate ("io.leangen.geantyref", "de.bluecolored.shadow.geantyref") relocate ("io.leangen.geantyref", "de.bluecolored.shadow.geantyref")
relocate ("io.airlift", "de.bluecolored.shadow.airlift") relocate ("io.airlift", "de.bluecolored.shadow.airlift")
relocate ("net.jpountz", "de.bluecolored.shadow.jpountz")
relocate ("com.google.errorprone", "de.bluecolored.shadow.google.errorprone") relocate ("com.google.errorprone", "de.bluecolored.shadow.google.errorprone")
relocate ("com.google.inject", "de.bluecolored.shadow.google.inject") relocate ("com.google.inject", "de.bluecolored.shadow.google.inject")

View File

@ -115,6 +115,7 @@ tasks.shadowJar {
relocate ("org.codehaus", "de.bluecolored.shadow.codehaus") relocate ("org.codehaus", "de.bluecolored.shadow.codehaus")
relocate ("io.leangen.geantyref", "de.bluecolored.shadow.geantyref") relocate ("io.leangen.geantyref", "de.bluecolored.shadow.geantyref")
relocate ("io.airlift", "de.bluecolored.shadow.airlift") relocate ("io.airlift", "de.bluecolored.shadow.airlift")
relocate ("net.jpountz", "de.bluecolored.shadow.jpountz")
relocate ("com.google.errorprone", "de.bluecolored.shadow.google.errorprone") relocate ("com.google.errorprone", "de.bluecolored.shadow.google.errorprone")
relocate ("com.google.inject", "de.bluecolored.shadow.google.inject") relocate ("com.google.inject", "de.bluecolored.shadow.google.inject")

View File

@ -10,7 +10,7 @@ plugins {
id("com.diffplug.spotless") version "6.1.2" id("com.diffplug.spotless") version "6.1.2"
id ("com.github.node-gradle.node") version "3.0.1" id ("com.github.node-gradle.node") version "3.0.1"
id ("com.github.johnrengelman.shadow") version "7.1.2" id ("com.github.johnrengelman.shadow") version "7.1.2"
id ("fabric-loom") version "1.3-SNAPSHOT" id ("fabric-loom") version "1.5-SNAPSHOT"
id ("com.modrinth.minotaur") version "2.+" id ("com.modrinth.minotaur") version "2.+"
id ("com.matthewprenger.cursegradle") version "1.4.0" id ("com.matthewprenger.cursegradle") version "1.4.0"
} }
@ -115,6 +115,7 @@ tasks.shadowJar {
relocate ("org.codehaus", "de.bluecolored.shadow.codehaus") relocate ("org.codehaus", "de.bluecolored.shadow.codehaus")
relocate ("io.leangen.geantyref", "de.bluecolored.shadow.geantyref") relocate ("io.leangen.geantyref", "de.bluecolored.shadow.geantyref")
relocate ("io.airlift", "de.bluecolored.shadow.airlift") relocate ("io.airlift", "de.bluecolored.shadow.airlift")
relocate ("net.jpountz", "de.bluecolored.shadow.jpountz")
relocate ("com.google.errorprone", "de.bluecolored.shadow.google.errorprone") relocate ("com.google.errorprone", "de.bluecolored.shadow.google.errorprone")
relocate ("com.google.inject", "de.bluecolored.shadow.google.inject") relocate ("com.google.inject", "de.bluecolored.shadow.google.inject")

View File

@ -137,6 +137,7 @@ shadowJar {
relocate ("org.codehaus", "de.bluecolored.shadow.codehaus") relocate ("org.codehaus", "de.bluecolored.shadow.codehaus")
relocate ("io.leangen.geantyref", "de.bluecolored.shadow.geantyref") relocate ("io.leangen.geantyref", "de.bluecolored.shadow.geantyref")
relocate ("io.airlift", "de.bluecolored.shadow.airlift") relocate ("io.airlift", "de.bluecolored.shadow.airlift")
relocate ("net.jpountz", "de.bluecolored.shadow.jpountz")
relocate ("com.google.errorprone", "de.bluecolored.shadow.google.errorprone") relocate ("com.google.errorprone", "de.bluecolored.shadow.google.errorprone")
relocate ("com.google.inject", "de.bluecolored.shadow.google.inject") relocate ("com.google.inject", "de.bluecolored.shadow.google.inject")

View File

@ -137,6 +137,7 @@ shadowJar {
relocate ("org.codehaus", "de.bluecolored.shadow.codehaus") relocate ("org.codehaus", "de.bluecolored.shadow.codehaus")
relocate ("io.leangen.geantyref", "de.bluecolored.shadow.geantyref") relocate ("io.leangen.geantyref", "de.bluecolored.shadow.geantyref")
relocate ("io.airlift", "de.bluecolored.shadow.airlift") relocate ("io.airlift", "de.bluecolored.shadow.airlift")
relocate ("net.jpountz", "de.bluecolored.shadow.jpountz")
relocate ("com.google.errorprone", "de.bluecolored.shadow.google.errorprone") relocate ("com.google.errorprone", "de.bluecolored.shadow.google.errorprone")
relocate ("com.google.inject", "de.bluecolored.shadow.google.inject") relocate ("com.google.inject", "de.bluecolored.shadow.google.inject")

View File

@ -137,6 +137,7 @@ shadowJar {
relocate ("org.codehaus", "de.bluecolored.shadow.codehaus") relocate ("org.codehaus", "de.bluecolored.shadow.codehaus")
relocate ("io.leangen.geantyref", "de.bluecolored.shadow.geantyref") relocate ("io.leangen.geantyref", "de.bluecolored.shadow.geantyref")
relocate ("io.airlift", "de.bluecolored.shadow.airlift") relocate ("io.airlift", "de.bluecolored.shadow.airlift")
relocate ("net.jpountz", "de.bluecolored.shadow.jpountz")
relocate ("com.google.errorprone", "de.bluecolored.shadow.google.errorprone") relocate ("com.google.errorprone", "de.bluecolored.shadow.google.errorprone")
relocate ("com.google.inject", "de.bluecolored.shadow.google.inject") relocate ("com.google.inject", "de.bluecolored.shadow.google.inject")

View File

@ -111,6 +111,7 @@ shadowJar {
relocate ("org.codehaus", "de.bluecolored.shadow.codehaus") relocate ("org.codehaus", "de.bluecolored.shadow.codehaus")
relocate ("io.leangen.geantyref", "de.bluecolored.shadow.geantyref") relocate ("io.leangen.geantyref", "de.bluecolored.shadow.geantyref")
relocate ("io.airlift", "de.bluecolored.shadow.airlift") relocate ("io.airlift", "de.bluecolored.shadow.airlift")
relocate ("net.jpountz", "de.bluecolored.shadow.jpountz")
relocate ("com.google.errorprone", "de.bluecolored.shadow.google.errorprone") relocate ("com.google.errorprone", "de.bluecolored.shadow.google.errorprone")
relocate ("com.google.inject", "de.bluecolored.shadow.google.inject") relocate ("com.google.inject", "de.bluecolored.shadow.google.inject")

View File

@ -100,6 +100,7 @@ tasks.shadowJar {
relocate ("org.codehaus", "de.bluecolored.shadow.codehaus") relocate ("org.codehaus", "de.bluecolored.shadow.codehaus")
relocate ("io.leangen.geantyref", "de.bluecolored.shadow.geantyref") relocate ("io.leangen.geantyref", "de.bluecolored.shadow.geantyref")
relocate ("io.airlift", "de.bluecolored.shadow.airlift") relocate ("io.airlift", "de.bluecolored.shadow.airlift")
relocate ("net.jpountz", "de.bluecolored.shadow.jpountz")
relocate ("com.google.errorprone", "de.bluecolored.shadow.google.errorprone") relocate ("com.google.errorprone", "de.bluecolored.shadow.google.errorprone")
relocate ("com.google.inject", "de.bluecolored.shadow.google.inject") relocate ("com.google.inject", "de.bluecolored.shadow.google.inject")

View File

@ -102,6 +102,7 @@ tasks.shadowJar {
relocate ("org.codehaus", "de.bluecolored.shadow.codehaus") relocate ("org.codehaus", "de.bluecolored.shadow.codehaus")
relocate ("io.leangen.geantyref", "de.bluecolored.shadow.geantyref") relocate ("io.leangen.geantyref", "de.bluecolored.shadow.geantyref")
relocate ("io.airlift", "de.bluecolored.shadow.airlift") relocate ("io.airlift", "de.bluecolored.shadow.airlift")
relocate ("net.jpountz", "de.bluecolored.shadow.jpountz")
relocate ("com.google.errorprone", "de.bluecolored.shadow.google.errorprone") relocate ("com.google.errorprone", "de.bluecolored.shadow.google.errorprone")
relocate ("com.google.inject", "de.bluecolored.shadow.google.inject") relocate ("com.google.inject", "de.bluecolored.shadow.google.inject")

View File

@ -120,6 +120,7 @@ tasks.shadowJar {
relocate ("org.codehaus", "de.bluecolored.shadow.codehaus") relocate ("org.codehaus", "de.bluecolored.shadow.codehaus")
relocate ("io.leangen.geantyref", "de.bluecolored.shadow.geantyref") relocate ("io.leangen.geantyref", "de.bluecolored.shadow.geantyref")
relocate ("io.airlift", "de.bluecolored.shadow.airlift") relocate ("io.airlift", "de.bluecolored.shadow.airlift")
relocate ("net.jpountz", "de.bluecolored.shadow.jpountz")
relocate ("org.apache.commons.dbcp2", "de.bluecolored.shadow.apache.commons.dbcp2") relocate ("org.apache.commons.dbcp2", "de.bluecolored.shadow.apache.commons.dbcp2")
relocate ("org.apache.commons.io", "de.bluecolored.shadow.apache.commons.io") relocate ("org.apache.commons.io", "de.bluecolored.shadow.apache.commons.io")

View File

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

View File

@ -44,10 +44,19 @@ public class SpongeWorld implements ServerWorld {
public SpongeWorld(org.spongepowered.api.world.server.ServerWorld delegate) { public SpongeWorld(org.spongepowered.api.world.server.ServerWorld delegate) {
this.delegate = new WeakReference<>(delegate); this.delegate = new WeakReference<>(delegate);
this.worldFolder = delegate.directory();
Path dimensionFolder = delegate.directory().normalize();
this.dimension = WorldTypes.registry().findValueKey(delegate.worldType()) this.dimension = WorldTypes.registry().findValueKey(delegate.worldType())
.map(k -> new Key(k.namespace(), k.value())) .map(k -> new Key(k.namespace(), k.value()))
.orElse(DataPack.DIMENSION_OVERWORLD); .orElse(DataPack.DIMENSION_OVERWORLD);
// resolve root world-folder from dimension-folder
if (DataPack.DIMENSION_OVERWORLD.equals(dimension))
this.worldFolder = dimensionFolder;
else if (DataPack.DIMENSION_THE_NETHER.equals(dimension) || DataPack.DIMENSION_THE_END.equals(dimension))
this.worldFolder = dimensionFolder.getParent();
else
this.worldFolder = dimensionFolder.getParent().getParent().getParent();
} }
@Override @Override