add remapShadedJar task to Fabric

This commit is contained in:
dfsek
2020-12-23 23:03:42 -07:00
parent 1c316e52a9
commit fc82eff93b
3 changed files with 21 additions and 2 deletions

View File

@@ -1,5 +1,6 @@
import com.dfsek.terra.configureCommon
import net.fabricmc.loom.LoomGradleExtension
import net.fabricmc.loom.task.RemapJarTask
buildscript {
repositories {
@@ -29,6 +30,12 @@ configure<LoomGradleExtension> {
accessWidener("src/main/resources/terra.accesswidener")
}
tasks.register<RemapJarTask>("remapShadedJar") {
setProperty("input", file("build/libs/fabric-${version}-shaded.jar"))
setProperty("addNestedDependencies", false)
setProperty("remapAccessWidener", true)
}
dependencies {
"shadedApi"(project(":common"))
"shadedImplementation"("org.yaml:snakeyaml:1.27")

View File

@@ -92,7 +92,17 @@ public class TerraFabricPlugin implements TerraPlugin, ModInitializer {
.add("LARGE_SPRUCE", ConfiguredFeatures.PINE)
.add("SMALL_JUNGLE", ConfiguredFeatures.JUNGLE_TREE)
.add("SWAMP_OAK", ConfiguredFeatures.SWAMP_TREE)
.add("TALL_BIRCH", ConfiguredFeatures.BIRCH_TALL)).build();
.add("TALL_BIRCH", ConfiguredFeatures.BIRCH_TALL)
.add("ACACIA", ConfiguredFeatures.ACACIA)
.add("BIRCH", ConfiguredFeatures.BIRCH)
.add("DARK_OAK", ConfiguredFeatures.DARK_OAK)
.add("OAK", ConfiguredFeatures.OAK)
.add("CHORUS_PLANT", ConfiguredFeatures.CHORUS_PLANT)
.add("SPRUCE", ConfiguredFeatures.SPRUCE)
.add("JUNGLE_BUSH", ConfiguredFeatures.JUNGLE_BUSH)
.add("MEGA_SPRUCE", ConfiguredFeatures.MEGA_SPRUCE)
.add("CRIMSON_FUNGUS", ConfiguredFeatures.CRIMSON_FUNGI)
.add("WARPED_FUNGUS", ConfiguredFeatures.WARPED_FUNGI)).build();
private final PluginConfig plugin = new PluginConfig();
@Override
@@ -160,7 +170,8 @@ public class TerraFabricPlugin implements TerraPlugin, ModInitializer {
@Override
public void saveDefaultConfig() {
try(InputStream stream = getClass().getResourceAsStream("/config.yml")) {
FileUtils.copyInputStreamToFile(stream, new File(getDataFolder(), "config.yml"));
File configFile = new File(getDataFolder(), "config.yml");
if(!configFile.exists()) FileUtils.copyInputStreamToFile(stream, configFile);
} catch(IOException e) {
e.printStackTrace();
}

View File

@@ -1,5 +1,6 @@
accessWidener v1 named
extendable method net/minecraft/client/world/GeneratorType <init> (Ljava/lang/String;)V
accessible field net/minecraft/server/world/ServerWorld worldProperties Lnet/minecraft/world/level/ServerWorldProperties;
mutable field net/minecraft/server/world/ServerWorld worldProperties Lnet/minecraft/world/level/ServerWorldProperties;