Skip to content

Commit

Permalink
Fix #355 + biomes
Browse files Browse the repository at this point in the history
  • Loading branch information
Goldorion committed Jan 6, 2023
1 parent a9d7cbe commit 0201f59
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 54 deletions.
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@

## 1.8.3
* [#365] Added chinese tooltips (Grey Wind)
* [Bugfix #355] Glowing music discs caused a build error
* [Bugfix #360] Fix particles import still being in the template (NerdyPuzzle)
* [Bugfix #368] Blocks could not be created
* [Bugfix] Custom biomes caused problems
* Note: End biomes use a hardcoded weight of 10 as no parameter can be used.

## 1.8.2
* Added support for MCreator EAP 2022.4.52117
Expand Down
5 changes: 2 additions & 3 deletions src/fabric-1.19.2/templates/biome/biome.java.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

<#-- @formatter:off -->
<#include "../mcitems.ftl">
<#include "../biomeutils.ftl">

<#assign hasConfiguredFeatures = false/>

Expand Down Expand Up @@ -316,9 +315,9 @@ public class ${name}Biome {
<#list generator.sortByMappings(data.defaultFeatures, "defaultfeatures") as defaultFeature>
<#assign mfeat = generator.map(defaultFeature, "defaultfeatures")>
<#if mfeat = "EndHighlands">
TheEndBiomes.addHighlandsBiome(${JavaModName}Biomes.${registryname?upper_case}, ${data.biomeWeight}d);
TheEndBiomes.addHighlandsBiome(${JavaModName}Biomes.${registryname?upper_case}, 10);
<#elseif mfeat = "EndIslands">
TheEndBiomes.addSmallIslandsBiome(${JavaModName}Biomes.${registryname?upper_case}, ${data.biomeWeight}d);
TheEndBiomes.addSmallIslandsBiome(${JavaModName}Biomes.${registryname?upper_case}, 10);
</#if>
</#list>
}
Expand Down
1 change: 0 additions & 1 deletion src/fabric-1.19.2/templates/biome/region.java.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

<#-- @formatter:off -->
<#include "../mcitems.ftl">
<#include "../biomeutils.ftl">

package ${package}.world.biome.regions;

Expand Down
98 changes: 48 additions & 50 deletions src/fabric-1.19.2/templates/json/dimension/multi_noise.json.ftl
Original file line number Diff line number Diff line change
@@ -1,59 +1,57 @@
<#-- @formatter:off -->

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

<#assign biomesmap = fp.file("utils/defaultbiomes.json")?eval_json/>

<#macro multiNoiseSource>
{
"type": "minecraft:multi_noise",
"biomes": [
<#list w.filterBrokenReferences(data.biomesInDimension) as biome>
{
"biome": "${biome}",
"parameters":
<#if data.biomesInDimension?size == 1>
{
"temperature": 0,
"humidity": 0,
"continentalness": 0,
"weirdness": 0,
"erosion": 0,
"depth": 0,
"offset": 0
}
<#else>
<#if biome.getUnmappedValue().startsWith("CUSTOM:")>
<#assign ge = w.getWorkspace().getModElementByName(biome.getUnmappedValue().replace("CUSTOM:", "")).getGeneratableElement()/>
{
"temperature": [${temperature2temperature(ge.temperature, normalizeWeight(ge.biomeWeight))}],
"humidity": [${rainingPossibility2humidity(ge.rainingPossibility, normalizeWeight(ge.biomeWeight))}],
"continentalness": [${baseHeight2continentalness(ge.baseHeight normalizeWeight(ge.biomeWeight))}],
"weirdness": [${registryname2weirdness(registryname normalizeWeight(ge.biomeWeight))}],
"erosion": [${heightVariation2erosion(ge.heightVariation normalizeWeight(ge.biomeWeight))}],
"depth": 0, <#-- 0 for surface biomes, 1 for cave biomes -->
"offset": 0
}
<#else>
<#if biomesmap["minecraft:" + biome.toString()]??>
${thelper.obj2str(biomesmap["minecraft:" + biome.toString()])}
<#else>
{
"temperature": 0,
"humidity": 0,
"continentalness": 0,
"weirdness": 0,
"erosion": 0,
"depth": 0,
"offset": 0
}
</#if>
</#if>
</#if>
}
<#if biome?has_next>,</#if>
</#list>
]
"type": "minecraft:multi_noise",
"biomes": [
<#list w.filterBrokenReferences(data.biomesInDimension) as biome>
{
"biome": "${biome}",
"parameters":
<#if data.biomesInDimension?size == 1>
{
"temperature": 0,
"humidity": 0,
"continentalness": 0,
"weirdness": 0,
"erosion": 0,
"depth": 0,
"offset": 0
}
<#else>
<#if biome.getUnmappedValue().startsWith("CUSTOM:")>
<#assign ge = w.getWorkspace().getModElementByName(biome.getUnmappedValue().replace("CUSTOM:", "")).getGeneratableElement()/>
{
"temperature": [${ge.genTemperature.min}, ${ge.genTemperature.max}],
"humidity": [${ge.genHumidity.min}, ${ge.genHumidity.max}],
"continentalness": [${ge.genContinentalness.min}, ${ge.genContinentalness.max}],
"weirdness": [${ge.genWeirdness.min}, ${ge.genWeirdness.max}],
"erosion": [${ge.genErosion.min}, ${ge.genErosion.max}],
"depth": 0, <#-- 0 for surface biomes, 1 for cave biomes -->
"offset": 0
}
<#else>
<#if biomesmap["minecraft:" + biome.toString()]??>
${thelper.obj2str(biomesmap["minecraft:" + biome.toString()])}
<#else>
{
"temperature": 0,
"humidity": 0,
"continentalness": 0,
"weirdness": 0,
"erosion": 0,
"depth": 0,
"offset": 0
}
</#if>
</#if>
</#if>
}
<#if biome?has_next>,</#if>
</#list>
]
}
</#macro>
<#-- @formatter:on -->
1 change: 1 addition & 0 deletions src/fabric-1.19.2/templates/musicdisc.java.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
package ${package}.item;

import net.minecraft.network.chat.Component;
import net.fabricmc.api.Environment;

public class ${name}Item extends RecordItem {

Expand Down

0 comments on commit 0201f59

Please sign in to comment.