mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-15 21:31:05 +00:00
work on loom stuff
This commit is contained in:
@@ -11,39 +11,18 @@ buildscript {
|
|||||||
url = uri("https://maven.fabricmc.net/")
|
url = uri("https://maven.fabricmc.net/")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// dependencies {
|
dependencies {
|
||||||
// classpath("net.fabricmc:fabric-loom:+")
|
classpath("net.fabricmc:fabric-loom:0.6-SNAPSHOT")
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
plugins {
|
apply(plugin = "fabric-loom")
|
||||||
id("fabric-loom").version("0.5.9")
|
apply(plugin = "java-library")
|
||||||
`java-library`
|
|
||||||
}
|
|
||||||
//apply(plugin = "fabric-loom")
|
|
||||||
|
|
||||||
configureCommon()
|
configureCommon()
|
||||||
|
|
||||||
tasks.named<ShadowJar>("shadowJar") {
|
val mixinVersion = "0.8.1+build.21"
|
||||||
relocate("org.json", "com.dfsek.terra.lib.json")
|
val loomVersion = "0.6-SNAPSHOT"
|
||||||
relocate("org.yaml", "com.dfsek.terra.lib.yaml")
|
|
||||||
}
|
|
||||||
|
|
||||||
group = "com.dfsek.terra.fabric"
|
|
||||||
|
|
||||||
|
|
||||||
configure<LoomGradleExtension> {
|
|
||||||
accessWidener("src/main/resources/terra.accesswidener")
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.register<RemapJarTask>("remapShadedJar") {
|
|
||||||
val shadowJar = tasks.getByName<ShadowJar>("shadowJar")
|
|
||||||
dependsOn(shadowJar)
|
|
||||||
input.set(shadowJar.archiveFile)
|
|
||||||
archiveFileName.set(shadowJar.archiveFileName.get().replace(Regex("-shaded\\.jar$"), "shaded-mapped.jar"))
|
|
||||||
addNestedDependencies.set(true)
|
|
||||||
remapAccessWidener.set(true)
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
"shadedApi"(project(":common"))
|
"shadedApi"(project(":common"))
|
||||||
@@ -59,7 +38,26 @@ dependencies {
|
|||||||
// Fabric API. This is technically optional, but you probably want it anyway.
|
// Fabric API. This is technically optional, but you probably want it anyway.
|
||||||
"modImplementation"("net.fabricmc.fabric-api:fabric-api:0.31.0+1.16")
|
"modImplementation"("net.fabricmc.fabric-api:fabric-api:0.31.0+1.16")
|
||||||
|
|
||||||
"compileOnly"("net.fabricmc:sponge-mixin:+")
|
"compileOnly"("net.fabricmc:sponge-mixin:${mixinVersion}")
|
||||||
"annotationProcessor"("net.fabricmc:sponge-mixin:+")
|
"annotationProcessor"("net.fabricmc:sponge-mixin:${mixinVersion}")
|
||||||
"annotationProcessor"("net.fabricmc:fabric-loom:+")
|
"annotationProcessor"("net.fabricmc:fabric-loom:${loomVersion}")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tasks.named<ShadowJar>("shadowJar") {
|
||||||
|
relocate("org.json", "com.dfsek.terra.lib.json")
|
||||||
|
relocate("org.yaml", "com.dfsek.terra.lib.yaml")
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
configure<LoomGradleExtension> {
|
||||||
|
accessWidener("src/main/resources/terra.accesswidener")
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.register<RemapJarTask>("remapShadedJar") {
|
||||||
|
val shadowJar = tasks.getByName<ShadowJar>("shadowJar")
|
||||||
|
dependsOn(shadowJar)
|
||||||
|
input.set(shadowJar.archiveFile)
|
||||||
|
archiveFileName.set(shadowJar.archiveFileName.get().replace(Regex("-shaded\\.jar$"), "-shaded-mapped.jar"))
|
||||||
|
addNestedDependencies.set(true)
|
||||||
|
remapAccessWidener.set(true)
|
||||||
|
}
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ import com.dfsek.terra.config.lang.LangUtil;
|
|||||||
import com.dfsek.terra.config.lang.Language;
|
import com.dfsek.terra.config.lang.Language;
|
||||||
import com.dfsek.terra.config.pack.ConfigPack;
|
import com.dfsek.terra.config.pack.ConfigPack;
|
||||||
import com.dfsek.terra.fabric.inventory.FabricItemHandle;
|
import com.dfsek.terra.fabric.inventory.FabricItemHandle;
|
||||||
import com.dfsek.terra.fabric.mixin.BiomeEffectsAccessor;
|
|
||||||
import com.dfsek.terra.fabric.mixin.GeneratorTypeAccessor;
|
import com.dfsek.terra.fabric.mixin.GeneratorTypeAccessor;
|
||||||
import com.dfsek.terra.fabric.world.FabricBiome;
|
import com.dfsek.terra.fabric.world.FabricBiome;
|
||||||
import com.dfsek.terra.fabric.world.FabricTree;
|
import com.dfsek.terra.fabric.world.FabricTree;
|
||||||
@@ -236,20 +235,15 @@ public class TerraFabricPlugin implements TerraPlugin, ModInitializer {
|
|||||||
generationSettings.surfaceBuilder(SurfaceBuilder.DEFAULT.withConfig(new TernarySurfaceConfig(Blocks.GRASS_BLOCK.getDefaultState(), Blocks.DIRT.getDefaultState(), Blocks.GRAVEL.getDefaultState()))); // It needs a surfacebuilder, even though we dont use it.
|
generationSettings.surfaceBuilder(SurfaceBuilder.DEFAULT.withConfig(new TernarySurfaceConfig(Blocks.GRASS_BLOCK.getDefaultState(), Blocks.DIRT.getDefaultState(), Blocks.GRAVEL.getDefaultState()))); // It needs a surfacebuilder, even though we dont use it.
|
||||||
generationSettings.feature(GenerationStep.Feature.VEGETAL_DECORATION, POPULATOR_CONFIGURED_FEATURE);
|
generationSettings.feature(GenerationStep.Feature.VEGETAL_DECORATION, POPULATOR_CONFIGURED_FEATURE);
|
||||||
|
|
||||||
BiomeEffectsAccessor biomeEffectsAccessor = (BiomeEffectsAccessor) vanilla.getEffects();
|
|
||||||
|
|
||||||
BiomeEffects.Builder effects = new BiomeEffects.Builder()
|
BiomeEffects.Builder effects = new BiomeEffects.Builder()
|
||||||
.waterColor(biomeEffectsAccessor.getWaterColor())
|
.waterColor(vanilla.getEffects().waterColor)
|
||||||
.waterFogColor(biomeEffectsAccessor.getWaterFogColor())
|
.waterFogColor(vanilla.getEffects().waterFogColor)
|
||||||
.fogColor(biomeEffectsAccessor.getFogColor())
|
.fogColor(vanilla.getEffects().fogColor)
|
||||||
.skyColor(biomeEffectsAccessor.getSkyColor())
|
.skyColor(vanilla.getEffects().skyColor)
|
||||||
.grassColorModifier(biomeEffectsAccessor.getGrassColorModifier());
|
.grassColorModifier(vanilla.getEffects().grassColorModifier);
|
||||||
if(biomeEffectsAccessor.getGrassColor().isPresent()) {
|
vanilla.getEffects().grassColor.ifPresent(effects::grassColor);
|
||||||
effects.grassColor(biomeEffectsAccessor.getGrassColor().get());
|
vanilla.getEffects().foliageColor.ifPresent(effects::foliageColor);
|
||||||
}
|
|
||||||
if(biomeEffectsAccessor.getFoliageColor().isPresent()) {
|
|
||||||
effects.foliageColor(biomeEffectsAccessor.getFoliageColor().get());
|
|
||||||
}
|
|
||||||
|
|
||||||
return (new Biome.Builder())
|
return (new Biome.Builder())
|
||||||
.precipitation(vanilla.getPrecipitation())
|
.precipitation(vanilla.getPrecipitation())
|
||||||
|
|||||||
@@ -1,31 +0,0 @@
|
|||||||
package com.dfsek.terra.fabric.mixin;
|
|
||||||
|
|
||||||
import net.minecraft.world.biome.BiomeEffects;
|
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
|
||||||
import org.spongepowered.asm.mixin.gen.Accessor;
|
|
||||||
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
@Mixin(BiomeEffects.class)
|
|
||||||
public interface BiomeEffectsAccessor {
|
|
||||||
@Accessor
|
|
||||||
int getFogColor();
|
|
||||||
|
|
||||||
@Accessor
|
|
||||||
int getWaterColor();
|
|
||||||
|
|
||||||
@Accessor
|
|
||||||
int getWaterFogColor();
|
|
||||||
|
|
||||||
@Accessor
|
|
||||||
int getSkyColor();
|
|
||||||
|
|
||||||
@Accessor
|
|
||||||
Optional<Integer> getFoliageColor();
|
|
||||||
|
|
||||||
@Accessor
|
|
||||||
Optional<Integer> getGrassColor();
|
|
||||||
|
|
||||||
@Accessor
|
|
||||||
BiomeEffects.GrassColorModifier getGrassColorModifier();
|
|
||||||
}
|
|
||||||
@@ -15,9 +15,6 @@ public interface GeneratorTypeAccessor {
|
|||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Accessor
|
|
||||||
Text getTranslationKey();
|
|
||||||
|
|
||||||
@Mutable
|
@Mutable
|
||||||
@Accessor
|
@Accessor
|
||||||
void setTranslationKey(Text translationKey);
|
void setTranslationKey(Text translationKey);
|
||||||
|
|||||||
@@ -6,4 +6,14 @@ accessible field net/minecraft/server/world/ServerWorld worldProperties Lnet/min
|
|||||||
|
|
||||||
accessible method net/minecraft/world/MobSpawnerLogic getEntityId ()Lnet/minecraft/util/Identifier;
|
accessible method net/minecraft/world/MobSpawnerLogic getEntityId ()Lnet/minecraft/util/Identifier;
|
||||||
|
|
||||||
accessible field net/minecraft/state/State PROPERTY_MAP_PRINTER Ljava/util/function/Function;
|
accessible field net/minecraft/state/State PROPERTY_MAP_PRINTER Ljava/util/function/Function;
|
||||||
|
|
||||||
|
|
||||||
|
accessible field net/minecraft/world/biome/BiomeEffects fogColor I
|
||||||
|
accessible field net/minecraft/world/biome/BiomeEffects waterColor I
|
||||||
|
accessible field net/minecraft/world/biome/BiomeEffects waterFogColor I
|
||||||
|
accessible field net/minecraft/world/biome/BiomeEffects skyColor I
|
||||||
|
|
||||||
|
accessible field net/minecraft/world/biome/BiomeEffects foliageColor Ljava/util/Optional;
|
||||||
|
accessible field net/minecraft/world/biome/BiomeEffects grassColor Ljava/util/Optional;
|
||||||
|
accessible field net/minecraft/world/biome/BiomeEffects grassColorModifier Lnet/minecraft/world/biome/BiomeEffects$GrassColorModifier;
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
"package": "com.dfsek.terra.fabric.mixin",
|
"package": "com.dfsek.terra.fabric.mixin",
|
||||||
"compatibilityLevel": "JAVA_8",
|
"compatibilityLevel": "JAVA_8",
|
||||||
"mixins": [
|
"mixins": [
|
||||||
"BiomeEffectsAccessor"
|
|
||||||
],
|
],
|
||||||
"client": [
|
"client": [
|
||||||
"GeneratorTypeAccessor"
|
"GeneratorTypeAccessor"
|
||||||
|
|||||||
Reference in New Issue
Block a user