mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-15 21:31:05 +00:00
Merge pull request #328 from PolyhedralDev/dev/architectury
Use Architectury to share mixins and mod code not dependent on mod loader
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
dependencies {
|
||||
api("ca.solo-studios", "strata", Versions.Libraries.strata)
|
||||
api("org.slf4j", "slf4j-api", Versions.Libraries.slf4j)
|
||||
compileOnlyApi("org.slf4j", "slf4j-api", Versions.Libraries.slf4j)
|
||||
testImplementation("org.slf4j", "slf4j-api", Versions.Libraries.slf4j)
|
||||
api("cloud.commandframework", "cloud-core", Versions.Libraries.cloud)
|
||||
|
||||
api("com.dfsek.tectonic", "common", Versions.Libraries.tectonic)
|
||||
|
||||
@@ -11,6 +11,7 @@ import org.jetbrains.annotations.Contract;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Predicate;
|
||||
@@ -145,6 +146,11 @@ public final class Pair<L, R> {
|
||||
}
|
||||
}
|
||||
|
||||
public Pair<L, R> apply(BiConsumer<L, R> consumer) {
|
||||
consumer.accept(this.left, this.right);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format("{%s,%s}", left, right);
|
||||
|
||||
@@ -2,6 +2,8 @@ dependencies {
|
||||
api(project(":common:api"))
|
||||
api(project(":common:implementation:bootstrap-addon-loader"))
|
||||
|
||||
testImplementation("org.slf4j", "slf4j-api", Versions.Libraries.slf4j)
|
||||
|
||||
implementation("commons-io", "commons-io", Versions.Libraries.Internal.apacheIO)
|
||||
|
||||
implementation("org.apache.commons", "commons-text", Versions.Libraries.Internal.apacheText)
|
||||
|
||||
@@ -111,8 +111,12 @@ public abstract class AbstractPlatform implements Platform {
|
||||
logger.info("Loading config.yml");
|
||||
File configFile = new File(getDataFolder(), "config.yml");
|
||||
if(!configFile.exists()) {
|
||||
logger.info("Writing new config.yml...");
|
||||
FileUtils.copyInputStreamToFile(stream, configFile);
|
||||
logger.info("Dumping config.yml...");
|
||||
if(stream == null) {
|
||||
logger.warn("Could not find config.yml in JAR");
|
||||
} else {
|
||||
FileUtils.copyInputStreamToFile(stream, configFile);
|
||||
}
|
||||
}
|
||||
} catch(IOException e) {
|
||||
logger.error("Error loading config.yml resource from jar", e);
|
||||
|
||||
Reference in New Issue
Block a user