Add TerraForged Compat via a mixin + Fix heightmap bug in StepFeature
This commit is contained in:
+3
@@ -1,6 +1,7 @@
|
||||
package com.seibel.lod.common.wrappers.worldGeneration.step;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
|
||||
import com.seibel.lod.common.wrappers.worldGeneration.ThreadedParameters;
|
||||
import com.seibel.lod.common.wrappers.worldGeneration.mimicObject.LightedWorldGenRegion;
|
||||
@@ -11,6 +12,7 @@ import net.minecraft.ReportedException;
|
||||
import net.minecraft.world.level.chunk.ChunkAccess;
|
||||
import net.minecraft.world.level.chunk.ChunkStatus;
|
||||
import net.minecraft.world.level.chunk.ProtoChunk;
|
||||
import net.minecraft.world.level.levelgen.Heightmap;
|
||||
|
||||
public final class StepFeatures {
|
||||
/**
|
||||
@@ -40,6 +42,7 @@ public final class StepFeatures {
|
||||
for (ChunkAccess chunk : chunksToDo) {
|
||||
try {
|
||||
worldGenRegion.setOverrideCenter(chunk.getPos());
|
||||
Heightmap.primeHeightmaps(chunk, STATUS.heightmapsAfter());
|
||||
envionment.params.generator.applyBiomeDecoration(worldGenRegion, tParams.structFeat);
|
||||
} catch (ReportedException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
+1
-1
Submodule core updated: ae752c6f63...77492a8abf
@@ -25,10 +25,19 @@ configurations {
|
||||
developmentForge.extendsFrom common
|
||||
}
|
||||
|
||||
def addMod(path, enabled) {
|
||||
if (enabled == "2")
|
||||
dependencies { modImplementation(path) }
|
||||
else if (enabled == "1")
|
||||
dependencies { modCompileOnly(path) }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// Forge loader
|
||||
forge "net.minecraftforge:forge:${rootProject.minecraft_version}-${rootProject.forge_version}"
|
||||
|
||||
addMod("curse.maven:TerraForged-363820:${rootProject.terraforged_version}", rootProject.enable_terraforged)
|
||||
|
||||
common(project(path: ":common", configuration: "namedElements")) { transitive false }
|
||||
shadowMe(project(path: ":common", configuration: "transformProductionForge")) { transitive = false }
|
||||
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.seibel.lod.forge.mixins;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
//import com.seibel.lod.core.api.ClientApi;
|
||||
import com.terraforged.mod.chunk.generator.FeatureGenerator;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.ConfiguredFeature;
|
||||
|
||||
@Mixin(FeatureGenerator.class)
|
||||
public class MixinTFChunkGenerator {
|
||||
|
||||
@Redirect(method = "decorate("
|
||||
+ "Lnet/minecraft/world/level/StructureFeatureManager;"
|
||||
+ "Lnet/minecraft/world/level/WorldGenLevel;"
|
||||
+ "Lnet/minecraft/world/level/chunk/ChunkAccess;"
|
||||
+ "Lnet/minecraft/world/level/biome/Biome;"
|
||||
+ "Lnet/minecraft/core/BlockPos;"
|
||||
+ "Lcom/terraforged/mod/profiler/watchdog/WatchdogContext;)V",
|
||||
at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/world/level/levelgen/feature/ConfiguredFeature;place("
|
||||
+ "Lnet/minecraft/world/level/WorldGenLevel;"
|
||||
+ "Lnet/minecraft/world/level/chunk/ChunkGenerator;"
|
||||
+ "Ljava/util/Random;Lnet/minecraft/core/BlockPos;)Z"
|
||||
), require = 0)
|
||||
private boolean wrapDecorate$FeaturePlace(ConfiguredFeature<?, ?> feature, WorldGenLevel arg,
|
||||
ChunkGenerator arg2, Random random, BlockPos arg3) {
|
||||
synchronized((FeatureGenerator)(Object)this) {
|
||||
//ClientApi.LOGGER.info("wrapDecorate FeaturePlace triggered");
|
||||
return feature.place(arg, arg2, random, arg3);
|
||||
}
|
||||
}
|
||||
|
||||
//METHOD: com.terraforged.mod.chunk.generator.FeatureGenerator.decorate(StructureFeatureManager manager,
|
||||
// WorldGenLevel region, ChunkAccess chunk, Biome biome, BlockPos pos, WatchdogContext context)
|
||||
|
||||
//TARGET: boolean net.minecraft.world.level.levelgen.feature.ConfiguredFeature.place
|
||||
// (WorldGenLevel arg, ChunkGenerator arg2, Random random, BlockPos arg3)
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
"package": "com.seibel.lod.forge.mixins",
|
||||
"compatibilityLevel": "JAVA_8",
|
||||
"mixins": [
|
||||
"MixinChunkGenerator"
|
||||
"MixinChunkGenerator",
|
||||
"MixinTFChunkGenerator"
|
||||
],
|
||||
"client": [
|
||||
"MixinOptionsScreen",
|
||||
|
||||
+2
-1
@@ -25,4 +25,5 @@ fabric_api_version=0.34.2+1.16
|
||||
# Forge loader
|
||||
forge_version=36.2.23
|
||||
# Forge mods
|
||||
## currentlly no mods ##
|
||||
terraforged_version=3285909
|
||||
enable_terraforged=1
|
||||
|
||||
Reference in New Issue
Block a user