Skip to content

Commit

Permalink
Update to 24w07a.
Browse files Browse the repository at this point in the history
- Update to 24w07a
* Rewrite datagen yet again
* Update Loom and Gradle
* Update Biolith and Terraform API
* Update GitHub workflows
  • Loading branch information
gniftygnome committed Feb 25, 2024
1 parent 736550e commit cbe5b03
Show file tree
Hide file tree
Showing 22 changed files with 252 additions and 193 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/check_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
uses: gradle/wrapper-validation-action@v2
- name: Setup JDK ${{ matrix.java }}
uses: actions/setup-java@v1
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: ${{ matrix.java }}
- name: Make Gradle wrapper executable
if: ${{ runner.os != 'Windows' }}
Expand All @@ -36,7 +37,7 @@ jobs:
run: ./gradlew build --stacktrace -x runDatagen
- name: Capture build artifacts
if: ${{ runner.os == 'Linux' && matrix.java == '17' }} # Only upload artifacts built from LTS java on one OS
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: Artifacts
path: build/libs/
13 changes: 7 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Create version tag
uses: actions/github-script@v3
uses: actions/github-script@v7
with:
github-token: ${{ github.token }}
script: |
github.git.createRef({
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "refs/tags/v${{ github.event.inputs.version }}",
Expand All @@ -36,10 +36,11 @@ jobs:
- name: Fetch tags
run: git fetch --tags
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
uses: gradle/wrapper-validation-action@v2
- name: Setup JDK ${{ matrix.java }}
uses: actions/setup-java@v1
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: ${{ matrix.java }}
- name: Make Gradle wrapper executable
if: ${{ runner.os != 'Windows' }}
Expand All @@ -58,7 +59,7 @@ jobs:
DISCORD_ANNOUNCEMENT_WEBHOOK: ${{ secrets.DISCORD_ANNOUNCEMENT_WEBHOOK }}
- name: Capture build artifacts
if: ${{ runner.os == 'Linux' && matrix.java == '17' }} # Only upload artifacts built from LTS java on one OS
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: Artifacts
path: build/libs/
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
id 'maven-publish'
id 'idea'
id 'eclipse'
id 'fabric-loom' version '1.4.+'
id 'fabric-loom' version '1.5.+'
}

apply from: 'https://raw.githubusercontent.com/TerraformersMC/GradleScripts/2.6/ferry.gradle'
Expand Down
6 changes: 3 additions & 3 deletions common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ archivesBaseName = "traverse-common"
loom {
runs {
datagen {
server()
inherit server

name = "Data Generation"
runDir = "build/datagen"

vmArg("-Dfabric-api.datagen")
vmArg("-Dfabric-api.datagen.output-dir=${file("src/main/generated")}")
vmArg "-Dfabric-api.datagen"
vmArg "-Dfabric-api.datagen.output-dir=${file("src/main/generated")}"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
package com.terraformersmc.traverse;

import com.terraformersmc.traverse.biome.TraverseBiomes;
import com.terraformersmc.traverse.block.TraverseBlocks;
import com.terraformersmc.traverse.config.TraverseConfigManager;
import com.terraformersmc.traverse.feature.TraverseConfiguredFeatures;
import com.terraformersmc.traverse.feature.TraversePlacedFeatures;
import com.terraformersmc.traverse.feature.placer.TraversePlacerTypes;
import com.terraformersmc.traverse.init.TraverseTrades;
import com.terraformersmc.traverse.item.TraverseBoatTypes;
Expand All @@ -31,9 +28,6 @@ private static void register() {
TraverseBlocks.register();
TraverseItems.register();
TraverseBoatTypes.register();
TraverseConfiguredFeatures.register();
TraversePlacedFeatures.register();
TraverseBiomes.register();
TraverseTrades.register();
TraverseVillagerTypes.register();
TraversePlacerTypes.register();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
package com.terraformersmc.traverse.biome;

import com.terraformersmc.traverse.feature.TraversePlacedFeatures;
import net.fabricmc.fabric.api.datagen.v1.provider.FabricDynamicRegistryProvider;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.SpawnGroup;
import net.minecraft.registry.Registerable;
import net.minecraft.registry.RegistryEntryLookup;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.GenerationSettings;
import net.minecraft.world.biome.SpawnSettings;
import net.minecraft.world.gen.GenerationStep;
import net.minecraft.world.gen.carver.ConfiguredCarver;
import net.minecraft.world.gen.feature.DefaultBiomeFeatures;
import net.minecraft.world.gen.feature.PlacedFeature;

import static com.terraformersmc.traverse.biome.TraverseBiomes.addBasicFeatures;

public class AutumnalWoodsBiomes {
public static Biome create(FabricDynamicRegistryProvider.Entries entries) {
public static Biome create(Registerable<Biome> registerable) {
return new Biome.Builder()
.generationSettings(createGenerationSettings(entries))
.generationSettings(createGenerationSettings(registerable))
.spawnSettings(createSpawnSettings())
.precipitation(true)
.temperature(0.8F)
Expand All @@ -28,12 +32,15 @@ public static Biome create(FabricDynamicRegistryProvider.Entries entries) {
.build();
}

private static GenerationSettings createGenerationSettings(FabricDynamicRegistryProvider.Entries entries) {
GenerationSettings.LookupBackedBuilder builder = new GenerationSettings.LookupBackedBuilder(entries.placedFeatures(), entries.configuredCarvers());
private static GenerationSettings createGenerationSettings(Registerable<Biome> registerable) {
RegistryEntryLookup<ConfiguredCarver<?>> configuredCarvers = registerable.getRegistryLookup(RegistryKeys.CONFIGURED_CARVER);
RegistryEntryLookup<PlacedFeature> placedFeatures = registerable.getRegistryLookup(RegistryKeys.PLACED_FEATURE);

GenerationSettings.LookupBackedBuilder builder = new GenerationSettings.LookupBackedBuilder(placedFeatures, configuredCarvers);
addBasicFeatures(builder);
DefaultBiomeFeatures.addDefaultOres(builder);
DefaultBiomeFeatures.addDefaultDisks(builder);
builder.feature(GenerationStep.Feature.VEGETAL_DECORATION, entries.ref(TraversePlacedFeatures.AUTUMNAL_TREES));
builder.feature(GenerationStep.Feature.VEGETAL_DECORATION, placedFeatures.getOrThrow(TraversePlacedFeatures.AUTUMNAL_TREES));
DefaultBiomeFeatures.addForestFlowers(builder);
DefaultBiomeFeatures.addDefaultFlowers(builder);
DefaultBiomeFeatures.addForestGrass(builder);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
package com.terraformersmc.traverse.biome;

import com.terraformersmc.traverse.feature.TraversePlacedFeatures;
import net.fabricmc.fabric.api.datagen.v1.provider.FabricDynamicRegistryProvider;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.SpawnGroup;
import net.minecraft.registry.Registerable;
import net.minecraft.registry.RegistryEntryLookup;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.GenerationSettings;
import net.minecraft.world.biome.SpawnSettings;
import net.minecraft.world.gen.GenerationStep;
import net.minecraft.world.gen.carver.ConfiguredCarver;
import net.minecraft.world.gen.feature.DefaultBiomeFeatures;
import net.minecraft.world.gen.feature.PlacedFeature;

import static com.terraformersmc.traverse.biome.TraverseBiomes.addBasicFeatures;

public class ConiferousForestBiomes {
public static Biome create(FabricDynamicRegistryProvider.Entries entries, boolean snowy) {
public static Biome create(Registerable<Biome> registerable, boolean snowy) {
return new Biome.Builder()
.generationSettings(createGenerationSettings(entries, snowy))
.generationSettings(createGenerationSettings(registerable, snowy))
.spawnSettings(createSpawnSettings())
.precipitation(true)
.temperature(snowy ? -0.5F : 0.6F)
Expand All @@ -28,13 +32,16 @@ public static Biome create(FabricDynamicRegistryProvider.Entries entries, boolea
.build();
}

private static GenerationSettings createGenerationSettings(FabricDynamicRegistryProvider.Entries entries, boolean snowy) {
GenerationSettings.LookupBackedBuilder builder = new GenerationSettings.LookupBackedBuilder(entries.placedFeatures(), entries.configuredCarvers());
private static GenerationSettings createGenerationSettings(Registerable<Biome> registerable, boolean snowy) {
RegistryEntryLookup<ConfiguredCarver<?>> configuredCarvers = registerable.getRegistryLookup(RegistryKeys.CONFIGURED_CARVER);
RegistryEntryLookup<PlacedFeature> placedFeatures = registerable.getRegistryLookup(RegistryKeys.PLACED_FEATURE);

GenerationSettings.LookupBackedBuilder builder = new GenerationSettings.LookupBackedBuilder(placedFeatures, configuredCarvers);
addBasicFeatures(builder);
DefaultBiomeFeatures.addLargeFerns(builder);
DefaultBiomeFeatures.addDefaultOres(builder);
DefaultBiomeFeatures.addDefaultDisks(builder);
builder.feature(GenerationStep.Feature.VEGETAL_DECORATION, entries.ref(TraversePlacedFeatures.CONIFEROUS_TREES));
builder.feature(GenerationStep.Feature.VEGETAL_DECORATION, placedFeatures.getOrThrow(TraversePlacedFeatures.CONIFEROUS_TREES));
DefaultBiomeFeatures.addDefaultFlowers(builder);
DefaultBiomeFeatures.addTaigaGrass(builder);
DefaultBiomeFeatures.addDefaultVegetation(builder);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
package com.terraformersmc.traverse.biome;

import com.terraformersmc.traverse.feature.TraversePlacedFeatures;
import net.fabricmc.fabric.api.datagen.v1.provider.FabricDynamicRegistryProvider;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.SpawnGroup;
import net.minecraft.registry.Registerable;
import net.minecraft.registry.RegistryEntryLookup;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.GenerationSettings;
import net.minecraft.world.biome.SpawnSettings;
import net.minecraft.world.gen.GenerationStep;
import net.minecraft.world.gen.carver.ConfiguredCarver;
import net.minecraft.world.gen.feature.DefaultBiomeFeatures;
import net.minecraft.world.gen.feature.PlacedFeature;

import static com.terraformersmc.traverse.biome.TraverseBiomes.addBasicFeatures;

public class DesertShrublandBiomes {
public static Biome create(FabricDynamicRegistryProvider.Entries entries) {
public static Biome create(Registerable<Biome> registerable) {
return new Biome.Builder()
.generationSettings(createGenerationSettings(entries))
.generationSettings(createGenerationSettings(registerable))
.spawnSettings(createSpawnSettings())
.precipitation(false)
.temperature(2.0F)
Expand All @@ -28,19 +32,22 @@ public static Biome create(FabricDynamicRegistryProvider.Entries entries) {
.build();
}

private static GenerationSettings createGenerationSettings(FabricDynamicRegistryProvider.Entries entries) {
GenerationSettings.LookupBackedBuilder builder = new GenerationSettings.LookupBackedBuilder(entries.placedFeatures(), entries.configuredCarvers());
private static GenerationSettings createGenerationSettings(Registerable<Biome> registerable) {
RegistryEntryLookup<ConfiguredCarver<?>> configuredCarvers = registerable.getRegistryLookup(RegistryKeys.CONFIGURED_CARVER);
RegistryEntryLookup<PlacedFeature> placedFeatures = registerable.getRegistryLookup(RegistryKeys.PLACED_FEATURE);

GenerationSettings.LookupBackedBuilder builder = new GenerationSettings.LookupBackedBuilder(placedFeatures, configuredCarvers);
DefaultBiomeFeatures.addFossils(builder);
addBasicFeatures(builder);
DefaultBiomeFeatures.addDefaultOres(builder);
DefaultBiomeFeatures.addDefaultDisks(builder);
builder.feature(GenerationStep.Feature.VEGETAL_DECORATION, entries.ref(TraversePlacedFeatures.DESERT_SHRUBS));
builder.feature(GenerationStep.Feature.VEGETAL_DECORATION, placedFeatures.getOrThrow(TraversePlacedFeatures.DESERT_SHRUBS));
DefaultBiomeFeatures.addDefaultFlowers(builder);
DefaultBiomeFeatures.addDefaultGrass(builder);
DefaultBiomeFeatures.addDesertDeadBushes(builder);
DefaultBiomeFeatures.addDefaultMushrooms(builder);
DefaultBiomeFeatures.addDesertVegetation(builder);
builder.feature(GenerationStep.Feature.VEGETAL_DECORATION, entries.ref(TraversePlacedFeatures.DESERT_EXTRA_CACTUS));
builder.feature(GenerationStep.Feature.VEGETAL_DECORATION, placedFeatures.getOrThrow(TraversePlacedFeatures.DESERT_EXTRA_CACTUS));
DefaultBiomeFeatures.addDesertFeatures(builder);
return builder.build();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
package com.terraformersmc.traverse.biome;

import com.terraformersmc.traverse.feature.TraversePlacedFeatures;
import net.fabricmc.fabric.api.datagen.v1.provider.FabricDynamicRegistryProvider;
import net.minecraft.registry.Registerable;
import net.minecraft.registry.RegistryEntryLookup;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.GenerationSettings;
import net.minecraft.world.gen.GenerationStep;
import net.minecraft.world.gen.carver.ConfiguredCarver;
import net.minecraft.world.gen.feature.DefaultBiomeFeatures;
import net.minecraft.world.gen.feature.PlacedFeature;

import static com.terraformersmc.traverse.biome.TraverseBiomes.addBasicFeatures;

public class FlatlandsBiomes {
public static Biome create(FabricDynamicRegistryProvider.Entries entries) {
public static Biome create(Registerable<Biome> registerable) {
return new Biome.Builder()
.generationSettings(createGenerationSettings(entries))
.generationSettings(createGenerationSettings(registerable))
.spawnSettings(TraverseBiomes.createDefaultSpawnSettings().build())
.precipitation(true)
.temperature(0.8F)
Expand All @@ -25,14 +29,17 @@ public static Biome create(FabricDynamicRegistryProvider.Entries entries) {
.build();
}

private static GenerationSettings createGenerationSettings(FabricDynamicRegistryProvider.Entries entries) {
GenerationSettings.LookupBackedBuilder builder = new GenerationSettings.LookupBackedBuilder(entries.placedFeatures(), entries.configuredCarvers());
private static GenerationSettings createGenerationSettings(Registerable<Biome> registerable) {
RegistryEntryLookup<ConfiguredCarver<?>> configuredCarvers = registerable.getRegistryLookup(RegistryKeys.CONFIGURED_CARVER);
RegistryEntryLookup<PlacedFeature> placedFeatures = registerable.getRegistryLookup(RegistryKeys.PLACED_FEATURE);

GenerationSettings.LookupBackedBuilder builder = new GenerationSettings.LookupBackedBuilder(placedFeatures, configuredCarvers);
addBasicFeatures(builder);
DefaultBiomeFeatures.addDefaultOres(builder);
DefaultBiomeFeatures.addDefaultDisks(builder);
builder.feature(GenerationStep.Feature.VEGETAL_DECORATION, entries.ref(TraversePlacedFeatures.FLATLANDS_TREES));
builder.feature(GenerationStep.Feature.VEGETAL_DECORATION, entries.ref(TraversePlacedFeatures.LUSH_FLOWERS));
builder.feature(GenerationStep.Feature.VEGETAL_DECORATION, entries.ref(TraversePlacedFeatures.FLATLANDS_GRASS));
builder.feature(GenerationStep.Feature.VEGETAL_DECORATION, placedFeatures.getOrThrow(TraversePlacedFeatures.FLATLANDS_TREES));
builder.feature(GenerationStep.Feature.VEGETAL_DECORATION, placedFeatures.getOrThrow(TraversePlacedFeatures.LUSH_FLOWERS));
builder.feature(GenerationStep.Feature.VEGETAL_DECORATION, placedFeatures.getOrThrow(TraversePlacedFeatures.FLATLANDS_GRASS));
DefaultBiomeFeatures.addDefaultMushrooms(builder);
DefaultBiomeFeatures.addDefaultVegetation(builder);
return builder.build();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
package com.terraformersmc.traverse.biome;

import com.terraformersmc.traverse.feature.TraversePlacedFeatures;
import net.fabricmc.fabric.api.datagen.v1.provider.FabricDynamicRegistryProvider;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.SpawnGroup;
import net.minecraft.registry.Registerable;
import net.minecraft.registry.RegistryEntryLookup;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.GenerationSettings;
import net.minecraft.world.biome.SpawnSettings;
import net.minecraft.world.gen.GenerationStep;
import net.minecraft.world.gen.carver.ConfiguredCarver;
import net.minecraft.world.gen.feature.DefaultBiomeFeatures;
import net.minecraft.world.gen.feature.OceanPlacedFeatures;
import net.minecraft.world.gen.feature.PlacedFeature;

import static com.terraformersmc.traverse.biome.TraverseBiomes.addBasicFeatures;

public class LushSwampBiomes {
public static Biome create(FabricDynamicRegistryProvider.Entries entries) {
public static Biome create(Registerable<Biome> registerable) {
return new Biome.Builder()
.generationSettings(createGenerationSettings(entries))
.generationSettings(createGenerationSettings(registerable))
.spawnSettings(createSpawnSettings())
.precipitation(true)
.temperature(0.8F)
Expand All @@ -30,14 +34,17 @@ public static Biome create(FabricDynamicRegistryProvider.Entries entries) {
.build();
}

public static GenerationSettings createGenerationSettings(FabricDynamicRegistryProvider.Entries entries) {
GenerationSettings.LookupBackedBuilder builder = new GenerationSettings.LookupBackedBuilder(entries.placedFeatures(), entries.configuredCarvers());
public static GenerationSettings createGenerationSettings(Registerable<Biome> registerable) {
RegistryEntryLookup<ConfiguredCarver<?>> configuredCarvers = registerable.getRegistryLookup(RegistryKeys.CONFIGURED_CARVER);
RegistryEntryLookup<PlacedFeature> placedFeatures = registerable.getRegistryLookup(RegistryKeys.PLACED_FEATURE);

GenerationSettings.LookupBackedBuilder builder = new GenerationSettings.LookupBackedBuilder(placedFeatures, configuredCarvers);
DefaultBiomeFeatures.addFossils(builder);
addBasicFeatures(builder);
DefaultBiomeFeatures.addDefaultOres(builder);
DefaultBiomeFeatures.addClayDisk(builder);
builder.feature(GenerationStep.Feature.VEGETAL_DECORATION, entries.ref(TraversePlacedFeatures.SWAMP_FUNGUS));
builder.feature(GenerationStep.Feature.VEGETAL_DECORATION, entries.ref(TraversePlacedFeatures.LUSH_SWAMP_TREES));
builder.feature(GenerationStep.Feature.VEGETAL_DECORATION, placedFeatures.getOrThrow(TraversePlacedFeatures.SWAMP_FUNGUS));
builder.feature(GenerationStep.Feature.VEGETAL_DECORATION, placedFeatures.getOrThrow(TraversePlacedFeatures.LUSH_SWAMP_TREES));
DefaultBiomeFeatures.addSwampFeatures(builder);
DefaultBiomeFeatures.addDefaultMushrooms(builder);
DefaultBiomeFeatures.addSwampVegetation(builder);
Expand Down
Loading

0 comments on commit cbe5b03

Please sign in to comment.