From 3a2f298e64b35e7d09266d4fb01c0f902c7a72b5 Mon Sep 17 00:00:00 2001 From: Mrbysco Date: Sat, 2 Nov 2024 14:59:39 +0100 Subject: [PATCH] Setup compostables and furnace fuel datamap (Fixes #1431) --- CHANGELOG.md | 2 + .../e0d3d0b8d9c807675613821fa865a35f707cd83f | 3 ++ .../neoforge/data_maps/item/compostables.json | 22 +++++++++++ .../data_maps/item/furnace_fuels.json | 10 +++++ .../data/ActuallyAdditionsData.java | 2 + .../data/DataMapGenerator.java | 38 +++++++++++++++++++ 6 files changed, 77 insertions(+) create mode 100644 src/generated/resources/.cache/e0d3d0b8d9c807675613821fa865a35f707cd83f create mode 100644 src/generated/resources/data/neoforge/data_maps/item/compostables.json create mode 100644 src/generated/resources/data/neoforge/data_maps/item/furnace_fuels.json create mode 100644 src/main/java/de/ellpeck/actuallyadditions/data/DataMapGenerator.java diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b94a3634..0a24280d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ * Add the stairs, slabs and walls to the appropriate block/item tags * Change the sound type of the casing blocks to match material used in the recipe * Change the sound type of some machines to use the metal sound +* Allow seeds and crops to be composted +* Add the tiny coal and charcoal to the furnace fuel datamap # 1.3.7+mc1.21.1 * Added recipes for AA crops in the IE cloche. diff --git a/src/generated/resources/.cache/e0d3d0b8d9c807675613821fa865a35f707cd83f b/src/generated/resources/.cache/e0d3d0b8d9c807675613821fa865a35f707cd83f new file mode 100644 index 000000000..c0b2c88d2 --- /dev/null +++ b/src/generated/resources/.cache/e0d3d0b8d9c807675613821fa865a35f707cd83f @@ -0,0 +1,3 @@ +// 1.21.1 2024-11-02T14:59:13.7640446 Data Maps +9f93ec7e2a943d73ede3af027951495c9939bafc data/neoforge/data_maps/item/compostables.json +3141fd94b43dbb67fc8814b371114c571bc07b58 data/neoforge/data_maps/item/furnace_fuels.json diff --git a/src/generated/resources/data/neoforge/data_maps/item/compostables.json b/src/generated/resources/data/neoforge/data_maps/item/compostables.json new file mode 100644 index 000000000..e1310100b --- /dev/null +++ b/src/generated/resources/data/neoforge/data_maps/item/compostables.json @@ -0,0 +1,22 @@ +{ + "values": { + "actuallyadditions:canola": { + "chance": 0.65 + }, + "actuallyadditions:canola_seeds": { + "chance": 0.3 + }, + "actuallyadditions:coffee_beans": { + "chance": 0.65 + }, + "actuallyadditions:flax_seeds": { + "chance": 0.65 + }, + "actuallyadditions:rice": { + "chance": 0.65 + }, + "actuallyadditions:rice_seeds": { + "chance": 0.3 + } + } +} \ No newline at end of file diff --git a/src/generated/resources/data/neoforge/data_maps/item/furnace_fuels.json b/src/generated/resources/data/neoforge/data_maps/item/furnace_fuels.json new file mode 100644 index 000000000..85c10d0a5 --- /dev/null +++ b/src/generated/resources/data/neoforge/data_maps/item/furnace_fuels.json @@ -0,0 +1,10 @@ +{ + "values": { + "actuallyadditions:tiny_charcoal": { + "burn_time": 200 + }, + "actuallyadditions:tiny_coal": { + "burn_time": 200 + } + } +} \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/data/ActuallyAdditionsData.java b/src/main/java/de/ellpeck/actuallyadditions/data/ActuallyAdditionsData.java index b444484b0..3c80ace33 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/data/ActuallyAdditionsData.java +++ b/src/main/java/de/ellpeck/actuallyadditions/data/ActuallyAdditionsData.java @@ -66,6 +66,8 @@ public class ActuallyAdditionsData { generator.addProvider(true, new MiningLensGenerator(packOutput, lookupProvider)); generator.addProvider(true, new CoffeeIngredientGenerator(packOutput, lookupProvider)); + generator.addProvider(true, new DataMapGenerator(packOutput, lookupProvider)); + generator.addProvider(true, new SoundsGenerator(packOutput, helper)); if (ModList.get().isLoaded("patchouli")) diff --git a/src/main/java/de/ellpeck/actuallyadditions/data/DataMapGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/data/DataMapGenerator.java new file mode 100644 index 000000000..1d06a83a6 --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/data/DataMapGenerator.java @@ -0,0 +1,38 @@ +package de.ellpeck.actuallyadditions.data; + +import de.ellpeck.actuallyadditions.mod.items.ActuallyItems; +import net.minecraft.core.HolderLookup.Provider; +import net.minecraft.data.PackOutput; +import net.neoforged.neoforge.common.data.DataMapProvider; +import net.neoforged.neoforge.registries.datamaps.builtin.Compostable; +import net.neoforged.neoforge.registries.datamaps.builtin.FurnaceFuel; +import net.neoforged.neoforge.registries.datamaps.builtin.NeoForgeDataMaps; + +import java.util.concurrent.CompletableFuture; + +public class DataMapGenerator extends DataMapProvider { + public DataMapGenerator(PackOutput packOutput, CompletableFuture lookupProvider) { + super(packOutput, lookupProvider); + } + + @Override + protected void gather() { + final float SEEDS = 0.3F; + final float CROPS = 0.65F; + + final var compostables = builder(NeoForgeDataMaps.COMPOSTABLES); + compostables.add(ActuallyItems.RICE_SEEDS, new Compostable(SEEDS), false); + compostables.add(ActuallyItems.COFFEE_BEANS, new Compostable(SEEDS), false); + compostables.add(ActuallyItems.CANOLA_SEEDS, new Compostable(SEEDS), false); + compostables.add(ActuallyItems.FLAX_SEEDS, new Compostable(SEEDS), false); + + compostables.add(ActuallyItems.RICE, new Compostable(CROPS), false); + compostables.add(ActuallyItems.COFFEE_BEANS, new Compostable(CROPS), false); + compostables.add(ActuallyItems.CANOLA, new Compostable(CROPS), false); + compostables.add(ActuallyItems.FLAX_SEEDS, new Compostable(CROPS), false); + + final var furnaceFuels = builder(NeoForgeDataMaps.FURNACE_FUELS); + furnaceFuels.add(ActuallyItems.TINY_COAL, new FurnaceFuel(200), false); + furnaceFuels.add(ActuallyItems.TINY_CHARCOAL, new FurnaceFuel(200), false); + } +}