Skip to content

Commit

Permalink
Partially port biomes
Browse files Browse the repository at this point in the history
  • Loading branch information
Goldorion committed Jul 28, 2022
1 parent 5212ec7 commit cae1345
Show file tree
Hide file tree
Showing 8 changed files with 1,469 additions and 276 deletions.
7 changes: 5 additions & 2 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
## 1.7

### 1.7-beta-1
* Added base support for Fabric 1.19
* Added support for mod elements: advancement, armor, block, code, command, enchantment, function, game rule, gui, item, item extension, key bind, living entity, loot table, music disc, overlay, plant, potion, potion effect, procedure, ranged item, recipe, structure, tab, tag, tool
* Added base support for Fabric 1.19.1
* Added support for mod elements: advancement, armor, biome, block, code, command, enchantment, function, game rule, gui, item, item extension, key bind, living entity, loot table, music disc, overlay, plant, potion, potion effect, procedure, ranged item, recipe, structure, tab, tag, tool
* Added some minor features from 2022.2 snapshots
* [Bugfix] Add item to player's inventory caused a build error

Notes: 1.19 mappings will come after official data lists are updated. Biomes are far from being as in the 1.17.1 generator because I will now need to use TerraBlender to generate biomes in the overworld. Even if I support Nether and End gens, I can't apply surface rules currently and so, I will also need TerraBlender.
Dimensions are also not done because they changed once again between 1.18.2 and 1.19, and I didn't find how to port them.

## 1.6

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ localizationkeys:
- key: biome.@modid.@registryname
mapto: name

field_exclusions: [ treeVines, treeFruits ]
field_exclusions: [ groundBlock, undergroundBlock, underwaterBlock, treeVines, treeFruits ]
2 changes: 1 addition & 1 deletion src/fabric-1.19.1/generator.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Minecraft Fabric for 1.19.1 - @buildfileversion
status: dev
status: experimental
buildfileversion: 0.58.4
subversion: 1.5

Expand Down
1 change: 0 additions & 1 deletion src/fabric-1.19.1/mappings/biomedictionarytypes.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
_default: FOREST
VOID: VOID # Small Islands - End
RARE: RARE # Highlands - End
NETHER: NETHER
END: END
489 changes: 218 additions & 271 deletions src/fabric-1.19.1/templates/biome.java.ftl

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src/fabric-1.19.1/templates/elementinits/biomes.java.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
* MCreator note: This file will be REGENERATED on each build.
*/

<#include "../mcitems.ftl">

package ${package}.init;

public class ${JavaModName}Biomes {
Expand Down
34 changes: 34 additions & 0 deletions src/fabric-1.19.1/utils/biomeutils.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<#function temperature2temperature temperature biomeWeight, float_sfx="">
<#assign base = ((temperature + 1) / 3) * 2 - 1>
<#return (base - biomeWeight)?string + float_sfx + ", " + (base + biomeWeight)?string + float_sfx>
</#function>

<#function rainingPossibility2humidity rainingPossibility biomeWeight, float_sfx="">
<#assign base = (rainingPossibility * 2) - 1>
<#return (base - biomeWeight)?string + float_sfx + ", " + (base + biomeWeight)?string + float_sfx>
</#function>

<#function baseHeight2continentalness baseHeight biomeWeight, float_sfx="">
<#-- continentalness (low: oceans, high: inlands) -->
<#assign base = (baseHeight + 5) / 10.0>
<#return (base - biomeWeight)?string + float_sfx + ", " + (base + biomeWeight)?string + float_sfx>
</#function>

<#function heightVariation2erosion heightVariation biomeWeight, float_sfx="">
<#-- erosion (high: flat terrain) -->
<#assign base = 2 - heightVariation - 1>
<#return (base - biomeWeight)?string + float_sfx + ", " + (base + biomeWeight)?string + float_sfx>
</#function>

<#function registryname2weirdness registryname biomeWeight, float_sfx="">
<#assign base = (thelper.random(registryname) * 2) - 1>
<#return (base - biomeWeight)?string + float_sfx + ", " + (base + biomeWeight)?string + float_sfx>
</#function>

<#function normalizeWeight biomeWeight, float_sfx="">
<#return (biomeWeight / 70.0)>
</#function>

<#function normalizeWeightUnderground biomeWeight, float_sfx="">
<#return (biomeWeight / 10.0)>
</#function>
Loading

0 comments on commit cae1345

Please sign in to comment.