Skip to content

Commit

Permalink
Add Terrablender compat for Meneglin biome
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensworks committed Jul 31, 2024
1 parent e807d29 commit b662708
Show file tree
Hide file tree
Showing 7 changed files with 92 additions and 0 deletions.
5 changes: 5 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ dependencies {
/*runtimeOnly(fg.deobf("com.refinedmods:refinedstorage:${project.refinedstorage_version}")) { // https://repo.refinedmods.com/com/refinedmods/refinedstorage/
transitive = false
}*/

implementation fg.deobf("com.github.glitchfiend:TerraBlender-forge:${project.terrablender_version}")
}

minecraft {
Expand All @@ -152,6 +154,9 @@ minecraft {
workingDirectory project.file('run')
//property 'forge.logging.markers', 'REGISTRIES,REGISTRYDUMP'
property 'forge.logging.console.level', 'debug'
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile',"${buildDir}/createSrgToMcp/output.srg"

mods {
integrateddynamics {
source sourceSets.main
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ ie_version=0.12-90-521
crafttweakerapi_version=4.1.6.457
crafttweakermain_version=1.12-4.1.6.457
signals_version=1.12.2:1.1.0-2
terrablender_version=1.19.2-2.0.1.166

# Workaround for Spotless bug
# https://github.com/diffplug/spotless/issues/834
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import org.cyclops.integrateddynamicscompat.modcompat.capabilities.WorkerDryingBasinBlockEntityCompat;
import org.cyclops.integrateddynamicscompat.modcompat.capabilities.WorkerMechanicalMachineBlockEntityCompat;
import org.cyclops.integrateddynamicscompat.modcompat.capabilities.WorkerSqueezerBlockEntityCompat;
import org.cyclops.integrateddynamicscompat.modcompat.terrablender.TerrablenderCompat;
import org.cyclops.integrateddynamicscompat.modcompat.top.TopModCompat;
import org.cyclops.integrateddynamicscompat.proxy.ClientProxy;
import org.cyclops.integrateddynamicscompat.proxy.CommonProxy;
Expand All @@ -40,6 +41,7 @@ public IntegratedDynamicsCompat() {
protected void loadModCompats(ModCompatLoader modCompatLoader) {
super.loadModCompats(modCompatLoader);
modCompatLoader.addModCompat(new TopModCompat());
modCompatLoader.addModCompat(new TerrablenderCompat());
// TODO: temporarily disable some mod compats
// Mod compats
// modCompatLoader.addModCompat(new RefinedStorageModCompat());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ public class Reference {
public static final String MOD_TOP = "theoneprobe";
public static final String MOD_WAILA = "waila";
public static final String MOD_REFINEDSTORAGE = "refinedstorage";
public static final String MOD_TERRABLENDER = "terrablender";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package org.cyclops.integrateddynamicscompat.modcompat.terrablender;

import org.cyclops.cyclopscore.modcompat.ICompatInitializer;
import org.cyclops.cyclopscore.modcompat.IModCompat;
import org.cyclops.integrateddynamicscompat.Reference;

/**
* Compatibility plugin for Terrablender.
* @author rubensworks
*
*/
public class TerrablenderCompat implements IModCompat {

@Override
public String getId() {
return Reference.MOD_TERRABLENDER;
}

@Override
public boolean isEnabledDefault() {
return true;
}

@Override
public String getComment() {
return "Injection of biomes.";
}

@Override
public ICompatInitializer createInitializer() {
return new TerrablenderCompatInitializer();
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package org.cyclops.integrateddynamicscompat.modcompat.terrablender;

import net.minecraft.resources.ResourceLocation;
import org.cyclops.cyclopscore.modcompat.ICompatInitializer;
import org.cyclops.integrateddynamics.Reference;
import org.cyclops.integrateddynamics.world.biome.BiomeMeneglinConfig;
import terrablender.api.Regions;

/**
* @author rubensworks
*/
public class TerrablenderCompatInitializer implements ICompatInitializer {
@Override
public void initialize() {
if (BiomeMeneglinConfig.spawnWeight > 0) {
Regions.register(new TestRegion(new ResourceLocation(Reference.MOD_ID, "overworld"), BiomeMeneglinConfig.spawnWeight));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package org.cyclops.integrateddynamicscompat.modcompat.terrablender;

import net.minecraft.core.Registry;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.level.biome.Biomes;
import net.minecraft.world.level.biome.Climate;
import org.cyclops.integrateddynamics.Reference;
import terrablender.api.Region;
import terrablender.api.RegionType;

import java.util.function.Consumer;

/**
* @author rubensworks
*/
public class TestRegion extends Region
{
public TestRegion(ResourceLocation name, int weight) {
super(name, RegionType.OVERWORLD, weight);
}

@Override
public void addBiomes(Registry<Biome> registry, Consumer<com.mojang.datafixers.util.Pair<Climate.ParameterPoint, ResourceKey<Biome>>> mapper) {
this.addModifiedVanillaOverworldBiomes(mapper, builder -> {
builder.replaceBiome(Biomes.FOREST, ResourceKey.create(Registry.BIOME_REGISTRY, new ResourceLocation(Reference.MOD_ID, "meneglin")));
});
}
}

0 comments on commit b662708

Please sign in to comment.