-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Terrablender compat for Meneglin biome
- Loading branch information
1 parent
e807d29
commit b662708
Showing
7 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
.../java/org/cyclops/integrateddynamicscompat/modcompat/terrablender/TerrablenderCompat.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
|
||
} |
19 changes: 19 additions & 0 deletions
19
...yclops/integrateddynamicscompat/modcompat/terrablender/TerrablenderCompatInitializer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); | ||
} | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
src/main/java/org/cyclops/integrateddynamicscompat/modcompat/terrablender/TestRegion.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"))); | ||
}); | ||
} | ||
} |