mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2025-07-04 00:45:57 +00:00
fabric cleanup, move lang and config to common
This commit is contained in:
parent
1637644bdd
commit
0fcc0f798c
@ -6,7 +6,9 @@ import org.gradle.api.plugins.JavaPluginConvention
|
|||||||
import org.gradle.api.tasks.compile.JavaCompile
|
import org.gradle.api.tasks.compile.JavaCompile
|
||||||
import org.gradle.api.tasks.javadoc.Javadoc
|
import org.gradle.api.tasks.javadoc.Javadoc
|
||||||
import org.gradle.kotlin.dsl.configure
|
import org.gradle.kotlin.dsl.configure
|
||||||
|
import org.gradle.kotlin.dsl.filter
|
||||||
import org.gradle.kotlin.dsl.withType
|
import org.gradle.kotlin.dsl.withType
|
||||||
|
import org.gradle.language.jvm.tasks.ProcessResources
|
||||||
|
|
||||||
fun Project.configureCompilation() {
|
fun Project.configureCompilation() {
|
||||||
configure<JavaPluginConvention> {
|
configure<JavaPluginConvention> {
|
||||||
@ -21,6 +23,15 @@ fun Project.configureCompilation() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tasks.withType<ProcessResources> {
|
||||||
|
include("**/*.*")
|
||||||
|
filter<org.apache.tools.ant.filters.ReplaceTokens>(
|
||||||
|
"tokens" to mapOf(
|
||||||
|
"VERSION" to project.version.toString()
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
tasks.withType<Javadoc> {
|
tasks.withType<Javadoc> {
|
||||||
options.encoding = "UTF-8"
|
options.encoding = "UTF-8"
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ dependencies {
|
|||||||
|
|
||||||
"compileOnly"("com.googlecode.json-simple:json-simple:1.1")
|
"compileOnly"("com.googlecode.json-simple:json-simple:1.1")
|
||||||
|
|
||||||
"shadedApi"("com.google.guava:guava:30.0-jre")
|
"compileOnly"("com.google.guava:guava:30.0-jre")
|
||||||
}
|
}
|
||||||
|
|
||||||
publishing {
|
publishing {
|
||||||
|
@ -31,15 +31,8 @@ dependencies {
|
|||||||
"shadedImplementation"("org.bstats:bstats-bukkit:1.7")
|
"shadedImplementation"("org.bstats:bstats-bukkit:1.7")
|
||||||
|
|
||||||
"compileOnly"("com.sk89q.worldedit:worldedit-bukkit:7.2.0-SNAPSHOT")
|
"compileOnly"("com.sk89q.worldedit:worldedit-bukkit:7.2.0-SNAPSHOT")
|
||||||
}
|
|
||||||
|
|
||||||
tasks.withType<ProcessResources> {
|
"shadedImplementation"("com.google.guava:guava:30.0-jre")
|
||||||
include("**/*.*")
|
|
||||||
filter<org.apache.tools.ant.filters.ReplaceTokens>(
|
|
||||||
"tokens" to mapOf(
|
|
||||||
"VERSION" to project.version.toString()
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
val testDir = "target/server/"
|
val testDir = "target/server/"
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import com.dfsek.terra.configureCommon
|
import com.dfsek.terra.configureCommon
|
||||||
|
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||||
import net.fabricmc.loom.LoomGradleExtension
|
import net.fabricmc.loom.LoomGradleExtension
|
||||||
import net.fabricmc.loom.task.RemapJarTask
|
import net.fabricmc.loom.task.RemapJarTask
|
||||||
|
|
||||||
@ -23,6 +24,11 @@ plugins {
|
|||||||
|
|
||||||
configureCommon()
|
configureCommon()
|
||||||
|
|
||||||
|
tasks.named<ShadowJar>("shadowJar") {
|
||||||
|
relocate("org.json", "com.dfsek.terra.lib.json")
|
||||||
|
relocate("org.yaml", "com.dfsek.terra.lib.yaml")
|
||||||
|
}
|
||||||
|
|
||||||
group = "com.dfsek.terra.fabric"
|
group = "com.dfsek.terra.fabric"
|
||||||
|
|
||||||
|
|
||||||
|
@ -163,11 +163,7 @@ public class TerraFabricPlugin implements TerraPlugin, ModInitializer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Language getLanguage() {
|
public Language getLanguage() {
|
||||||
try {
|
return LangUtil.getLanguage();
|
||||||
return new Language(new File(getDataFolder(), "lang/en_us.yml"));
|
|
||||||
} catch(IOException e) {
|
|
||||||
throw new IllegalArgumentException();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -267,10 +263,10 @@ public class TerraFabricPlugin implements TerraPlugin, ModInitializer {
|
|||||||
public void onInitialize() {
|
public void onInitialize() {
|
||||||
instance = this;
|
instance = this;
|
||||||
|
|
||||||
config = new File(FabricLoader.getInstance().getConfigDir().toFile(), "Terra");
|
this.config = new File(FabricLoader.getInstance().getConfigDir().toFile(), "Terra");
|
||||||
saveDefaultConfig();
|
saveDefaultConfig();
|
||||||
plugin.load(this);
|
plugin.load(this);
|
||||||
LangUtil.load("en_us", this);
|
LangUtil.load(plugin.getLanguage(), this);
|
||||||
logger.info("Initializing Terra...");
|
logger.info("Initializing Terra...");
|
||||||
|
|
||||||
if(!addonRegistry.loadAll()) {
|
if(!addonRegistry.loadAll()) {
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"mixins": [
|
"mixins": [
|
||||||
"terra.mixins.json"
|
|
||||||
],
|
],
|
||||||
"depends": {
|
"depends": {
|
||||||
"fabricloader": ">=0.7.4",
|
"fabricloader": ">=0.7.4",
|
||||||
|
@ -1,14 +0,0 @@
|
|||||||
{
|
|
||||||
"required": true,
|
|
||||||
"minVersion": "0.8",
|
|
||||||
"package": "com.dfsek.terra.fabric.mixin",
|
|
||||||
"compatibilityLevel": "JAVA_8",
|
|
||||||
"mixins": [
|
|
||||||
],
|
|
||||||
"client": [
|
|
||||||
],
|
|
||||||
"server": [],
|
|
||||||
"injectors": {
|
|
||||||
"defaultRequire": 1
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user