-
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from ClothCreators/dev
Biomes, Itemgroup fixes, Ore generation and Falling blocks
- Loading branch information
Showing
10 changed files
with
271 additions
and
36 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
templates: | ||
- template: biome.java.ftl | ||
name: "@SRCROOT/@BASEPACKAGEPATH/world/biome/@NAME.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
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,118 @@ | ||
<#-- @formatter:off --> | ||
package ${package}.world.biome; | ||
|
||
import net.fabricmc.fabric.api.biomes.v1.OverworldClimate; | ||
import net.fabricmc.api.EnvType; | ||
import net.fabricmc.api.Environment; | ||
|
||
public class ${name} extends Biome{ | ||
|
||
public static final int WEIGHT = ${data.biomeWeight}; | ||
|
||
public ${name}(){ | ||
super(new Biome.Settings().configureSurfaceBuilder(SurfaceBuilder.DEFAULT, SurfaceBuilder.GRASS_CONFIG) | ||
.precipitation(Biome.Precipitation.<#if (data.rainingPossibility > 0)><#if (data.temperature > 0.15)>RAIN<#else>SNOW</#if><#else>NONE</#if>) | ||
.category(Biome.Category.PLAINS) | ||
.depth(${data.baseHeight}f) | ||
.scale(${data.heightVariation}f) | ||
.temperature(${data.temperature}f) | ||
.precipitation(Precipitation.<#if (data.rainingPossibility > 0)><#if (data.temperature > 0.15)>RAIN<#else>SNOW</#if><#else>NONE</#if>) | ||
.downfall(${data.rainingPossibility}f) | ||
<#if data.customColors> | ||
.waterColor(${data.waterColor.getRGB()}).waterFogColor(${data.waterColor.getRGB()}) | ||
<#else> | ||
.waterColor(4159204).waterFogColor(329011) | ||
</#if> | ||
<#if data.parent?? && data.parent.getUnmappedValue() != "No parent"> | ||
.parent("${data.parent}") | ||
<#else> | ||
.parent((String)null)); | ||
</#if> | ||
|
||
this.addStructureFeature(Feature.MINESHAFT.configure(new MineshaftFeatureConfig(0.004D, MineshaftFeature.Type.NORMAL))); | ||
this.addStructureFeature(Feature.STRONGHOLD.configure(FeatureConfig.DEFAULT)); | ||
DefaultBiomeFeatures.addLandCarvers(this); | ||
DefaultBiomeFeatures.addDefaultStructures(this); | ||
DefaultBiomeFeatures.addDungeons(this); | ||
DefaultBiomeFeatures.addDefaultOres(this); | ||
DefaultBiomeFeatures.addDefaultDisks(this); | ||
DefaultBiomeFeatures.addDefaultVegetation(this); | ||
DefaultBiomeFeatures.addSprings(this); | ||
DefaultBiomeFeatures.addFrozenTopLayer(this); | ||
<#if (data.flowersPerChunk > 0)> | ||
DefaultBiomeFeatures.addDefaultFlowers(this); | ||
</#if> | ||
<#if (data.grassPerChunk > 0)> | ||
DefaultBiomeFeatures.addDefaultGrass(this); | ||
</#if> | ||
<#if (data.flowersPerChunk > 0)> | ||
DefaultBiomeFeatures.addForestFlowers(this); | ||
</#if> | ||
<#if data.generateLakes> | ||
DefaultBiomeFeatures.addDefaultLakes(this); | ||
</#if> | ||
<#if (data.mushroomsPerChunk > 0)> | ||
DefaultBiomeFeatures.addDefaultMushrooms(this); | ||
</#if> | ||
<#if (data.treesPerChunk > 0)> | ||
<#if data.vanillaTreeType == "Big trees"> | ||
DefaultBiomeFeatures.addTallBirchTrees(this); | ||
DefaultBiomeFeatures.addForestTrees(this); | ||
<#elseif data.vanillaTreeType == "Savanna trees"> | ||
DefaultBiomeFeatures.addSavannaTrees(this); | ||
<#elseif data.vanillaTreeType == "Mega pine trees"> | ||
DefaultBiomeFeatures.addGiantTreeTaigaTrees(this); | ||
<#elseif data.vanillaTreeType == "Mega spruce trees"> | ||
DefaultBiomeFeatures.addGiantSpruceTaigaTrees(this); | ||
<#elseif data.vanillaTreeType == "Birch trees"> | ||
DefaultBiomeFeatures.addBirchTrees(this); | ||
<#else> | ||
DefaultBiomeFeatures.addBirchTrees(this); | ||
DefaultBiomeFeatures.addForestTrees(this); | ||
</#if> | ||
</#if> | ||
<#if (data.bigMushroomsChunk > 0)> | ||
DefaultBiomeFeatures.addMushroomFieldsFeatures(this); | ||
</#if> | ||
<#if (data.reedsPerChunk > 0)> | ||
DefaultBiomeFeatures.addBamboo(this); | ||
</#if> | ||
<#if (data.cactiPerChunk > 0)> | ||
DefaultBiomeFeatures.addDesertFeatures(this); | ||
</#if> | ||
|
||
this.addSpawn(EntityCategory.CREATURE, new Biome.SpawnEntry(EntityType.SHEEP, 12, 4, 4)); | ||
this.addSpawn(EntityCategory.CREATURE, new Biome.SpawnEntry(EntityType.PIG, 10, 4, 4)); | ||
this.addSpawn(EntityCategory.CREATURE, new Biome.SpawnEntry(EntityType.CHICKEN, 10, 4, 4)); | ||
this.addSpawn(EntityCategory.CREATURE, new Biome.SpawnEntry(EntityType.COW, 8, 4, 4)); | ||
this.addSpawn(EntityCategory.AMBIENT, new Biome.SpawnEntry(EntityType.BAT, 10, 8, 8)); | ||
this.addSpawn(EntityCategory.MONSTER, new Biome.SpawnEntry(EntityType.SPIDER, 100, 4, 4)); | ||
this.addSpawn(EntityCategory.MONSTER, new Biome.SpawnEntry(EntityType.ZOMBIE, 95, 4, 4)); | ||
this.addSpawn(EntityCategory.MONSTER, new Biome.SpawnEntry(EntityType.ZOMBIE_VILLAGER, 5, 1, 1)); | ||
this.addSpawn(EntityCategory.MONSTER, new Biome.SpawnEntry(EntityType.SKELETON, 100, 4, 4)); | ||
this.addSpawn(EntityCategory.MONSTER, new Biome.SpawnEntry(EntityType.CREEPER, 100, 4, 4)); | ||
this.addSpawn(EntityCategory.MONSTER, new Biome.SpawnEntry(EntityType.SLIME, 100, 4, 4)); | ||
this.addSpawn(EntityCategory.MONSTER, new Biome.SpawnEntry(EntityType.ENDERMAN, 10, 1, 4)); | ||
this.addSpawn(EntityCategory.MONSTER, new Biome.SpawnEntry(EntityType.WITCH, 5, 1, 1)); | ||
} | ||
<#if data.customColors> | ||
@Environment(EnvType.CLIENT) | ||
@Override | ||
public int getSkyColor() { | ||
return ${data.airColor.getRGB()}; | ||
} | ||
|
||
@Environment(EnvType.CLIENT) | ||
@Override | ||
public int getGrassColorAt(double x, double z) { | ||
return ${data.grassColor.getRGB()}; | ||
} | ||
|
||
@Environment(EnvType.CLIENT) | ||
@Override | ||
public int getFoliageColor() { | ||
return ${data.grassColor.getRGB()}; | ||
} | ||
</#if> | ||
} | ||
<#-- @formatter:on --> |
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
36 changes: 36 additions & 0 deletions
36
src/fabric-1.15.2/templates/modbase/biomeRegistry.java.ftl
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,36 @@ | ||
<#-- @formatter:off --> | ||
/* | ||
* MCreator note: | ||
* | ||
* If you lock base mod element files, you can edit this file and the proxy files | ||
* and they won't get overwritten. If you change your mod package or modid, you | ||
* need to apply these changes to this file MANUALLY. | ||
* | ||
* | ||
* | ||
* If you do not lock base mod element files in Workspace settings, this file | ||
* will be REGENERATED on each build. | ||
* | ||
*/ | ||
package ${package}.registry; | ||
|
||
public class ${JavaModName}Biomes { | ||
|
||
<#list w.getElementsOfType("BIOME") as biome> | ||
public static Biome ${biome?upper_case}; | ||
</#list> | ||
|
||
public static void registerBiomes() | ||
{ | ||
<#list w.getElementsOfType("BIOME") as biome> | ||
${biome?upper_case} = register(new ${biome}(), "${modid}"); | ||
FabricBiomes.addSpawnBiome(${JavaModName}Biomes.${biome?upper_case}); | ||
</#list> | ||
} | ||
|
||
private static Biome register(Biome biome, String id) { | ||
return Registry.register(Registry.BIOME, id, biome); | ||
} | ||
|
||
} | ||
<#-- @formatter:on --> |
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
Oops, something went wrong.