From ec061e4fd32e15819ae61dc2177f4e2b114785c8 Mon Sep 17 00:00:00 2001 From: thedarkcolour <30441001+thedarkcolour@users.noreply.github.com> Date: Wed, 21 Feb 2024 16:42:45 -0800 Subject: [PATCH] Add water and lava crucible material types --- changelog.md | 6 + .../711e6e4ef0ec2176e93c58a9656c8098f7158439 | 6 +- .../minecraft/tags/blocks/mineable/axe.json | 8 +- .../tags/blocks/mineable/pickaxe.json | 6 +- .../exdeorum/compat/CompatHelper.java | 62 ++-------- .../exdeorum/compat/jei/CrucibleCategory.java | 12 +- .../jei/CrucibleHeatSourcesCategory.java | 4 +- .../exdeorum/data/BlockModels.java | 72 ++++++------ .../thedarkcolour/exdeorum/data/English.java | 9 +- .../thedarkcolour/exdeorum/data/ModTags.java | 20 +--- .../exdeorum/data/recipe/Recipes.java | 72 ++++++------ .../material/AbstractCrucibleMaterial.java | 47 ++++++++ .../exdeorum/material/BarrelMaterial.java | 6 +- .../exdeorum/material/DefaultMaterials.java | 62 ++++++++++ .../material/LavaCrucibleMaterial.java | 34 ++++++ .../exdeorum/material/MaterialRegistry.java | 14 ++- .../exdeorum/material/SieveMaterial.java | 2 +- .../material/WaterCrucibleMaterial.java | 34 ++++++ .../exdeorum/registry/EBlockEntities.java | 48 +------- .../exdeorum/registry/EBlocks.java | 71 +----------- .../exdeorum/registry/EItems.java | 106 ++---------------- 21 files changed, 319 insertions(+), 382 deletions(-) create mode 100644 src/main/java/thedarkcolour/exdeorum/material/AbstractCrucibleMaterial.java create mode 100644 src/main/java/thedarkcolour/exdeorum/material/LavaCrucibleMaterial.java create mode 100644 src/main/java/thedarkcolour/exdeorum/material/WaterCrucibleMaterial.java diff --git a/changelog.md b/changelog.md index bb8b66e9..630e41dc 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,9 @@ +## Ex Deorum 1.25 +- Fixed crash with fluid containers +- Added `exdeorum:summation` result count type for sieve recipes, mostly for converting Ex Nihilo Sequentia recipes over (also usable for loot tables) +- It is now possible to define custom barrel, crucible, and sieve types. This may be useful for modpack authors who want to add enhanced compatibility with Ex Deorum. Documentation will be available soon. +- Fixed inconsistencies with barrel and sieve sounds + ## Ex Deorum 1.24 - Fixed water crucibles filling infinitely with rainwater. (PR #54 by CPearl0) - Add option (disabled by default) to make dirt from flowing water and witch water diff --git a/src/generated/resources/.cache/711e6e4ef0ec2176e93c58a9656c8098f7158439 b/src/generated/resources/.cache/711e6e4ef0ec2176e93c58a9656c8098f7158439 index f5aeca41..d518de43 100644 --- a/src/generated/resources/.cache/711e6e4ef0ec2176e93c58a9656c8098f7158439 +++ b/src/generated/resources/.cache/711e6e4ef0ec2176e93c58a9656c8098f7158439 @@ -1,7 +1,7 @@ -// 1.20.1 2024-02-21T14:54:39.5258231 Tags for minecraft:block mod id exdeorum +// 1.20.1 2024-02-21T16:26:29.550358 Tags for minecraft:block mod id exdeorum 77dfab311d3714c77bcac2df0397d23d4707f03b data/exdeorum/tags/blocks/watering_can_tickable.json f6a9610ebae09549baf17e27200037cd17318055 data/minecraft/tags/blocks/leaves.json -6118dd1a976e5c95335fe0271c784eef3dac5bf5 data/minecraft/tags/blocks/mineable/axe.json +3ef617151d471ad88e692be7d86c620cf267d0b7 data/minecraft/tags/blocks/mineable/axe.json f6a9610ebae09549baf17e27200037cd17318055 data/minecraft/tags/blocks/mineable/hoe.json -1fc4853812de00ec64713040f42af2e37b581955 data/minecraft/tags/blocks/mineable/pickaxe.json +1193daf0dafc5f481e1e47528d89e59876e2ce7b data/minecraft/tags/blocks/mineable/pickaxe.json 0fc927ffe01dd23fd511dea057c7894680ae9807 data/minecraft/tags/blocks/mineable/shovel.json diff --git a/src/generated/resources/data/minecraft/tags/blocks/mineable/axe.json b/src/generated/resources/data/minecraft/tags/blocks/mineable/axe.json index 7d835c91..2007e0cc 100644 --- a/src/generated/resources/data/minecraft/tags/blocks/mineable/axe.json +++ b/src/generated/resources/data/minecraft/tags/blocks/mineable/axe.json @@ -60,8 +60,6 @@ "exdeorum:lunar_sieve", "exdeorum:dusk_sieve", "exdeorum:maple_sieve", - "exdeorum:warped_crucible", - "exdeorum:crimson_crucible", "exdeorum:oak_crucible", "exdeorum:spruce_crucible", "exdeorum:birch_crucible", @@ -80,7 +78,6 @@ "exdeorum:dead_crucible", "exdeorum:magic_crucible", "exdeorum:umbran_crucible", - "exdeorum:hellbark_crucible", "exdeorum:blue_archwood_crucible", "exdeorum:red_archwood_crucible", "exdeorum:purple_archwood_crucible", @@ -93,6 +90,9 @@ "exdeorum:comet_crucible", "exdeorum:lunar_crucible", "exdeorum:dusk_crucible", - "exdeorum:maple_crucible" + "exdeorum:maple_crucible", + "exdeorum:warped_crucible", + "exdeorum:crimson_crucible", + "exdeorum:hellbark_crucible" ] } \ No newline at end of file diff --git a/src/generated/resources/data/minecraft/tags/blocks/mineable/pickaxe.json b/src/generated/resources/data/minecraft/tags/blocks/mineable/pickaxe.json index 5ac10da8..37557147 100644 --- a/src/generated/resources/data/minecraft/tags/blocks/mineable/pickaxe.json +++ b/src/generated/resources/data/minecraft/tags/blocks/mineable/pickaxe.json @@ -1,12 +1,12 @@ { "values": [ - "exdeorum:porcelain_crucible", "exdeorum:unfired_porcelain_crucible", - "exdeorum:crystallized_crucible", "exdeorum:mechanical_sieve", "exdeorum:mechanical_hammer", "exdeorum:stone_barrel", "exdeorum:crystallized_barrel", - "exdeorum:crystallized_sieve" + "exdeorum:crystallized_sieve", + "exdeorum:porcelain_crucible", + "exdeorum:crystallized_crucible" ] } \ No newline at end of file diff --git a/src/main/java/thedarkcolour/exdeorum/compat/CompatHelper.java b/src/main/java/thedarkcolour/exdeorum/compat/CompatHelper.java index 33740d5e..cfe3e856 100644 --- a/src/main/java/thedarkcolour/exdeorum/compat/CompatHelper.java +++ b/src/main/java/thedarkcolour/exdeorum/compat/CompatHelper.java @@ -18,7 +18,6 @@ package thedarkcolour.exdeorum.compat; -import com.google.common.collect.Lists; import net.minecraft.world.item.Item; import net.minecraftforge.fml.ModList; import thedarkcolour.exdeorum.material.DefaultMaterials; @@ -53,66 +52,27 @@ public class CompatHelper { } public static List getAvailableLavaCrucibles(boolean registered) { - List lavaCrucibles = registered ? Lists.newArrayList( - EItems.PORCELAIN_CRUCIBLE.get(), - EItems.WARPED_CRUCIBLE.get(), - EItems.CRIMSON_CRUCIBLE.get() - ) : new ArrayList<>(); + List lavaCrucibles = new ArrayList<>(); - if (ModList.get().isLoaded(ModIds.BIOMES_O_PLENTY) == registered) { - lavaCrucibles.add(EItems.HELLBARK_CRUCIBLE.get()); - } - if (ModList.get().isLoaded(ModIds.BLUE_SKIES) == registered) { - lavaCrucibles.add(EItems.CRYSTALLIZED_CRUCIBLE.get()); + for (var material : DefaultMaterials.LAVA_CRUCIBLES) { + if (registered == ModList.get().isLoaded(material.requiredModId)) { + lavaCrucibles.add(material.getItem()); + } } return lavaCrucibles; } public static List getAvailableWaterCrucibles(boolean registered) { - List waterCrucibles = registered ? Lists.newArrayList( - EItems.OAK_CRUCIBLE.get(), - EItems.SPRUCE_CRUCIBLE.get(), - EItems.BIRCH_CRUCIBLE.get(), - EItems.JUNGLE_CRUCIBLE.get(), - EItems.ACACIA_CRUCIBLE.get(), - EItems.DARK_OAK_CRUCIBLE.get(), - EItems.MANGROVE_CRUCIBLE.get(), - EItems.CHERRY_CRUCIBLE.get(), - EItems.BAMBOO_CRUCIBLE.get() - ) : new ArrayList<>(); + List waterCrucibles = new ArrayList<>(); - if (ModList.get().isLoaded(ModIds.BIOMES_O_PLENTY) == registered) { - waterCrucibles.add(EItems.FIR_CRUCIBLE.get()); - waterCrucibles.add(EItems.REDWOOD_CRUCIBLE.get()); - waterCrucibles.add(EItems.MAHOGANY_CRUCIBLE.get()); - waterCrucibles.add(EItems.JACARANDA_CRUCIBLE.get()); - waterCrucibles.add(EItems.PALM_CRUCIBLE.get()); - waterCrucibles.add(EItems.WILLOW_CRUCIBLE.get()); - waterCrucibles.add(EItems.DEAD_CRUCIBLE.get()); - waterCrucibles.add(EItems.MAGIC_CRUCIBLE.get()); - waterCrucibles.add(EItems.UMBRAN_CRUCIBLE.get()); - } - if (ModList.get().isLoaded(ModIds.ARS_NOUVEAU) == registered) { - waterCrucibles.add(EItems.CASCADING_ARCHWOOD_CRUCIBLE.get()); - waterCrucibles.add(EItems.BLAZING_ARCHWOOD_CRUCIBLE.get()); - waterCrucibles.add(EItems.VEXING_ARCHWOOD_CRUCIBLE.get()); - waterCrucibles.add(EItems.FLOURISHING_ARCHWOOD_CRUCIBLE.get()); - } - if (ModList.get().isLoaded(ModIds.AETHER) == registered) { - waterCrucibles.add(EItems.SKYROOT_CRUCIBLE.get()); - waterCrucibles.add(EItems.GOLDEN_OAK_CRUCIBLE.get()); - } - if (ModList.get().isLoaded(ModIds.BLUE_SKIES) == registered) { - waterCrucibles.add(EItems.BLUEBRIGHT_CRUCIBLE.get()); - waterCrucibles.add(EItems.STARLIT_CRUCIBLE.get()); - waterCrucibles.add(EItems.FROSTBRIGHT_CRUCIBLE.get()); - waterCrucibles.add(EItems.COMET_CRUCIBLE.get()); - waterCrucibles.add(EItems.LUNAR_CRUCIBLE.get()); - waterCrucibles.add(EItems.DUSK_CRUCIBLE.get()); - waterCrucibles.add(EItems.MAPLE_CRUCIBLE.get()); + for (var material : DefaultMaterials.WATER_CRUCIBLES) { + if (registered == ModList.get().isLoaded(material.requiredModId)) { + waterCrucibles.add(material.getItem()); + } } + return waterCrucibles; } } diff --git a/src/main/java/thedarkcolour/exdeorum/compat/jei/CrucibleCategory.java b/src/main/java/thedarkcolour/exdeorum/compat/jei/CrucibleCategory.java index c023b6af..98c964ed 100644 --- a/src/main/java/thedarkcolour/exdeorum/compat/jei/CrucibleCategory.java +++ b/src/main/java/thedarkcolour/exdeorum/compat/jei/CrucibleCategory.java @@ -26,14 +26,12 @@ import net.minecraft.network.chat.Component; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import thedarkcolour.exdeorum.data.TranslationKeys; +import thedarkcolour.exdeorum.material.DefaultMaterials; import thedarkcolour.exdeorum.recipe.crucible.CrucibleRecipe; -import thedarkcolour.exdeorum.registry.EItems; - -import java.util.function.Supplier; abstract class CrucibleCategory extends OneToOneCategory { - public CrucibleCategory(IGuiHelper helper, IDrawable arrow, Supplier iconItem, String titleKey) { - super(helper, arrow, helper.createDrawableItemStack(new ItemStack(iconItem.get())), Component.translatable(titleKey)); + public CrucibleCategory(IGuiHelper helper, IDrawable arrow, Item iconItem, String titleKey) { + super(helper, arrow, helper.createDrawableItemStack(new ItemStack(iconItem)), Component.translatable(titleKey)); } @Override @@ -49,7 +47,7 @@ abstract class CrucibleCategory extends OneToOneCategory { static class LavaCrucible extends CrucibleCategory { public LavaCrucible(IGuiHelper helper, IDrawable arrow) { - super(helper, arrow, EItems.PORCELAIN_CRUCIBLE, TranslationKeys.LAVA_CRUCIBLE_CATEGORY_TITLE); + super(helper, arrow, DefaultMaterials.PORCELAIN_CRUCIBLE.getItem(), TranslationKeys.LAVA_CRUCIBLE_CATEGORY_TITLE); } @Override @@ -60,7 +58,7 @@ abstract class CrucibleCategory extends OneToOneCategory { static class WaterCrucible extends CrucibleCategory { public WaterCrucible(IGuiHelper helper, IDrawable arrow) { - super(helper, arrow, EItems.OAK_CRUCIBLE, TranslationKeys.WATER_CRUCIBLE_CATEGORY_TITLE); + super(helper, arrow, DefaultMaterials.OAK_CRUCIBLE.getItem(), TranslationKeys.WATER_CRUCIBLE_CATEGORY_TITLE); } @Override diff --git a/src/main/java/thedarkcolour/exdeorum/compat/jei/CrucibleHeatSourcesCategory.java b/src/main/java/thedarkcolour/exdeorum/compat/jei/CrucibleHeatSourcesCategory.java index 40d556f2..1b4b25c3 100644 --- a/src/main/java/thedarkcolour/exdeorum/compat/jei/CrucibleHeatSourcesCategory.java +++ b/src/main/java/thedarkcolour/exdeorum/compat/jei/CrucibleHeatSourcesCategory.java @@ -39,7 +39,7 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.TooltipFlag; import net.minecraftforge.registries.ForgeRegistries; import thedarkcolour.exdeorum.data.TranslationKeys; -import thedarkcolour.exdeorum.registry.EItems; +import thedarkcolour.exdeorum.material.DefaultMaterials; import java.util.List; @@ -59,7 +59,7 @@ class CrucibleHeatSourcesCategory implements IRecipeCategory material != DefaultMaterials.CRYSTALLIZED_SIEVE).map(SieveMaterial::getBlock).toArray(Block[]::new)) - .add( - // Vanilla crucibles - EBlocks.WARPED_CRUCIBLE.get(), EBlocks.CRIMSON_CRUCIBLE.get(), EBlocks.OAK_CRUCIBLE.get(), EBlocks.SPRUCE_CRUCIBLE.get(), EBlocks.BIRCH_CRUCIBLE.get(), EBlocks.JUNGLE_CRUCIBLE.get(), EBlocks.ACACIA_CRUCIBLE.get(), EBlocks.DARK_OAK_CRUCIBLE.get(), EBlocks.MANGROVE_CRUCIBLE.get(), EBlocks.CHERRY_CRUCIBLE.get(), EBlocks.BAMBOO_CRUCIBLE.get(), - // BOP crucibles - EBlocks.FIR_CRUCIBLE.get(), EBlocks.REDWOOD_CRUCIBLE.get(), EBlocks.MAHOGANY_CRUCIBLE.get(), EBlocks.JACARANDA_CRUCIBLE.get(), EBlocks.PALM_CRUCIBLE.get(), EBlocks.WILLOW_CRUCIBLE.get(), EBlocks.DEAD_CRUCIBLE.get(), EBlocks.MAGIC_CRUCIBLE.get(), EBlocks.UMBRAN_CRUCIBLE.get(), EBlocks.HELLBARK_CRUCIBLE.get(), - // Ars Nouveau crucibles - EBlocks.CASCADING_ARCHWOOD_CRUCIBLE.get(), EBlocks.BLAZING_ARCHWOOD_CRUCIBLE.get(), EBlocks.VEXING_ARCHWOOD_CRUCIBLE.get(), EBlocks.FLOURISHING_ARCHWOOD_CRUCIBLE.get(), - // Aether crucibles - EBlocks.SKYROOT_CRUCIBLE.get(), EBlocks.GOLDEN_OAK_CRUCIBLE.get(), - // Blue Skies crucibles - EBlocks.BLUEBRIGHT_CRUCIBLE.get(), EBlocks.STARLIT_CRUCIBLE.get(), EBlocks.FROSTBRIGHT_CRUCIBLE.get(), EBlocks.COMET_CRUCIBLE.get(), EBlocks.LUNAR_CRUCIBLE.get(), EBlocks.DUSK_CRUCIBLE.get(), EBlocks.MAPLE_CRUCIBLE.get() - ); + .add(DefaultMaterials.WATER_CRUCIBLES.stream().map(AbstractCrucibleMaterial::getBlock).toArray(Block[]::new)) + .add(DefaultMaterials.WARPED_CRUCIBLE.getBlock(), DefaultMaterials.CRIMSON_CRUCIBLE.getBlock(), DefaultMaterials.HELLBARK_CRUCIBLE.getBlock()); tags.tag(BlockTags.MINEABLE_WITH_PICKAXE) - .add(EBlocks.PORCELAIN_CRUCIBLE, EBlocks.UNFIRED_PORCELAIN_CRUCIBLE, EBlocks.CRYSTALLIZED_CRUCIBLE, EBlocks.MECHANICAL_SIEVE, EBlocks.MECHANICAL_HAMMER) - .add(DefaultMaterials.STONE_BARREL.getBlock(), DefaultMaterials.CRYSTALLIZED_BARREL.getBlock(), DefaultMaterials.CRYSTALLIZED_SIEVE.getBlock()); + .add(EBlocks.UNFIRED_PORCELAIN_CRUCIBLE, EBlocks.MECHANICAL_SIEVE, EBlocks.MECHANICAL_HAMMER) + .add(DefaultMaterials.STONE_BARREL.getBlock(), DefaultMaterials.CRYSTALLIZED_BARREL.getBlock(), DefaultMaterials.CRYSTALLIZED_SIEVE.getBlock(), DefaultMaterials.PORCELAIN_CRUCIBLE.getBlock(), DefaultMaterials.CRYSTALLIZED_CRUCIBLE.getBlock()); tags.tag(BlockTags.MINEABLE_WITH_SHOVEL).add(EBlocks.DUST, EBlocks.CRUSHED_NETHERRACK, EBlocks.CRUSHED_END_STONE, EBlocks.CRUSHED_DEEPSLATE, EBlocks.CRUSHED_BLACKSTONE); tags.tag(BlockTags.MINEABLE_WITH_HOE).add(EBlocks.INFESTED_LEAVES); tags.tag(BlockTags.LEAVES).add(EBlocks.INFESTED_LEAVES); diff --git a/src/main/java/thedarkcolour/exdeorum/data/recipe/Recipes.java b/src/main/java/thedarkcolour/exdeorum/data/recipe/Recipes.java index 8c251c48..617b961a 100644 --- a/src/main/java/thedarkcolour/exdeorum/data/recipe/Recipes.java +++ b/src/main/java/thedarkcolour/exdeorum/data/recipe/Recipes.java @@ -105,46 +105,46 @@ public class Recipes { recipes.netheriteUpgrade(RecipeCategory.TOOLS, ingredient(EItems.DIAMOND_HAMMER.get()), EItems.NETHERITE_HAMMER.get()); // Crucibles - uShaped(recipes, EItems.OAK_CRUCIBLE.get(), ingredient(Items.OAK_LOG), ingredient(Items.OAK_SLAB)); - uShaped(recipes, EItems.SPRUCE_CRUCIBLE.get(), ingredient(Items.SPRUCE_LOG), ingredient(Items.SPRUCE_SLAB)); - uShaped(recipes, EItems.BIRCH_CRUCIBLE.get(), ingredient(Items.BIRCH_LOG), ingredient(Items.BIRCH_SLAB)); - uShaped(recipes, EItems.JUNGLE_CRUCIBLE.get(), ingredient(Items.JUNGLE_LOG), ingredient(Items.JUNGLE_SLAB)); - uShaped(recipes, EItems.ACACIA_CRUCIBLE.get(), ingredient(Items.ACACIA_LOG), ingredient(Items.ACACIA_SLAB)); - uShaped(recipes, EItems.DARK_OAK_CRUCIBLE.get(), ingredient(Items.DARK_OAK_LOG), ingredient(Items.DARK_OAK_SLAB)); - uShaped(recipes, EItems.MANGROVE_CRUCIBLE.get(), ingredient(Items.MANGROVE_LOG), ingredient(Items.MANGROVE_SLAB)); - uShaped(recipes, EItems.CHERRY_CRUCIBLE.get(), ingredient(Items.CHERRY_LOG), ingredient(Items.CHERRY_SLAB)); - uShaped(recipes, EItems.BAMBOO_CRUCIBLE.get(), ingredient(Items.BAMBOO_BLOCK), ingredient(Items.BAMBOO_SLAB)); - uShaped(recipes, EItems.CRIMSON_CRUCIBLE.get(), ingredient(Items.CRIMSON_STEM), ingredient(Items.CRIMSON_SLAB)); - uShaped(recipes, EItems.WARPED_CRUCIBLE.get(), ingredient(Items.WARPED_STEM), ingredient(Items.WARPED_SLAB)); + uShaped(recipes, DefaultMaterials.OAK_CRUCIBLE.getItem(), ingredient(Items.OAK_LOG), ingredient(Items.OAK_SLAB)); + uShaped(recipes, DefaultMaterials.SPRUCE_CRUCIBLE.getItem(), ingredient(Items.SPRUCE_LOG), ingredient(Items.SPRUCE_SLAB)); + uShaped(recipes, DefaultMaterials.BIRCH_CRUCIBLE.getItem(), ingredient(Items.BIRCH_LOG), ingredient(Items.BIRCH_SLAB)); + uShaped(recipes, DefaultMaterials.JUNGLE_CRUCIBLE.getItem(), ingredient(Items.JUNGLE_LOG), ingredient(Items.JUNGLE_SLAB)); + uShaped(recipes, DefaultMaterials.ACACIA_CRUCIBLE.getItem(), ingredient(Items.ACACIA_LOG), ingredient(Items.ACACIA_SLAB)); + uShaped(recipes, DefaultMaterials.DARK_OAK_CRUCIBLE.getItem(), ingredient(Items.DARK_OAK_LOG), ingredient(Items.DARK_OAK_SLAB)); + uShaped(recipes, DefaultMaterials.MANGROVE_CRUCIBLE.getItem(), ingredient(Items.MANGROVE_LOG), ingredient(Items.MANGROVE_SLAB)); + uShaped(recipes, DefaultMaterials.CHERRY_CRUCIBLE.getItem(), ingredient(Items.CHERRY_LOG), ingredient(Items.CHERRY_SLAB)); + uShaped(recipes, DefaultMaterials.BAMBOO_CRUCIBLE.getItem(), ingredient(Items.BAMBOO_BLOCK), ingredient(Items.BAMBOO_SLAB)); + uShaped(recipes, DefaultMaterials.CRIMSON_CRUCIBLE.getItem(), ingredient(Items.CRIMSON_STEM), ingredient(Items.CRIMSON_SLAB)); + uShaped(recipes, DefaultMaterials.WARPED_CRUCIBLE.getItem(), ingredient(Items.WARPED_STEM), ingredient(Items.WARPED_SLAB)); uShaped(recipes, EItems.UNFIRED_PORCELAIN_CRUCIBLE.get(), ingredient(EItems.PORCELAIN_CLAY_BALL.get()), ingredient(EItems.PORCELAIN_CLAY_BALL.get())); // BOP crucibles - modUShaped(recipes, ModIds.BIOMES_O_PLENTY, ModCompatData.FIR_LOG_ITEM, ModCompatData.FIR_SLAB, EItems.FIR_CRUCIBLE.get()); - modUShaped(recipes, ModIds.BIOMES_O_PLENTY, ModCompatData.REDWOOD_LOG_ITEM, ModCompatData.REDWOOD_SLAB, EItems.REDWOOD_CRUCIBLE.get()); - modUShaped(recipes, ModIds.BIOMES_O_PLENTY, ModCompatData.MAHOGANY_LOG_ITEM, ModCompatData.MAHOGANY_SLAB, EItems.MAHOGANY_CRUCIBLE.get()); - modUShaped(recipes, ModIds.BIOMES_O_PLENTY, ModCompatData.JACARANDA_LOG_ITEM, ModCompatData.JACARANDA_SLAB, EItems.JACARANDA_CRUCIBLE.get()); - modUShaped(recipes, ModIds.BIOMES_O_PLENTY, ModCompatData.PALM_LOG_ITEM, ModCompatData.PALM_SLAB, EItems.PALM_CRUCIBLE.get()); - modUShaped(recipes, ModIds.BIOMES_O_PLENTY, ModCompatData.WILLOW_LOG_ITEM, ModCompatData.WILLOW_SLAB, EItems.WILLOW_CRUCIBLE.get()); - modUShaped(recipes, ModIds.BIOMES_O_PLENTY, ModCompatData.DEAD_LOG_ITEM, ModCompatData.DEAD_SLAB, EItems.DEAD_CRUCIBLE.get()); - modUShaped(recipes, ModIds.BIOMES_O_PLENTY, ModCompatData.MAGIC_LOG_ITEM, ModCompatData.MAGIC_SLAB, EItems.MAGIC_CRUCIBLE.get()); - modUShaped(recipes, ModIds.BIOMES_O_PLENTY, ModCompatData.UMBRAN_LOG_ITEM, ModCompatData.UMBRAN_SLAB, EItems.UMBRAN_CRUCIBLE.get()); - modUShaped(recipes, ModIds.BIOMES_O_PLENTY, ModCompatData.HELLBARK_LOG_ITEM, ModCompatData.HELLBARK_SLAB, EItems.HELLBARK_CRUCIBLE.get()); + modUShaped(recipes, ModIds.BIOMES_O_PLENTY, ModCompatData.FIR_LOG_ITEM, ModCompatData.FIR_SLAB, DefaultMaterials.FIR_CRUCIBLE.getItem()); + modUShaped(recipes, ModIds.BIOMES_O_PLENTY, ModCompatData.REDWOOD_LOG_ITEM, ModCompatData.REDWOOD_SLAB, DefaultMaterials.REDWOOD_CRUCIBLE.getItem()); + modUShaped(recipes, ModIds.BIOMES_O_PLENTY, ModCompatData.MAHOGANY_LOG_ITEM, ModCompatData.MAHOGANY_SLAB, DefaultMaterials.MAHOGANY_CRUCIBLE.getItem()); + modUShaped(recipes, ModIds.BIOMES_O_PLENTY, ModCompatData.JACARANDA_LOG_ITEM, ModCompatData.JACARANDA_SLAB, DefaultMaterials.JACARANDA_CRUCIBLE.getItem()); + modUShaped(recipes, ModIds.BIOMES_O_PLENTY, ModCompatData.PALM_LOG_ITEM, ModCompatData.PALM_SLAB, DefaultMaterials.PALM_CRUCIBLE.getItem()); + modUShaped(recipes, ModIds.BIOMES_O_PLENTY, ModCompatData.WILLOW_LOG_ITEM, ModCompatData.WILLOW_SLAB, DefaultMaterials.WILLOW_CRUCIBLE.getItem()); + modUShaped(recipes, ModIds.BIOMES_O_PLENTY, ModCompatData.DEAD_LOG_ITEM, ModCompatData.DEAD_SLAB, DefaultMaterials.DEAD_CRUCIBLE.getItem()); + modUShaped(recipes, ModIds.BIOMES_O_PLENTY, ModCompatData.MAGIC_LOG_ITEM, ModCompatData.MAGIC_SLAB, DefaultMaterials.MAGIC_CRUCIBLE.getItem()); + modUShaped(recipes, ModIds.BIOMES_O_PLENTY, ModCompatData.UMBRAN_LOG_ITEM, ModCompatData.UMBRAN_SLAB, DefaultMaterials.UMBRAN_CRUCIBLE.getItem()); + modUShaped(recipes, ModIds.BIOMES_O_PLENTY, ModCompatData.HELLBARK_LOG_ITEM, ModCompatData.HELLBARK_SLAB, DefaultMaterials.HELLBARK_CRUCIBLE.getItem()); // Ars crucibles - modUShaped(recipes, ModIds.ARS_NOUVEAU, ModCompatData.CASCADING_ARCHWOOD_LOG_ITEM, ModCompatData.ARCHWOOD_SLAB, EItems.CASCADING_ARCHWOOD_CRUCIBLE.get()); - modUShaped(recipes, ModIds.ARS_NOUVEAU, ModCompatData.BLAZING_ARCHWOOD_LOG_ITEM, ModCompatData.ARCHWOOD_SLAB, EItems.BLAZING_ARCHWOOD_CRUCIBLE.get()); - modUShaped(recipes, ModIds.ARS_NOUVEAU, ModCompatData.VEXING_ARCHWOOD_LOG_ITEM, ModCompatData.ARCHWOOD_SLAB, EItems.VEXING_ARCHWOOD_CRUCIBLE.get()); - modUShaped(recipes, ModIds.ARS_NOUVEAU, ModCompatData.FLOURISHING_ARCHWOOD_LOG_ITEM, ModCompatData.ARCHWOOD_SLAB, EItems.FLOURISHING_ARCHWOOD_CRUCIBLE.get()); + modUShaped(recipes, ModIds.ARS_NOUVEAU, ModCompatData.CASCADING_ARCHWOOD_LOG_ITEM, ModCompatData.ARCHWOOD_SLAB, DefaultMaterials.CASCADING_ARCHWOOD_CRUCIBLE.getItem()); + modUShaped(recipes, ModIds.ARS_NOUVEAU, ModCompatData.BLAZING_ARCHWOOD_LOG_ITEM, ModCompatData.ARCHWOOD_SLAB, DefaultMaterials.BLAZING_ARCHWOOD_CRUCIBLE.getItem()); + modUShaped(recipes, ModIds.ARS_NOUVEAU, ModCompatData.VEXING_ARCHWOOD_LOG_ITEM, ModCompatData.ARCHWOOD_SLAB, DefaultMaterials.VEXING_ARCHWOOD_CRUCIBLE.getItem()); + modUShaped(recipes, ModIds.ARS_NOUVEAU, ModCompatData.FLOURISHING_ARCHWOOD_LOG_ITEM, ModCompatData.ARCHWOOD_SLAB, DefaultMaterials.FLOURISHING_ARCHWOOD_CRUCIBLE.getItem()); // Aether crucibles - modUShaped(recipes, ModIds.AETHER, ModCompatData.GOLDEN_OAK_LOG_ITEM, ModCompatData.SKYROOT_SLAB, EItems.GOLDEN_OAK_CRUCIBLE.get()); - modUShaped(recipes, ModIds.AETHER, ModCompatData.SKYROOT_LOG_ITEM, ModCompatData.SKYROOT_SLAB, EItems.SKYROOT_CRUCIBLE.get()); + modUShaped(recipes, ModIds.AETHER, ModCompatData.GOLDEN_OAK_LOG_ITEM, ModCompatData.SKYROOT_SLAB, DefaultMaterials.GOLDEN_OAK_CRUCIBLE.getItem()); + modUShaped(recipes, ModIds.AETHER, ModCompatData.SKYROOT_LOG_ITEM, ModCompatData.SKYROOT_SLAB, DefaultMaterials.SKYROOT_CRUCIBLE.getItem()); // Blue Skies crucibles - modUShaped(recipes, ModIds.BLUE_SKIES, ModCompatData.BLUEBRIGHT_LOG_ITEM, ModCompatData.BLUEBRIGHT_SLAB, EItems.BLUEBRIGHT_CRUCIBLE.get()); - modUShaped(recipes, ModIds.BLUE_SKIES, ModCompatData.STARLIT_LOG_ITEM, ModCompatData.STARLIT_SLAB, EItems.STARLIT_CRUCIBLE.get()); - modUShaped(recipes, ModIds.BLUE_SKIES, ModCompatData.FROSTBRIGHT_LOG_ITEM, ModCompatData.FROSTBRIGHT_SLAB, EItems.FROSTBRIGHT_CRUCIBLE.get()); - modUShaped(recipes, ModIds.BLUE_SKIES, ModCompatData.COMET_LOG_ITEM, ModCompatData.COMET_SLAB, EItems.COMET_CRUCIBLE.get()); - modUShaped(recipes, ModIds.BLUE_SKIES, ModCompatData.LUNAR_LOG_ITEM, ModCompatData.LUNAR_SLAB, EItems.LUNAR_CRUCIBLE.get()); - modUShaped(recipes, ModIds.BLUE_SKIES, ModCompatData.DUSK_LOG_ITEM, ModCompatData.DUSK_SLAB, EItems.DUSK_CRUCIBLE.get()); - modUShaped(recipes, ModIds.BLUE_SKIES, ModCompatData.MAPLE_LOG_ITEM, ModCompatData.MAPLE_SLAB, EItems.MAPLE_CRUCIBLE.get()); - modUShaped(recipes, ModIds.BLUE_SKIES, ModCompatData.CRYSTALLIZED_LOG_ITEM, ModCompatData.CRYSTALLIZED_SLAB, EItems.CRYSTALLIZED_CRUCIBLE.get()); + modUShaped(recipes, ModIds.BLUE_SKIES, ModCompatData.BLUEBRIGHT_LOG_ITEM, ModCompatData.BLUEBRIGHT_SLAB, DefaultMaterials.BLUEBRIGHT_CRUCIBLE.getItem()); + modUShaped(recipes, ModIds.BLUE_SKIES, ModCompatData.STARLIT_LOG_ITEM, ModCompatData.STARLIT_SLAB, DefaultMaterials.STARLIT_CRUCIBLE.getItem()); + modUShaped(recipes, ModIds.BLUE_SKIES, ModCompatData.FROSTBRIGHT_LOG_ITEM, ModCompatData.FROSTBRIGHT_SLAB, DefaultMaterials.FROSTBRIGHT_CRUCIBLE.getItem()); + modUShaped(recipes, ModIds.BLUE_SKIES, ModCompatData.COMET_LOG_ITEM, ModCompatData.COMET_SLAB, DefaultMaterials.COMET_CRUCIBLE.getItem()); + modUShaped(recipes, ModIds.BLUE_SKIES, ModCompatData.LUNAR_LOG_ITEM, ModCompatData.LUNAR_SLAB, DefaultMaterials.LUNAR_CRUCIBLE.getItem()); + modUShaped(recipes, ModIds.BLUE_SKIES, ModCompatData.DUSK_LOG_ITEM, ModCompatData.DUSK_SLAB, DefaultMaterials.DUSK_CRUCIBLE.getItem()); + modUShaped(recipes, ModIds.BLUE_SKIES, ModCompatData.MAPLE_LOG_ITEM, ModCompatData.MAPLE_SLAB, DefaultMaterials.MAPLE_CRUCIBLE.getItem()); + modUShaped(recipes, ModIds.BLUE_SKIES, ModCompatData.CRYSTALLIZED_LOG_ITEM, ModCompatData.CRYSTALLIZED_SLAB, DefaultMaterials.CRYSTALLIZED_CRUCIBLE.getItem()); // Barrels uShaped(recipes, DefaultMaterials.OAK_BARREL.getItem(), ingredient(Items.OAK_PLANKS), ingredient(Items.OAK_SLAB)); @@ -417,7 +417,7 @@ public class Recipes { } private static void smeltingRecipes(MKRecipeProvider recipes) { - recipes.smelting(ingredient(EItems.UNFIRED_PORCELAIN_CRUCIBLE), EItems.PORCELAIN_CRUCIBLE.get(), 0.1f); + recipes.smelting(ingredient(EItems.UNFIRED_PORCELAIN_CRUCIBLE), DefaultMaterials.PORCELAIN_CRUCIBLE.getItem(), 0.1f); recipes.smelting(ingredient(EItems.UNFIRED_PORCELAIN_BUCKET), EItems.PORCELAIN_BUCKET.get(), 0.1f); recipes.foodCooking(EItems.SILK_WORM.get(), EItems.COOKED_SILK_WORM.get(), 0.1f); diff --git a/src/main/java/thedarkcolour/exdeorum/material/AbstractCrucibleMaterial.java b/src/main/java/thedarkcolour/exdeorum/material/AbstractCrucibleMaterial.java new file mode 100644 index 00000000..4636bce1 --- /dev/null +++ b/src/main/java/thedarkcolour/exdeorum/material/AbstractCrucibleMaterial.java @@ -0,0 +1,47 @@ +/* + * Ex Deorum + * Copyright (c) 2024 thedarkcolour + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package thedarkcolour.exdeorum.material; + +import net.minecraft.world.level.block.SoundType; +import org.jetbrains.annotations.Nullable; + +public abstract class AbstractCrucibleMaterial extends AbstractMaterial { + public AbstractCrucibleMaterial(SoundType soundType, float strength, boolean needsCorrectTool, int mapColor, String requiredModId) { + super(soundType, strength, needsCorrectTool, mapColor, requiredModId); + } + + @Nullable + public static T readFromJson(MaterialParser parser, Factory factory) { + SoundType soundType = parser.getSoundType(); + float strength = parser.getStrength(); + boolean needsCorrectTool = parser.getOptionalBoolean("needs_correct_tool"); + int mapColor = parser.getMapColor(); + String requiredModId = parser.getRequiredModId(); + + if (parser.error) { + return null; + } else { + return factory.create(soundType, strength, needsCorrectTool, mapColor, requiredModId); + } + } + + public interface Factory { + T create(SoundType soundType, float strength, boolean needsCorrectTool, int mapColor, String requiredModId); + } +} diff --git a/src/main/java/thedarkcolour/exdeorum/material/BarrelMaterial.java b/src/main/java/thedarkcolour/exdeorum/material/BarrelMaterial.java index d77c0ff5..2df47081 100644 --- a/src/main/java/thedarkcolour/exdeorum/material/BarrelMaterial.java +++ b/src/main/java/thedarkcolour/exdeorum/material/BarrelMaterial.java @@ -26,7 +26,7 @@ import thedarkcolour.exdeorum.block.BarrelBlock; import java.util.HashSet; import java.util.Set; -public final class BarrelMaterial extends AbstractMaterial { +public class BarrelMaterial extends AbstractMaterial { public static final Set TRANSPARENT_BARRELS = new HashSet<>(); // Whether the barrel can hold hot fluids @@ -34,7 +34,7 @@ public final class BarrelMaterial extends AbstractMaterial { // Whether fluids should be rendered with sides instead of just the top public final boolean transparent; - BarrelMaterial(SoundType soundType, float strength, boolean needsCorrectTool, boolean fireproof, int mapColor, String requiredModId, boolean transparent) { + protected BarrelMaterial(SoundType soundType, float strength, boolean needsCorrectTool, boolean fireproof, int mapColor, String requiredModId, boolean transparent) { super(soundType, strength, needsCorrectTool, mapColor, requiredModId); this.fireproof = fireproof; @@ -43,7 +43,7 @@ public final class BarrelMaterial extends AbstractMaterial { @Override protected Block createBlock() { - var props = props(); + var props = props().noOcclusion(); if (!this.fireproof) props.ignitedByLava(); return new BarrelBlock(props); } diff --git a/src/main/java/thedarkcolour/exdeorum/material/DefaultMaterials.java b/src/main/java/thedarkcolour/exdeorum/material/DefaultMaterials.java index 62169dc5..3b0c4649 100644 --- a/src/main/java/thedarkcolour/exdeorum/material/DefaultMaterials.java +++ b/src/main/java/thedarkcolour/exdeorum/material/DefaultMaterials.java @@ -27,6 +27,8 @@ import thedarkcolour.exdeorum.compat.ModIds; public class DefaultMaterials { public static final MaterialRegistry BARRELS = new MaterialRegistry<>("barrel"); public static final MaterialRegistry SIEVES = new MaterialRegistry<>("sieve"); + public static final MaterialRegistry LAVA_CRUCIBLES = new MaterialRegistry<>("lava_crucible", "crucible"); + public static final MaterialRegistry WATER_CRUCIBLES = new MaterialRegistry<>("water_crucible", "crucible"); // Ex Deorum public static final BarrelMaterial OAK_BARREL = addDefaultWoodBarrel("oak", SoundType.WOOD, false, MapColor.WOOD, ExDeorum.ID); @@ -103,6 +105,52 @@ public class DefaultMaterials { public static final SieveMaterial MAPLE_SIEVE = addDefaultSieve("maple", SoundType.WOOD, ModIds.BLUE_SKIES); public static final SieveMaterial CRYSTALLIZED_SIEVE = addDefaultSieve("crystallized", SoundType.GLASS, true, ModIds.BLUE_SKIES); + // Ex Deorum + public static final LavaCrucibleMaterial PORCELAIN_CRUCIBLE = addDefaultLavaCrucible("porcelain", SoundType.STONE, 2.0f, false, MapColor.TERRACOTTA_WHITE, ExDeorum.ID); + public static final LavaCrucibleMaterial WARPED_CRUCIBLE = addDefaultLavaCrucible("warped", SoundType.STEM, 1.5f, false, MapColor.CRIMSON_STEM, ExDeorum.ID); + public static final LavaCrucibleMaterial CRIMSON_CRUCIBLE = addDefaultLavaCrucible("crimson", SoundType.STEM, 1.5f, false, MapColor.WARPED_STEM, ExDeorum.ID); + // Biomes O' Plenty + public static final LavaCrucibleMaterial HELLBARK_CRUCIBLE = addDefaultLavaCrucible("hellbark", SoundType.WOOD, 1.5f, false, MapColor.COLOR_LIGHT_GRAY, ModIds.BIOMES_O_PLENTY); + // Blue Skies + public static final LavaCrucibleMaterial CRYSTALLIZED_CRUCIBLE = addDefaultLavaCrucible("crystallized", SoundType.GLASS, 2.0f, true, MapColor.TERRACOTTA_WHITE, ModIds.BLUE_SKIES); + + // Ex Deorum + public static final WaterCrucibleMaterial OAK_CRUCIBLE = addDefaultWaterCrucible("oak", SoundType.WOOD, MapColor.WOOD, ExDeorum.ID); + public static final WaterCrucibleMaterial SPRUCE_CRUCIBLE = addDefaultWaterCrucible("spruce", SoundType.WOOD, MapColor.PODZOL, ExDeorum.ID); + public static final WaterCrucibleMaterial BIRCH_CRUCIBLE = addDefaultWaterCrucible("birch", SoundType.WOOD, MapColor.SAND, ExDeorum.ID); + public static final WaterCrucibleMaterial JUNGLE_CRUCIBLE = addDefaultWaterCrucible("jungle", SoundType.WOOD, MapColor.DIRT, ExDeorum.ID); + public static final WaterCrucibleMaterial ACACIA_CRUCIBLE = addDefaultWaterCrucible("acacia", SoundType.WOOD, MapColor.COLOR_ORANGE, ExDeorum.ID); + public static final WaterCrucibleMaterial DARK_OAK_CRUCIBLE = addDefaultWaterCrucible("dark_oak", SoundType.WOOD, MapColor.COLOR_BROWN, ExDeorum.ID); + public static final WaterCrucibleMaterial MANGROVE_CRUCIBLE = addDefaultWaterCrucible("mangrove", SoundType.WOOD, MapColor.COLOR_RED, ExDeorum.ID); + public static final WaterCrucibleMaterial CHERRY_CRUCIBLE = addDefaultWaterCrucible("cherry", SoundType.CHERRY_WOOD, MapColor.TERRACOTTA_WHITE, ExDeorum.ID); + public static final WaterCrucibleMaterial BAMBOO_CRUCIBLE = addDefaultWaterCrucible("bamboo", SoundType.BAMBOO_WOOD, MapColor.COLOR_YELLOW, ExDeorum.ID); + // Biomes O' Plenty + public static final WaterCrucibleMaterial FIR_CRUCIBLE = addDefaultWaterCrucible("fir", SoundType.WOOD, MapColor.TERRACOTTA_WHITE, ModIds.BIOMES_O_PLENTY); + public static final WaterCrucibleMaterial REDWOOD_CRUCIBLE = addDefaultWaterCrucible("redwood", SoundType.WOOD, MapColor.TERRACOTTA_ORANGE, ModIds.BIOMES_O_PLENTY); + public static final WaterCrucibleMaterial MAHOGANY_CRUCIBLE = addDefaultWaterCrucible("mahogany", SoundType.WOOD, MapColor.TERRACOTTA_PINK, ModIds.BIOMES_O_PLENTY); + public static final WaterCrucibleMaterial JACARANDA_CRUCIBLE = addDefaultWaterCrucible("jacaranda", SoundType.WOOD, MapColor.QUARTZ, ModIds.BIOMES_O_PLENTY); + public static final WaterCrucibleMaterial PALM_CRUCIBLE = addDefaultWaterCrucible("palm", SoundType.WOOD, MapColor.TERRACOTTA_YELLOW, ModIds.BIOMES_O_PLENTY); + public static final WaterCrucibleMaterial WILLOW_CRUCIBLE = addDefaultWaterCrucible("willow", SoundType.WOOD, MapColor.TERRACOTTA_LIGHT_GREEN, ModIds.BIOMES_O_PLENTY); + public static final WaterCrucibleMaterial DEAD_CRUCIBLE = addDefaultWaterCrucible("dead", SoundType.WOOD, MapColor.STONE, ModIds.BIOMES_O_PLENTY); + public static final WaterCrucibleMaterial MAGIC_CRUCIBLE = addDefaultWaterCrucible("magic", SoundType.WOOD, MapColor.COLOR_BLUE, ModIds.BIOMES_O_PLENTY); + public static final WaterCrucibleMaterial UMBRAN_CRUCIBLE = addDefaultWaterCrucible("umbran", SoundType.WOOD, MapColor.TERRACOTTA_BLUE, ModIds.BIOMES_O_PLENTY); + // Ars Nouveau + public static final WaterCrucibleMaterial CASCADING_ARCHWOOD_CRUCIBLE = addDefaultWaterCrucible("blue_archwood", SoundType.WOOD, MapColor.COLOR_LIGHT_BLUE, ModIds.ARS_NOUVEAU); + public static final WaterCrucibleMaterial BLAZING_ARCHWOOD_CRUCIBLE = addDefaultWaterCrucible("red_archwood", SoundType.WOOD, MapColor.COLOR_RED, ModIds.ARS_NOUVEAU); + public static final WaterCrucibleMaterial VEXING_ARCHWOOD_CRUCIBLE = addDefaultWaterCrucible("purple_archwood", SoundType.WOOD, MapColor.TERRACOTTA_PURPLE, ModIds.ARS_NOUVEAU); + public static final WaterCrucibleMaterial FLOURISHING_ARCHWOOD_CRUCIBLE = addDefaultWaterCrucible("green_archwood", SoundType.WOOD, MapColor.COLOR_GREEN, ModIds.ARS_NOUVEAU); + // Aether + public static final WaterCrucibleMaterial SKYROOT_CRUCIBLE = addDefaultWaterCrucible("skyroot", SoundType.WOOD, MapColor.WOOD, ModIds.AETHER); + public static final WaterCrucibleMaterial GOLDEN_OAK_CRUCIBLE = addDefaultWaterCrucible("golden_oak", SoundType.WOOD, MapColor.WOOD, ModIds.AETHER); + // Blue Skies + public static final WaterCrucibleMaterial BLUEBRIGHT_CRUCIBLE = addDefaultWaterCrucible("bluebright", SoundType.WOOD, MapColor.WOOD, ModIds.BLUE_SKIES); + public static final WaterCrucibleMaterial STARLIT_CRUCIBLE = addDefaultWaterCrucible("starlit", SoundType.WOOD, MapColor.WOOD, ModIds.BLUE_SKIES); + public static final WaterCrucibleMaterial FROSTBRIGHT_CRUCIBLE = addDefaultWaterCrucible("frostbright", SoundType.WOOD, MapColor.WOOD, ModIds.BLUE_SKIES); + public static final WaterCrucibleMaterial COMET_CRUCIBLE = addDefaultWaterCrucible("comet", SoundType.WOOD, MapColor.WOOD, ModIds.BLUE_SKIES); + public static final WaterCrucibleMaterial LUNAR_CRUCIBLE = addDefaultWaterCrucible("lunar", SoundType.WOOD, MapColor.WOOD, ModIds.BLUE_SKIES); + public static final WaterCrucibleMaterial DUSK_CRUCIBLE = addDefaultWaterCrucible("dusk", SoundType.WOOD, MapColor.WOOD, ModIds.BLUE_SKIES); + public static final WaterCrucibleMaterial MAPLE_CRUCIBLE = addDefaultWaterCrucible("maple", SoundType.WOOD, MapColor.WOOD, ModIds.BLUE_SKIES); + private static BarrelMaterial addDefaultWoodBarrel(String name, SoundType soundType, boolean fireproof, MapColor color, String requiredModId) { return addDefaultBarrel(name, soundType, 2.0f, false, fireproof, color, requiredModId, false); } @@ -123,9 +171,23 @@ public class DefaultMaterials { return material; } + private static LavaCrucibleMaterial addDefaultLavaCrucible(String name, SoundType soundType, float strength, boolean needsCorrectTool, MapColor color, String requiredModId) { + var material = new LavaCrucibleMaterial(soundType, strength, needsCorrectTool, color.id, requiredModId); + LAVA_CRUCIBLES.register(name, material); + return material; + } + + private static WaterCrucibleMaterial addDefaultWaterCrucible(String name, SoundType soundType, MapColor color, String requiredModId) { + var material = new WaterCrucibleMaterial(soundType, 1.5f, false, color.id, requiredModId); + WATER_CRUCIBLES.register(name, material); + return material; + } + // This call initializes the DefaultMaterials fields as well as searching for user-defined ones in the appropriate places public static void registerMaterials() { BARRELS.search(BarrelMaterial::readFromJson); SIEVES.search(SieveMaterial::readFromJson); + LAVA_CRUCIBLES.search(parser -> AbstractCrucibleMaterial.readFromJson(parser, LavaCrucibleMaterial::new)); + WATER_CRUCIBLES.search(parser -> AbstractCrucibleMaterial.readFromJson(parser, WaterCrucibleMaterial::new)); } } diff --git a/src/main/java/thedarkcolour/exdeorum/material/LavaCrucibleMaterial.java b/src/main/java/thedarkcolour/exdeorum/material/LavaCrucibleMaterial.java new file mode 100644 index 00000000..a6d6a117 --- /dev/null +++ b/src/main/java/thedarkcolour/exdeorum/material/LavaCrucibleMaterial.java @@ -0,0 +1,34 @@ +/* + * Ex Deorum + * Copyright (c) 2024 thedarkcolour + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package thedarkcolour.exdeorum.material; + +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.SoundType; +import thedarkcolour.exdeorum.block.LavaCrucibleBlock; + +public class LavaCrucibleMaterial extends AbstractCrucibleMaterial { + protected LavaCrucibleMaterial(SoundType soundType, float strength, boolean needsCorrectTool, int mapColor, String requiredModId) { + super(soundType, strength, needsCorrectTool, mapColor, requiredModId); + } + + @Override + protected Block createBlock() { + return new LavaCrucibleBlock(props().noOcclusion()); + } +} diff --git a/src/main/java/thedarkcolour/exdeorum/material/MaterialRegistry.java b/src/main/java/thedarkcolour/exdeorum/material/MaterialRegistry.java index 38e70594..89af4dbd 100644 --- a/src/main/java/thedarkcolour/exdeorum/material/MaterialRegistry.java +++ b/src/main/java/thedarkcolour/exdeorum/material/MaterialRegistry.java @@ -42,17 +42,23 @@ import java.util.stream.Stream; public class MaterialRegistry implements Iterable { private final List values = new ArrayList<>(); + private final String configSubfolder; private final String suffix; + public MaterialRegistry(String configSubfolder) { + this(configSubfolder, configSubfolder); + } + // Suffix should NOT start with an underscore - public MaterialRegistry(String suffix) { + public MaterialRegistry(String configSubfolder, String suffix) { + this.configSubfolder = configSubfolder; this.suffix = suffix; Preconditions.checkArgument(!suffix.startsWith("_")); } public void search(Function materialRegistrar) { - var configPath = Paths.get("config/exdeorum/" + this.suffix + "_materials"); + var configPath = Paths.get("config/exdeorum/" + this.configSubfolder + "_materials"); if (!DatagenModLoader.isRunningDataGen()) { if (CompostColors.createConfigFolder(configPath)) { @@ -85,10 +91,10 @@ public class MaterialRegistry implements Iterable public void register(String name, M material) { var id = name + "_" + this.suffix; - ExDeorum.LOGGER.info("Registered \"{}\" for {} material {}.json", id, this.suffix, name); + ExDeorum.LOGGER.info("Registered \"{}\" for {} material {}.json", id, this.configSubfolder, name); if (material.block != null) { - throw new IllegalStateException(this.suffix + " material with name " + name + " already registered: duplicate material?"); + throw new IllegalStateException(this.configSubfolder + " material with name " + name + " already registered: duplicate material?"); } material.block = EBlocks.BLOCKS.register(id, material::createBlock); diff --git a/src/main/java/thedarkcolour/exdeorum/material/SieveMaterial.java b/src/main/java/thedarkcolour/exdeorum/material/SieveMaterial.java index 8413529a..d7424fad 100644 --- a/src/main/java/thedarkcolour/exdeorum/material/SieveMaterial.java +++ b/src/main/java/thedarkcolour/exdeorum/material/SieveMaterial.java @@ -24,7 +24,7 @@ import org.jetbrains.annotations.Nullable; import thedarkcolour.exdeorum.block.SieveBlock; public class SieveMaterial extends AbstractMaterial { - public SieveMaterial(SoundType soundType, float strength, boolean needsCorrectTool, String requiredModId) { + protected SieveMaterial(SoundType soundType, float strength, boolean needsCorrectTool, String requiredModId) { super(soundType, strength, needsCorrectTool, 0, requiredModId); } diff --git a/src/main/java/thedarkcolour/exdeorum/material/WaterCrucibleMaterial.java b/src/main/java/thedarkcolour/exdeorum/material/WaterCrucibleMaterial.java new file mode 100644 index 00000000..9261d5e3 --- /dev/null +++ b/src/main/java/thedarkcolour/exdeorum/material/WaterCrucibleMaterial.java @@ -0,0 +1,34 @@ +/* + * Ex Deorum + * Copyright (c) 2024 thedarkcolour + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package thedarkcolour.exdeorum.material; + +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.SoundType; +import thedarkcolour.exdeorum.block.WaterCrucibleBlock; + +public class WaterCrucibleMaterial extends AbstractCrucibleMaterial { + protected WaterCrucibleMaterial(SoundType soundType, float strength, boolean needsCorrectTool, int mapColor, String requiredModId) { + super(soundType, strength, needsCorrectTool, mapColor, requiredModId); + } + + @Override + protected Block createBlock() { + return new WaterCrucibleBlock(props().noOcclusion()); + } +} diff --git a/src/main/java/thedarkcolour/exdeorum/registry/EBlockEntities.java b/src/main/java/thedarkcolour/exdeorum/registry/EBlockEntities.java index e54fa99a..98755cbd 100644 --- a/src/main/java/thedarkcolour/exdeorum/registry/EBlockEntities.java +++ b/src/main/java/thedarkcolour/exdeorum/registry/EBlockEntities.java @@ -30,52 +30,8 @@ public class EBlockEntities { public static final DeferredRegister> BLOCK_ENTITIES = DeferredRegister.create(ForgeRegistries.BLOCK_ENTITY_TYPES, ExDeorum.ID); public static final RegistryObject> INFESTED_LEAVES = BLOCK_ENTITIES.register("infested_leaves", () -> BlockEntityType.Builder.of(InfestedLeavesBlockEntity::new, EBlocks.INFESTED_LEAVES.get()).build(null)); - public static final RegistryObject> LAVA_CRUCIBLE = BLOCK_ENTITIES.register("lava_crucible", () -> BlockEntityType.Builder.of(LavaCrucibleBlockEntity::new, - EBlocks.WARPED_CRUCIBLE.get(), - EBlocks.CRIMSON_CRUCIBLE.get(), - EBlocks.PORCELAIN_CRUCIBLE.get(), - // BOP - EBlocks.HELLBARK_CRUCIBLE.get(), - // Blue Skies - EBlocks.CRYSTALLIZED_CRUCIBLE.get() - ).build(null)); - public static final RegistryObject> WATER_CRUCIBLE = BLOCK_ENTITIES.register("water_crucible", () -> BlockEntityType.Builder.of(WaterCrucibleBlockEntity::new, - EBlocks.OAK_CRUCIBLE.get(), - EBlocks.SPRUCE_CRUCIBLE.get(), - EBlocks.BIRCH_CRUCIBLE.get(), - EBlocks.JUNGLE_CRUCIBLE.get(), - EBlocks.ACACIA_CRUCIBLE.get(), - EBlocks.DARK_OAK_CRUCIBLE.get(), - EBlocks.MANGROVE_CRUCIBLE.get(), - EBlocks.CHERRY_CRUCIBLE.get(), - EBlocks.BAMBOO_CRUCIBLE.get(), - // BOP - EBlocks.FIR_CRUCIBLE.get(), - EBlocks.REDWOOD_CRUCIBLE.get(), - EBlocks.MAHOGANY_CRUCIBLE.get(), - EBlocks.JACARANDA_CRUCIBLE.get(), - EBlocks.PALM_CRUCIBLE.get(), - EBlocks.WILLOW_CRUCIBLE.get(), - EBlocks.DEAD_CRUCIBLE.get(), - EBlocks.MAGIC_CRUCIBLE.get(), - EBlocks.UMBRAN_CRUCIBLE.get(), - // Ars Nouveau - EBlocks.CASCADING_ARCHWOOD_CRUCIBLE.get(), - EBlocks.BLAZING_ARCHWOOD_CRUCIBLE.get(), - EBlocks.VEXING_ARCHWOOD_CRUCIBLE.get(), - EBlocks.FLOURISHING_ARCHWOOD_CRUCIBLE.get(), - // Aether - EBlocks.SKYROOT_CRUCIBLE.get(), - EBlocks.GOLDEN_OAK_CRUCIBLE.get(), - // Blue Skies - EBlocks.BLUEBRIGHT_CRUCIBLE.get(), - EBlocks.STARLIT_CRUCIBLE.get(), - EBlocks.FROSTBRIGHT_CRUCIBLE.get(), - EBlocks.COMET_CRUCIBLE.get(), - EBlocks.LUNAR_CRUCIBLE.get(), - EBlocks.DUSK_CRUCIBLE.get(), - EBlocks.MAPLE_CRUCIBLE.get() - ).build(null)); + public static final RegistryObject> LAVA_CRUCIBLE = BLOCK_ENTITIES.register("lava_crucible", () -> DefaultMaterials.LAVA_CRUCIBLES.createBlockEntityType(LavaCrucibleBlockEntity::new)); + public static final RegistryObject> WATER_CRUCIBLE = BLOCK_ENTITIES.register("water_crucible", () -> DefaultMaterials.WATER_CRUCIBLES.createBlockEntityType(WaterCrucibleBlockEntity::new)); public static final RegistryObject> BARREL = BLOCK_ENTITIES.register("barrel", () -> DefaultMaterials.BARRELS.createBlockEntityType(BarrelBlockEntity::new)); public static final RegistryObject> SIEVE = BLOCK_ENTITIES.register("sieve", () -> DefaultMaterials.SIEVES.createBlockEntityType(SieveBlockEntity::new)); public static final RegistryObject> MECHANICAL_SIEVE = BLOCK_ENTITIES.register("mechanical_sieve", () -> BlockEntityType.Builder.of(MechanicalSieveBlockEntity::new, EBlocks.MECHANICAL_SIEVE.get()).build(null)); diff --git a/src/main/java/thedarkcolour/exdeorum/registry/EBlocks.java b/src/main/java/thedarkcolour/exdeorum/registry/EBlocks.java index b0627c26..d243e72d 100644 --- a/src/main/java/thedarkcolour/exdeorum/registry/EBlocks.java +++ b/src/main/java/thedarkcolour/exdeorum/registry/EBlocks.java @@ -51,78 +51,9 @@ public class EBlocks { // Mechanical Hammer public static final RegistryObject MECHANICAL_HAMMER = BLOCKS.register("mechanical_hammer", () -> new MechanicalHammerBlock(of().mapColor(MapColor.METAL).requiresCorrectToolForDrops().strength(5f, 1200f))); - // Lava Crucibles - public static final RegistryObject PORCELAIN_CRUCIBLE = registerLavaCrucible("porcelain_crucible", true, SoundType.STONE); - public static final RegistryObject WARPED_CRUCIBLE = registerLavaCrucible("warped_crucible", false, SoundType.STEM); - public static final RegistryObject CRIMSON_CRUCIBLE = registerLavaCrucible("crimson_crucible", false, SoundType.STEM); - public static final RegistryObject UNFIRED_PORCELAIN_CRUCIBLE = BLOCKS.register("unfired_porcelain_crucible", () -> new UnfiredCrucibleBlock(of().strength(2.0f))); - // BOP Lava Crucibles - public static final RegistryObject HELLBARK_CRUCIBLE = registerLavaCrucible("hellbark_crucible", false, SoundType.WOOD); - // Blue Skies Lava Crucibles - public static final RegistryObject CRYSTALLIZED_CRUCIBLE = registerLavaCrucible("crystallized_crucible", true, SoundType.GLASS); - - // Water Crucibles - public static final RegistryObject OAK_CRUCIBLE = registerWaterCrucible("oak_crucible"); - public static final RegistryObject SPRUCE_CRUCIBLE = registerWaterCrucible("spruce_crucible"); - public static final RegistryObject BIRCH_CRUCIBLE = registerWaterCrucible("birch_crucible"); - public static final RegistryObject JUNGLE_CRUCIBLE = registerWaterCrucible("jungle_crucible"); - public static final RegistryObject ACACIA_CRUCIBLE = registerWaterCrucible("acacia_crucible"); - public static final RegistryObject DARK_OAK_CRUCIBLE = registerWaterCrucible("dark_oak_crucible"); - public static final RegistryObject MANGROVE_CRUCIBLE = registerWaterCrucible("mangrove_crucible"); - public static final RegistryObject CHERRY_CRUCIBLE = registerWaterCrucible("cherry_crucible"); - public static final RegistryObject BAMBOO_CRUCIBLE = registerWaterCrucible("bamboo_crucible"); - // BOP Water Crucibles - public static final RegistryObject FIR_CRUCIBLE = registerWaterCrucible("fir_crucible"); - public static final RegistryObject REDWOOD_CRUCIBLE = registerWaterCrucible("redwood_crucible"); - public static final RegistryObject MAHOGANY_CRUCIBLE = registerWaterCrucible("mahogany_crucible"); - public static final RegistryObject JACARANDA_CRUCIBLE = registerWaterCrucible("jacaranda_crucible"); - public static final RegistryObject PALM_CRUCIBLE = registerWaterCrucible("palm_crucible"); - public static final RegistryObject WILLOW_CRUCIBLE = registerWaterCrucible("willow_crucible"); - public static final RegistryObject DEAD_CRUCIBLE = registerWaterCrucible("dead_crucible"); - public static final RegistryObject MAGIC_CRUCIBLE = registerWaterCrucible("magic_crucible"); - public static final RegistryObject UMBRAN_CRUCIBLE = registerWaterCrucible("umbran_crucible"); - // Ars Nouveau Water Crucibles - public static final RegistryObject CASCADING_ARCHWOOD_CRUCIBLE = registerWaterCrucible("blue_archwood_crucible"); - public static final RegistryObject BLAZING_ARCHWOOD_CRUCIBLE = registerWaterCrucible("red_archwood_crucible"); - public static final RegistryObject VEXING_ARCHWOOD_CRUCIBLE = registerWaterCrucible("purple_archwood_crucible"); - public static final RegistryObject FLOURISHING_ARCHWOOD_CRUCIBLE = registerWaterCrucible("green_archwood_crucible"); - // Aether Crucibles - public static final RegistryObject SKYROOT_CRUCIBLE = registerWaterCrucible("skyroot_crucible"); - public static final RegistryObject GOLDEN_OAK_CRUCIBLE = registerWaterCrucible("golden_oak_crucible"); - // Blue Skies Crucibles - public static final RegistryObject BLUEBRIGHT_CRUCIBLE = registerWaterCrucible("bluebright_crucible"); - public static final RegistryObject STARLIT_CRUCIBLE = registerWaterCrucible("starlit_crucible"); - public static final RegistryObject FROSTBRIGHT_CRUCIBLE = registerWaterCrucible("frostbright_crucible"); - public static final RegistryObject COMET_CRUCIBLE = registerWaterCrucible("comet_crucible"); - public static final RegistryObject LUNAR_CRUCIBLE = registerWaterCrucible("lunar_crucible"); - public static final RegistryObject DUSK_CRUCIBLE = registerWaterCrucible("dusk_crucible"); - public static final RegistryObject MAPLE_CRUCIBLE = registerWaterCrucible("maple_crucible"); - // Misc + public static final RegistryObject UNFIRED_PORCELAIN_CRUCIBLE = BLOCKS.register("unfired_porcelain_crucible", () -> new UnfiredCrucibleBlock(of().strength(2.0f))); public static final RegistryObject INFESTED_LEAVES = BLOCKS.register("infested_leaves", () -> new InfestedLeavesBlock(copy(Blocks.OAK_LEAVES))); public static final RegistryObject WITCH_WATER = BLOCKS.register("witch_water", () -> new WitchWaterBlock(EFluids.WITCH_WATER, copy(Blocks.WATER).mapColor(MapColor.COLOR_PURPLE))); public static final RegistryObject END_CAKE = BLOCKS.register("end_cake", () -> new EndCakeBlock(of().noLootTable().mapColor(MapColor.COLOR_BLACK).forceSolidOn().strength(0.5F).sound(SoundType.WOOL).pushReaction(PushReaction.BLOCK))); - - public static RegistryObject registerSieve(String name) { - return registerSieve(name, SoundType.WOOD); - } - - public static RegistryObject registerSieve(String name, SoundType sound) { - return BLOCKS.register(name, () -> new SieveBlock(of().strength(2.0f).noOcclusion().sound(sound))); - } - - public static RegistryObject registerLavaCrucible(String name, boolean stone, SoundType sound) { - return BLOCKS.register(name, () -> { - var props = of().noOcclusion().strength(stone ? 2.0f : 1.5f).sound(sound); - if (stone) { - props.requiresCorrectToolForDrops(); - } - return new LavaCrucibleBlock(props); - }); - } - - public static RegistryObject registerWaterCrucible(String name) { - var bamboo = name.equals("bamboo_crucible"); - return BLOCKS.register(name, () -> new WaterCrucibleBlock(of().strength(1.5f).sound(bamboo ? SoundType.BAMBOO_WOOD : SoundType.WOOD))); - } } diff --git a/src/main/java/thedarkcolour/exdeorum/registry/EItems.java b/src/main/java/thedarkcolour/exdeorum/registry/EItems.java index 892fe53a..93fdda2c 100644 --- a/src/main/java/thedarkcolour/exdeorum/registry/EItems.java +++ b/src/main/java/thedarkcolour/exdeorum/registry/EItems.java @@ -28,7 +28,6 @@ import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; import net.minecraftforge.registries.RegistryObject; import thedarkcolour.exdeorum.ExDeorum; -import thedarkcolour.exdeorum.compat.ModIds; import thedarkcolour.exdeorum.item.*; import thedarkcolour.exdeorum.material.DefaultMaterials; import thedarkcolour.exdeorum.recipe.RecipeUtil; @@ -150,63 +149,13 @@ public class EItems { public static final RegistryObject MECHANICAL_SIEVE = registerItemBlock(EBlocks.MECHANICAL_SIEVE); public static final RegistryObject MECHANICAL_HAMMER = registerItemBlock(EBlocks.MECHANICAL_HAMMER); - // Lava Crucibles - public static final RegistryObject PORCELAIN_CRUCIBLE = registerItemBlock(EBlocks.PORCELAIN_CRUCIBLE); - public static final RegistryObject WARPED_CRUCIBLE = registerItemBlock(EBlocks.WARPED_CRUCIBLE); - public static final RegistryObject CRIMSON_CRUCIBLE = registerItemBlock(EBlocks.CRIMSON_CRUCIBLE); public static final RegistryObject UNFIRED_PORCELAIN_CRUCIBLE = registerItemBlock(EBlocks.UNFIRED_PORCELAIN_CRUCIBLE); - // BOP Lava Crucibles - public static final RegistryObject HELLBARK_CRUCIBLE = registerItemBlock(EBlocks.HELLBARK_CRUCIBLE); - // Blue Skies Lava Crucibles - public static final RegistryObject CRYSTALLIZED_CRUCIBLE = registerItemBlock(EBlocks.CRYSTALLIZED_CRUCIBLE); - - // Water Crucibles - public static final RegistryObject OAK_CRUCIBLE = registerItemBlock(EBlocks.OAK_CRUCIBLE); - public static final RegistryObject SPRUCE_CRUCIBLE = registerItemBlock(EBlocks.SPRUCE_CRUCIBLE); - public static final RegistryObject BIRCH_CRUCIBLE = registerItemBlock(EBlocks.BIRCH_CRUCIBLE); - public static final RegistryObject JUNGLE_CRUCIBLE = registerItemBlock(EBlocks.JUNGLE_CRUCIBLE); - public static final RegistryObject ACACIA_CRUCIBLE = registerItemBlock(EBlocks.ACACIA_CRUCIBLE); - public static final RegistryObject DARK_OAK_CRUCIBLE = registerItemBlock(EBlocks.DARK_OAK_CRUCIBLE); - public static final RegistryObject MANGROVE_CRUCIBLE = registerItemBlock(EBlocks.MANGROVE_CRUCIBLE); - public static final RegistryObject CHERRY_CRUCIBLE = registerItemBlock(EBlocks.CHERRY_CRUCIBLE); - public static final RegistryObject BAMBOO_CRUCIBLE = registerItemBlock(EBlocks.BAMBOO_CRUCIBLE); - // BOP Water Crucibles - public static final RegistryObject FIR_CRUCIBLE = registerItemBlock(EBlocks.FIR_CRUCIBLE); - public static final RegistryObject REDWOOD_CRUCIBLE = registerItemBlock(EBlocks.REDWOOD_CRUCIBLE); - public static final RegistryObject MAHOGANY_CRUCIBLE = registerItemBlock(EBlocks.MAHOGANY_CRUCIBLE); - public static final RegistryObject JACARANDA_CRUCIBLE = registerItemBlock(EBlocks.JACARANDA_CRUCIBLE); - public static final RegistryObject PALM_CRUCIBLE = registerItemBlock(EBlocks.PALM_CRUCIBLE); - public static final RegistryObject WILLOW_CRUCIBLE = registerItemBlock(EBlocks.WILLOW_CRUCIBLE); - public static final RegistryObject DEAD_CRUCIBLE = registerItemBlock(EBlocks.DEAD_CRUCIBLE); - public static final RegistryObject MAGIC_CRUCIBLE = registerItemBlock(EBlocks.MAGIC_CRUCIBLE); - public static final RegistryObject UMBRAN_CRUCIBLE = registerItemBlock(EBlocks.UMBRAN_CRUCIBLE); - // Ars Nouveau Water Crucibles - public static final RegistryObject CASCADING_ARCHWOOD_CRUCIBLE = registerItemBlock(EBlocks.CASCADING_ARCHWOOD_CRUCIBLE); - public static final RegistryObject BLAZING_ARCHWOOD_CRUCIBLE = registerItemBlock(EBlocks.BLAZING_ARCHWOOD_CRUCIBLE); - public static final RegistryObject VEXING_ARCHWOOD_CRUCIBLE = registerItemBlock(EBlocks.VEXING_ARCHWOOD_CRUCIBLE); - public static final RegistryObject FLOURISHING_ARCHWOOD_CRUCIBLE = registerItemBlock(EBlocks.FLOURISHING_ARCHWOOD_CRUCIBLE); - // Aether Water Crucibles - public static final RegistryObject SKYROOT_CRUCIBLE = registerItemBlock(EBlocks.SKYROOT_CRUCIBLE); - public static final RegistryObject GOLDEN_OAK_CRUCIBLE = registerItemBlock(EBlocks.GOLDEN_OAK_CRUCIBLE); - // Blue Skies Water Crucibles - public static final RegistryObject BLUEBRIGHT_CRUCIBLE = registerItemBlock(EBlocks.BLUEBRIGHT_CRUCIBLE); - public static final RegistryObject STARLIT_CRUCIBLE = registerItemBlock(EBlocks.STARLIT_CRUCIBLE); - public static final RegistryObject FROSTBRIGHT_CRUCIBLE = registerItemBlock(EBlocks.FROSTBRIGHT_CRUCIBLE); - public static final RegistryObject COMET_CRUCIBLE = registerItemBlock(EBlocks.COMET_CRUCIBLE); - public static final RegistryObject LUNAR_CRUCIBLE = registerItemBlock(EBlocks.LUNAR_CRUCIBLE); - public static final RegistryObject DUSK_CRUCIBLE = registerItemBlock(EBlocks.DUSK_CRUCIBLE); - public static final RegistryObject MAPLE_CRUCIBLE = registerItemBlock(EBlocks.MAPLE_CRUCIBLE); public static final RegistryObject END_CAKE = registerItemBlock(EBlocks.END_CAKE); public static final RegistryObject INFESTED_LEAVES = registerItemBlock(EBlocks.INFESTED_LEAVES); public static void addItemsToMainTab(CreativeModeTab.Output output) { - boolean biomesOPlenty = ModList.get().isLoaded(ModIds.BIOMES_O_PLENTY); - boolean arsNouveau = ModList.get().isLoaded(ModIds.ARS_NOUVEAU); - boolean aether = ModList.get().isLoaded(ModIds.AETHER); - boolean blueSkies = ModList.get().isLoaded(ModIds.BLUE_SKIES); - for (var material : DefaultMaterials.BARRELS) { if (ModList.get().isLoaded(material.requiredModId)) { output.accept(material.getItem()); @@ -222,55 +171,16 @@ public class EItems { output.accept(MECHANICAL_SIEVE.get()); output.accept(MECHANICAL_HAMMER.get()); - output.accept(PORCELAIN_CRUCIBLE.get()); - output.accept(WARPED_CRUCIBLE.get()); - output.accept(CRIMSON_CRUCIBLE.get()); output.accept(UNFIRED_PORCELAIN_CRUCIBLE.get()); - if (biomesOPlenty) { - output.accept(HELLBARK_CRUCIBLE.get()); + for (var material : DefaultMaterials.LAVA_CRUCIBLES) { + if (ModList.get().isLoaded(material.requiredModId)) { + output.accept(material.getItem()); + } } - if (blueSkies) { - output.accept(CRYSTALLIZED_CRUCIBLE.get()); - } - output.accept(OAK_CRUCIBLE.get()); - output.accept(SPRUCE_CRUCIBLE.get()); - output.accept(BIRCH_CRUCIBLE.get()); - output.accept(JUNGLE_CRUCIBLE.get()); - output.accept(ACACIA_CRUCIBLE.get()); - output.accept(DARK_OAK_CRUCIBLE.get()); - output.accept(MANGROVE_CRUCIBLE.get()); - output.accept(CHERRY_CRUCIBLE.get()); - output.accept(BAMBOO_CRUCIBLE.get()); - - if (biomesOPlenty) { - output.accept(FIR_CRUCIBLE.get()); - output.accept(REDWOOD_CRUCIBLE.get()); - output.accept(MAHOGANY_CRUCIBLE.get()); - output.accept(JACARANDA_CRUCIBLE.get()); - output.accept(PALM_CRUCIBLE.get()); - output.accept(WILLOW_CRUCIBLE.get()); - output.accept(DEAD_CRUCIBLE.get()); - output.accept(MAGIC_CRUCIBLE.get()); - output.accept(UMBRAN_CRUCIBLE.get()); - } - if (arsNouveau) { - output.accept(CASCADING_ARCHWOOD_CRUCIBLE.get()); - output.accept(BLAZING_ARCHWOOD_CRUCIBLE.get()); - output.accept(VEXING_ARCHWOOD_CRUCIBLE.get()); - output.accept(FLOURISHING_ARCHWOOD_CRUCIBLE.get()); - } - if (aether) { - output.accept(SKYROOT_CRUCIBLE.get()); - output.accept(GOLDEN_OAK_CRUCIBLE.get()); - } - if (blueSkies) { - output.accept(BLUEBRIGHT_CRUCIBLE.get()); - output.accept(STARLIT_CRUCIBLE.get()); - output.accept(FROSTBRIGHT_CRUCIBLE.get()); - output.accept(COMET_CRUCIBLE.get()); - output.accept(LUNAR_CRUCIBLE.get()); - output.accept(DUSK_CRUCIBLE.get()); - output.accept(MAPLE_CRUCIBLE.get()); + for (var material : DefaultMaterials.WATER_CRUCIBLES) { + if (ModList.get().isLoaded(material.requiredModId)) { + output.accept(material.getItem()); + } } output.accept(DUST.get());