diff --git a/changelog.md b/changelog.md
index a0879e29..ec8e7daa 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,5 +1,11 @@
# Changelogs:
+## 1.10
+(Thank you NerdyPuzzle)
+* [#520] Removed support for TerraBlender API (biome generation is now done similarly to Forge generators)
+* [#417, #520] Add support for cave biomes
+* [#521, #520] Custom items caused a build error in several cases
+
## 1.9.14
* [Bugfix] Items could not be registered and could cause a build error
diff --git a/src/apis/terrablender.yaml b/src/apis/terrablender.yaml
deleted file mode 100644
index 19be705b..00000000
--- a/src/apis/terrablender.yaml
+++ /dev/null
@@ -1,12 +0,0 @@
-fabric-1.20.1:
- gradle: |
- repositories {
- maven {
- url = "https://maven.minecraftforge.net/"
- }
- }
- dependencies {
- modImplementation 'com.github.glitchfiend:TerraBlender-fabric:1.20.1-3.0.0.165'
- }
-
-name: "TerraBlender (Fabric - Biomes)"
\ No newline at end of file
diff --git a/src/fabric-1.20.1/biome.definition.yaml b/src/fabric-1.20.1/biome.definition.yaml
index 2ac97e31..92161099 100644
--- a/src/fabric-1.20.1/biome.definition.yaml
+++ b/src/fabric-1.20.1/biome.definition.yaml
@@ -11,14 +11,6 @@ templates:
condition: hasTrees()
name: "@MODDATAROOT/worldgen/placed_feature/@registryname_tree.json"
- # TerraBlender
- - template: biome/region.java.ftl
- name: "@SRCROOT/@BASEPACKAGEPATH/world/biome/regions/@NAMERegion.java"
- condition_any:
- - spawnBiome
- - spawnInCaves
- - spawnBiomeNether
-
global_templates:
- template: elementinits/biomes.java.ftl
name: "@SRCROOT/@BASEPACKAGEPATH/init/@JavaModNameBiomes.java"
@@ -210,12 +202,16 @@ global_templates:
name: "@RESROOT/data/minecraft/tags/worldgen/biome/has_structure/ruined_portal_nether.json"
hidden: true
- # TerraBlender
+ # Surface rules
- template: elementinits/surfacerules.java.ftl
name: "@SRCROOT/@BASEPACKAGEPATH/init/@JavaModNameSurfaceRules.java"
+ # Mixins
+ - template: mixins/surfaceruleaccessormixin.java.ftl
+ name: "@SRCROOT/@BASEPACKAGEPATH/mixins/NoiseGeneratorSettingsAccess.java"
+
localizationkeys:
- key: biome.@modid.@registryname
mapto: name
-field_exclusions: [ spawnInCaves, treeVines, treeFruits ]
\ No newline at end of file
+field_exclusions: [ treeVines, treeFruits ]
\ No newline at end of file
diff --git a/src/fabric-1.20.1/generator.yaml b/src/fabric-1.20.1/generator.yaml
index 11f8699f..9d6ea80c 100644
--- a/src/fabric-1.20.1/generator.yaml
+++ b/src/fabric-1.20.1/generator.yaml
@@ -1,7 +1,7 @@
name: Minecraft Fabric for @minecraft - @buildfileversion
status: experimental
buildfileversion: 0.83.1
-subversion: 24
+subversion: 25
import:
- datapack-1.20.1
@@ -72,16 +72,15 @@ base_templates:
- template: elementinits/sounds.java.ftl
name: "@SRCROOT/@BASEPACKAGEPATH/init/@JavaModNameSounds.java"
condition: hasSounds()
-- template: modbase/terrablender.java.ftl
- name: "@SRCROOT/@BASEPACKAGEPATH/TerraBlenderInit.java"
- canLock: true
- condition: ${settings.getMCreatorDependenciesRaw()?seq_contains("terrablender")}
- deleteWhenConditionFalse: true
+- template: modbase/.accesswidener.ftl
+ writer: file
+ name: "@RESROOT/@modid.accesswidener"
- template: modbase/mixins.json.ftl
writer: file
name: "@RESROOT/@modid.mixins.json"
- condition: ${w.hasElementsOfBaseType("item")}
- deleteWhenConditionFalse: true
+ condition_any:
+ - ${w.hasElementsOfBaseType("item")}
+ - ${w.hasElementsOfType("biome")}
sources_setup_tasks:
- task: copy_models
diff --git a/src/fabric-1.20.1/templates/biome/region.java.ftl b/src/fabric-1.20.1/templates/biome/region.java.ftl
deleted file mode 100644
index d3e521da..00000000
--- a/src/fabric-1.20.1/templates/biome/region.java.ftl
+++ /dev/null
@@ -1,75 +0,0 @@
-<#--
- # This file is part of Fabric-Generator-MCreator.
- # Copyright (C) 2020-2023, Goldorion, opensource contributors
- #
- # Fabric-Generator-MCreator is free software: you can redistribute it and/or modify
- # it under the terms of the GNU Lesser General Public License as published by
- # the Free Software Foundation, either version 3 of the License, or
- # (at your option) any later version.
-
- # Fabric-Generator-MCreator is distributed in the hope that it will be useful,
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- # GNU Lesser General Public License for more details.
- #
- # You should have received a copy of the GNU Lesser General Public License
- # along with Fabric-Generator-MCreator. If not, see .
--->
-
-<#-- @formatter:off -->
-<#include "../mcitems.ftl">
-
-package ${package}.world.biome.regions;
-
-import com.mojang.datafixers.util.Pair;
-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.Climate;
-import terrablender.api.ParameterUtils;
-import terrablender.api.Region;
-import terrablender.api.RegionType;
-
-public class ${name}Region extends Region {
-
- <#if data.spawnBiome || data.spawnBiomeNether>
- public static final Climate.ParameterPoint PARAMETER_POINTS = new Climate.ParameterPoint(
- Climate.Parameter.span(${data.genTemperature.min}f, ${data.genTemperature.max}f),
- Climate.Parameter.span(${data.genHumidity.min}f, ${data.genHumidity.max}f),
- Climate.Parameter.span(${data.genContinentalness.min}f, ${data.genContinentalness.max}f),
- Climate.Parameter.span(${data.genErosion.min}f, ${data.genErosion.max}f),
- Climate.Parameter.point(0.0f),
- Climate.Parameter.span(${data.genWeirdness.min}f, ${data.genWeirdness.max}f),
- 0 <#-- offset -->
- );
- #if>
-
- <#if data.spawnInCaves>
- public static final Climate.ParameterPoint UNDERGROUND_PARAMETER_POINTS = new Climate.ParameterPoint(
- Climate.Parameter.span(${data.genTemperature.min}f, ${data.genTemperature.max}f),
- Climate.Parameter.span(${data.genHumidity.min}f, ${data.genHumidity.max}f),
- Climate.Parameter.span(${data.genContinentalness.min}f, ${data.genContinentalness.max}f),
- Climate.Parameter.span(${data.genErosion.min}f, ${data.genErosion.max}f),
- Climate.Parameter.span(0.2f, 0.9f),
- Climate.Parameter.span(${data.genWeirdness.min}f, ${data.genWeirdness.max}f),
- 0 <#-- offset -->
- )
- );
- #if>
-
- public ${name}Region(ResourceLocation name) {
- super(name, <#if data.spawnBiome || data.spawnInCaves>RegionType.OVERWORLD<#elseif data.spawnBiomeNether>RegionType.NETHER#if>, 2);
- }
-
- @Override
- public void addBiomes(Registry registry, Consumer>> mapper) {
- <#if data.spawnBiome || data.spawnBiomeNether>
- this.addBiome(mapper, PARAMETER_POINTS, ${JavaModName}Biomes.${data.getModElement().getRegistryNameUpper()});
- <#elseif data.spawnInCaves>
- this.addBiome(mapper, UNDERGROUND_PARAMETER_POINTS, ${JavaModName}Biomes.${data.getModElement().getRegistryNameUpper()});
- #if>
- }
-
-}
-<#-- @formatter:on -->
\ No newline at end of file
diff --git a/src/fabric-1.20.1/templates/elementinits/biomes.java.ftl b/src/fabric-1.20.1/templates/elementinits/biomes.java.ftl
index fd25a84d..cdd1e29c 100644
--- a/src/fabric-1.20.1/templates/elementinits/biomes.java.ftl
+++ b/src/fabric-1.20.1/templates/elementinits/biomes.java.ftl
@@ -25,12 +25,16 @@
<#include "../mcitems.ftl">
<#assign spawn_overworld = []>
+<#assign spawn_overworld_caves = []>
<#assign spawn_nether = []>
<#list biomes as biome>
<#if biome.spawnBiome>
<#assign spawn_overworld += [biome]>
#if>
+ <#if biome.spawnInCaves>
+ <#assign spawn_overworld_caves += [biome]>
+ #if>
<#if biome.spawnBiomeNether>
<#assign spawn_nether += [biome]>
#if>
@@ -38,8 +42,7 @@
package ${package}.init;
-import terrablender.api.Regions;
-import terrablender.api.SurfaceRuleManager;
+import com.mojang.datafixers.util.Pair;
public class ${JavaModName}Biomes {
@@ -48,7 +51,7 @@ public class ${JavaModName}Biomes {
new ResourceLocation(${JavaModName}.MODID, "${biome.getModElement().getRegistryName()}"));
#list>
- public static void load() {
+ public static void loadEndBiomes() {
<#list biomes as me>
<#assign biome = me.getModElement().getGeneratableElement()>
<#list generator.sortByMappings(biome.defaultFeatures, "defaultfeatures") as defaultFeature>
@@ -61,20 +64,129 @@ public class ${JavaModName}Biomes {
#list>
}
- public static void loadTerraBlenderAPI() {
- <#list biomes as biome>
- <#if biome.spawnBiome || biome.spawnBiomeNether>
- Regions.register(new ${biome.getModElement().getName()}Region(new ResourceLocation(${JavaModName}.MODID, "${biome.getModElement().getRegistryName()}")));
+ public static void load(MinecraftServer server) {
+ Registry dimensionTypeRegistry = server.registryAccess().registryOrThrow(Registries.DIMENSION_TYPE);
+ Registry levelStemTypeRegistry = server.registryAccess().registryOrThrow(Registries.LEVEL_STEM);
+ Registry biomeRegistry = server.registryAccess().registryOrThrow(Registries.BIOME);
+
+ for (LevelStem levelStem : levelStemTypeRegistry.stream().toList()) {
+ DimensionType dimensionType = levelStem.type().value();
+
+ <#if spawn_overworld?has_content || spawn_overworld_caves?has_content>
+ if(dimensionType == dimensionTypeRegistry.getOrThrow(BuiltinDimensionTypes.OVERWORLD)) {
+ ChunkGenerator chunkGenerator = levelStem.generator();
+
+ // Inject biomes to biome source
+ if(chunkGenerator.getBiomeSource() instanceof MultiNoiseBiomeSource noiseSource) {
+ List>> parameters = new ArrayList<>(noiseSource.parameters().values());
+
+ <#list spawn_overworld as biome>
+ parameters.add(new Pair<>(
+ new Climate.ParameterPoint(
+ Climate.Parameter.span(${biome.genTemperature.min}f, ${biome.genTemperature.max}f),
+ Climate.Parameter.span(${biome.genHumidity.min}f, ${biome.genHumidity.max}f),
+ Climate.Parameter.span(${biome.genContinentalness.min}f, ${biome.genContinentalness.max}f),
+ Climate.Parameter.span(${biome.genErosion.min}f, ${biome.genErosion.max}f),
+ Climate.Parameter.point(0.0f),
+ Climate.Parameter.span(${biome.genWeirdness.min}f, ${biome.genWeirdness.max}f),
+ 0 <#-- offset -->
+ ),
+ biomeRegistry.getHolderOrThrow(ResourceKey.create(Registries.BIOME, new ResourceLocation("${modid}", "${biome.getModElement().getRegistryName()}")))
+ ));
+ parameters.add(new Pair<>(
+ new Climate.ParameterPoint(
+ Climate.Parameter.span(${biome.genTemperature.min}f, ${biome.genTemperature.max}f),
+ Climate.Parameter.span(${biome.genHumidity.min}f, ${biome.genHumidity.max}f),
+ Climate.Parameter.span(${biome.genContinentalness.min}f, ${biome.genContinentalness.max}f),
+ Climate.Parameter.span(${biome.genErosion.min}f, ${biome.genErosion.max}f),
+ Climate.Parameter.point(1.0f),
+ Climate.Parameter.span(${biome.genWeirdness.min}f, ${biome.genWeirdness.max}f),
+ 0 <#-- offset -->
+ ),
+ biomeRegistry.getHolderOrThrow(ResourceKey.create(Registries.BIOME, new ResourceLocation("${modid}", "${biome.getModElement().getRegistryName()}")))
+ ));
+ #list>
+
+ <#list spawn_overworld_caves as biome>
+ parameters.add(new Pair<>(
+ new Climate.ParameterPoint(
+ Climate.Parameter.span(${biome.genTemperature.min}f, ${biome.genTemperature.max}f),
+ Climate.Parameter.span(${biome.genHumidity.min}f, ${biome.genHumidity.max}f),
+ Climate.Parameter.span(${biome.genContinentalness.min}f, ${biome.genContinentalness.max}f),
+ Climate.Parameter.span(${biome.genErosion.min}f, ${biome.genErosion.max}f),
+ Climate.Parameter.span(0.2f, 0.9f),
+ Climate.Parameter.span(${biome.genWeirdness.min}f, ${biome.genWeirdness.max}f),
+ 0 <#-- offset -->
+ ),
+ biomeRegistry.getHolderOrThrow(ResourceKey.create(Registries.BIOME, new ResourceLocation("${modid}", "${biome.getModElement().getRegistryName()}")))
+ ));
+ #list>
+
+ chunkGenerator.biomeSource = MultiNoiseBiomeSource.createFromList(new Climate.ParameterList<>(parameters));
+ chunkGenerator.featuresPerStep = Suppliers.memoize(() ->
+ FeatureSorter.buildFeaturesPerStep(List.copyOf(chunkGenerator.biomeSource.possibleBiomes()), biome ->
+ chunkGenerator.generationSettingsGetter.apply(biome).features(), true));
+ }
+
+ // Inject surface rules
+ if(chunkGenerator instanceof NoiseBasedChunkGenerator noiseGenerator) {
+ NoiseGeneratorSettings noiseGeneratorSettings = noiseGenerator.settings.value();
+ ((NoiseGeneratorSettingsAccess)(Object)noiseGeneratorSettings).addSurfaceRules(SurfaceRules.sequence(
+ ${JavaModName}SurfaceRules.makeOverworldRules(), noiseGeneratorSettings.surfaceRule()));
+ }
+ }
#if>
- #list>
-
- <#if spawn_overworld?has_content>
- SurfaceRuleManager.addSurfaceRules(SurfaceRuleManager.RuleCategory.OVERWORLD, ${JavaModName}.MODID, ${JavaModName}SurfaceRules.makeOverworldRules());
- #if>
-
- <#if spawn_nether?has_content>
- SurfaceRuleManager.addSurfaceRules(SurfaceRuleManager.RuleCategory.NETHER, ${JavaModName}.MODID, ${JavaModName}SurfaceRules.makeNetherRules());
- #if>
+
+ <#if spawn_nether?has_content>
+ if(dimensionType == dimensionTypeRegistry.getOrThrow(BuiltinDimensionTypes.NETHER)) {
+ ChunkGenerator chunkGenerator = levelStem.generator();
+
+ // Inject biomes to biome source
+ if(chunkGenerator.getBiomeSource() instanceof MultiNoiseBiomeSource noiseSource) {
+ List>> parameters = new ArrayList<>(noiseSource.parameters().values());
+
+ <#list spawn_nether as biome>
+ parameters.add(new Pair<>(
+ new Climate.ParameterPoint(
+ Climate.Parameter.span(${biome.genTemperature.min}f, ${biome.genTemperature.max}f),
+ Climate.Parameter.span(${biome.genHumidity.min}f, ${biome.genHumidity.max}f),
+ Climate.Parameter.span(${biome.genContinentalness.min}f, ${biome.genContinentalness.max}f),
+ Climate.Parameter.span(${biome.genErosion.min}f, ${biome.genErosion.max}f),
+ Climate.Parameter.point(0.0f),
+ Climate.Parameter.span(${biome.genWeirdness.min}f, ${biome.genWeirdness.max}f),
+ 0 <#-- offset -->
+ ),
+ biomeRegistry.getHolderOrThrow(ResourceKey.create(Registries.BIOME, new ResourceLocation("${modid}", "${biome.getModElement().getRegistryName()}")))
+ ));
+ parameters.add(new Pair<>(
+ new Climate.ParameterPoint(
+ Climate.Parameter.span(${biome.genTemperature.min}f, ${biome.genTemperature.max}f),
+ Climate.Parameter.span(${biome.genHumidity.min}f, ${biome.genHumidity.max}f),
+ Climate.Parameter.span(${biome.genContinentalness.min}f, ${biome.genContinentalness.max}f),
+ Climate.Parameter.span(${biome.genErosion.min}f, ${biome.genErosion.max}f),
+ Climate.Parameter.point(1.0f),
+ Climate.Parameter.span(${biome.genWeirdness.min}f, ${biome.genWeirdness.max}f),
+ 0 <#-- offset -->
+ ),
+ biomeRegistry.getHolderOrThrow(ResourceKey.create(Registries.BIOME, new ResourceLocation("${modid}", "${biome.getModElement().getRegistryName()}")))
+ ));
+ #list>
+
+ chunkGenerator.biomeSource = MultiNoiseBiomeSource.createFromList(new Climate.ParameterList<>(parameters));
+ chunkGenerator.featuresPerStep = Suppliers.memoize(() ->
+ FeatureSorter.buildFeaturesPerStep(List.copyOf(chunkGenerator.biomeSource.possibleBiomes()), biome ->
+ chunkGenerator.generationSettingsGetter.apply(biome).features(), true));
+ }
+
+ // Inject surface rules
+ if(chunkGenerator instanceof NoiseBasedChunkGenerator noiseGenerator) {
+ NoiseGeneratorSettings noiseGeneratorSettings = noiseGenerator.settings.value();
+ ((NoiseGeneratorSettingsAccess)(Object)noiseGeneratorSettings).addSurfaceRules(SurfaceRules.sequence(
+ ${JavaModName}SurfaceRules.makeNetherRules(), noiseGeneratorSettings.surfaceRule()));
+ }
+ }
+ #if>
+ }
}
}
diff --git a/src/fabric-1.20.1/templates/elementinits/items.java.ftl b/src/fabric-1.20.1/templates/elementinits/items.java.ftl
index 30a8eaf5..ddb36538 100644
--- a/src/fabric-1.20.1/templates/elementinits/items.java.ftl
+++ b/src/fabric-1.20.1/templates/elementinits/items.java.ftl
@@ -119,7 +119,7 @@ public class ${JavaModName}Items {
}
private static void registerBlockingProperty(Item item) {
- ItemProperties.register(item, new ResourceLocation("blocking"), ItemProperties.getProperty(Items.SHIELD, new ResourceLocation("blocking")));
+ ItemProperties.register(item, new ResourceLocation("blocking"), (ClampedItemPropertyFunction) ItemProperties.getProperty(Items.SHIELD, new ResourceLocation("blocking")));
}
}
diff --git a/src/fabric-1.20.1/templates/elementinits/surfacerules.java.ftl b/src/fabric-1.20.1/templates/elementinits/surfacerules.java.ftl
index 6a7f89e4..b7670ddb 100644
--- a/src/fabric-1.20.1/templates/elementinits/surfacerules.java.ftl
+++ b/src/fabric-1.20.1/templates/elementinits/surfacerules.java.ftl
@@ -107,7 +107,7 @@ public class ${JavaModName}SurfaceRules {
}
#if>
- <#if spawn_nether?has_content || spawn_overworld_caves?has_content>
+ <#if spawn_nether?has_content || spawn_caves?has_content>
private static SurfaceRules.RuleSource anySurfaceRule(ResourceKey biomeKey, BlockState groundBlock, BlockState undergroundBlock, BlockState underwaterBlock) {
return SurfaceRules.ifTrue(SurfaceRules.isBiome(biomeKey),
SurfaceRules.sequence(
diff --git a/src/fabric-1.20.1/templates/modbase/terrablender.java.ftl b/src/fabric-1.20.1/templates/mixins/surfaceruleaccessormixin.java.ftl
similarity index 50%
rename from src/fabric-1.20.1/templates/modbase/terrablender.java.ftl
rename to src/fabric-1.20.1/templates/mixins/surfaceruleaccessormixin.java.ftl
index 4ee80cc5..679b62dd 100644
--- a/src/fabric-1.20.1/templates/modbase/terrablender.java.ftl
+++ b/src/fabric-1.20.1/templates/mixins/surfaceruleaccessormixin.java.ftl
@@ -1,6 +1,6 @@
<#--
# This file is part of Fabric-Generator-MCreator.
- # Copyright (C) 2020-2023, Goldorion, opensource contributors
+ # Copyright (C) 2020-2024, Goldorion, opensource contributors
#
# Fabric-Generator-MCreator is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
@@ -15,34 +15,14 @@
# You should have received a copy of the GNU Lesser General Public License
# along with Fabric-Generator-MCreator. If not, see .
-->
+package ${package}.mixins;
-<#-- @formatter:off -->
-<#compress>
-/*
-* 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.
-*
-*/
+import org.spongepowered.asm.mixin.gen.Accessor;
+import org.spongepowered.asm.mixin.Mutable;
-package ${package};
+@Mixin (NoiseGeneratorSettings.class)
+public interface NoiseGeneratorSettingsAccess {
-import terrablender.api.TerraBlenderApi;
-
-public class TerraBlenderInit implements TerraBlenderApi {
-
- @Override
- public void onTerraBlenderInitialized() {
- <#if w.hasElementsOfType("biome")>
- ${JavaModName}Biomes.loadTerraBlenderAPI();
- #if>
- }
-}
-#compress>
-<#-- @formatter:on -->
+ @Accessor("surfaceRule") @Mutable
+ void addSurfaceRules(SurfaceRules.RuleSource ruleSource);
+}
\ No newline at end of file
diff --git a/src/fabric-1.20.1/templates/modbase/.accesswidener.ftl b/src/fabric-1.20.1/templates/modbase/.accesswidener.ftl
new file mode 100644
index 00000000..c2a4c519
--- /dev/null
+++ b/src/fabric-1.20.1/templates/modbase/.accesswidener.ftl
@@ -0,0 +1,12 @@
+accessWidener v1 named
+
+<#if w.hasElementsOfType("biome")>
+accessible method net/minecraft/world/level/biome/MultiNoiseBiomeSource parameters ()Lnet/minecraft/world/level/biome/Climate$ParameterList;
+accessible field net/minecraft/world/level/chunk/ChunkGenerator biomeSource Lnet/minecraft/world/level/biome/BiomeSource;
+accessible field net/minecraft/world/level/chunk/ChunkGenerator featuresPerStep Ljava/util/function/Supplier;
+mutable field net/minecraft/world/level/chunk/ChunkGenerator biomeSource Lnet/minecraft/world/level/biome/BiomeSource;
+mutable field net/minecraft/world/level/chunk/ChunkGenerator featuresPerStep Ljava/util/function/Supplier;
+accessible field net/minecraft/world/level/chunk/ChunkGenerator generationSettingsGetter Ljava/util/function/Function;
+accessible field net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator settings Lnet/minecraft/core/Holder;
+mutable field net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator settings Lnet/minecraft/core/Holder;
+#if>
\ No newline at end of file
diff --git a/src/fabric-1.20.1/templates/modbase/fabric.mod.json.ftl b/src/fabric-1.20.1/templates/modbase/fabric.mod.json.ftl
index 70d15469..58607287 100644
--- a/src/fabric-1.20.1/templates/modbase/fabric.mod.json.ftl
+++ b/src/fabric-1.20.1/templates/modbase/fabric.mod.json.ftl
@@ -21,7 +21,7 @@
<#if settings.getModPicture()?has_content>
"icon": "assets/${modid}/icon.png",
#if>
-
+ "accessWidener": "${modid}.accesswidener",
"environment": "*",
"entrypoints": {
"main": [
@@ -29,10 +29,7 @@
],
"client":[
"${package}.ClientInit"
- ]<#if settings.getMCreatorDependenciesRaw()?seq_contains("terrablender")>,
- "terrablender":[
- "${package}.TerraBlenderInit"
- ]#if>
+ ]
},
"depends": {
@@ -40,7 +37,7 @@
"fabric": "*",
"minecraft": "~1.20",
"java": ">=17"
- }<#if w.hasElementsOfBaseType("item")>,
+ }<#if w.hasElementsOfBaseType("item") || w.hasElementsOfType("biome")>,
"mixins": [
"${settings.getModID()}.mixins.json"
]#if>
diff --git a/src/fabric-1.20.1/templates/modbase/mixins.json.ftl b/src/fabric-1.20.1/templates/modbase/mixins.json.ftl
index 09dbc125..2ba7a7d9 100644
--- a/src/fabric-1.20.1/templates/modbase/mixins.json.ftl
+++ b/src/fabric-1.20.1/templates/modbase/mixins.json.ftl
@@ -1,16 +1,26 @@
+<#assign mixins = []>
+<#if w.hasElementsOfBaseType("item")>
+ <#assign mixins += ["${JavaModName}RepairItemRecipeMixin"]>
+#if>
+<#if w.getGElementsOfType('tool')?filter(e -> e.toolType = 'Fishing rod')?size != 0>
+ <#assign mixins += ["${JavaModName}FishingHookMixin"]>
+ <#assign mixins += ["${JavaModName}FishingHookRendererMixin"]>
+ <#assign mixins += ["EntityMixin"]>
+#if>
+<#if w.hasElementsOfType("biome")>
+ <#assign mixins += ["NoiseGeneratorSettingsAccess"]>
+#if>
{
"required": true,
"minVersion": "0.8",
"package": "${package}.mixins",
"compatibilityLevel": "JAVA_17",
"mixins": [
- "${settings.getJavaModName()}RepairItemRecipeMixin"<#if w.getGElementsOfType('tool')?filter(e -> e.toolType = 'Fishing rod')?size != 0>,
- "${settings.getJavaModName()}FishingHookMixin",
- "${settings.getJavaModName()}FishingHookRendererMixin",
- "EntityMixin"
- #if>
+ <#list mixins as mixin>
+ "${mixin}"<#sep>,
+ #list>
],
"injectors": {
- "defaultRequire": 1
+ "defaultRequire": 1
}
}
\ No newline at end of file
diff --git a/src/fabric-1.20.1/templates/modbase/mod.java.ftl b/src/fabric-1.20.1/templates/modbase/mod.java.ftl
index 7b51e5d3..0e88e1ed 100644
--- a/src/fabric-1.20.1/templates/modbase/mod.java.ftl
+++ b/src/fabric-1.20.1/templates/modbase/mod.java.ftl
@@ -56,7 +56,6 @@ public class ${JavaModName} implements ModInitializer {
<#if w.hasElementsOfBaseType("block")>${JavaModName}Blocks.load();#if>
<#if w.hasElementsOfBaseType("item")>${JavaModName}Items.load();#if>
<#if w.hasElementsOfBaseType("blockentity")>${JavaModName}BlockEntities.load();#if>
- <#if w.hasElementsOfType("biome")>${JavaModName}Biomes.load();#if>
<#if w.hasElementsOfBaseType("feature")>${JavaModName}Features.load();#if>
<#if w.hasElementsOfType("painting")>${JavaModName}Paintings.load();#if>
<#if w.hasElementsOfType("procedure")>${JavaModName}Procedures.load();#if>
@@ -69,6 +68,13 @@ public class ${JavaModName} implements ModInitializer {
<#if w.hasSounds()>${JavaModName}Sounds.load();#if>
<#if w.hasVariablesOfScope("GLOBAL_WORLD") || w.hasVariablesOfScope("GLOBAL_MAP")>${JavaModName}Variables.SyncJoin();#if>
<#if w.hasVariablesOfScope("GLOBAL_WORLD") || w.hasVariablesOfScope("GLOBAL_MAP")>${JavaModName}Variables.SyncChangeWorld();#if>
+
+ <#if w.hasElementsOfType("biome")>
+ ${JavaModName}Biomes.loadEndBiomes();
+ ServerLifecycleEvents.SERVER_STARTING.register((server) -> {
+ ${JavaModName}Biomes.load(server);
+ });
+ #if>
}
}
<#-- @formatter:on -->
diff --git a/src/fabric-1.20.1/workspacebase/build.gradle b/src/fabric-1.20.1/workspacebase/build.gradle
index 80ec9d30..287adf23 100644
--- a/src/fabric-1.20.1/workspacebase/build.gradle
+++ b/src/fabric-1.20.1/workspacebase/build.gradle
@@ -14,6 +14,8 @@ loom {
mixin {
defaultRefmapName = actualmodid + ".refmap.json"
}
+ if (file("src/main/resources/${modid}.accesswidener").exists())
+ accessWidenerPath = file("src/main/resources/${modid}.accesswidener")
}
dependencies {
@@ -48,10 +50,4 @@ jar {
from "LICENSE"
}
-loom {
- mixin {
- defaultRefmapName = actualmodid + ".refmap.json"
- }
-}
-
apply from: 'mcreator.gradle'
\ No newline at end of file