From bca6a74e9a17e04de419743850f66af96a6473cc Mon Sep 17 00:00:00 2001 From: Uko Kokņevičs Date: Thu, 11 Jan 2024 23:11:27 +0100 Subject: Move default emc values to JSON files in datapack --- src/main/java/lv/enes/mc/eris_alchemy/EMC.java | 600 --------------------- src/main/java/lv/enes/mc/eris_alchemy/Emc.java | 214 ++++++++ .../java/lv/enes/mc/eris_alchemy/EmcLoader.java | 99 ++++ .../java/lv/enes/mc/eris_alchemy/ErisAlchemy.java | 11 + .../lv/enes/mc/eris_alchemy/SimplifiedRecipe.java | 89 +++ .../eris_alchemy/block/EnergyCondenserBlock.java | 4 +- .../block/entity/EnergyCondenserEntity.java | 6 +- .../eris_alchemy/client/EnergyCondenserScreen.java | 4 +- .../mc/eris_alchemy/client/ErisAlchemyClient.java | 11 +- .../mc/eris_alchemy/mixin/CoralBlockMixin.java | 20 - .../mc/eris_alchemy/mixin/CoralFanBlockMixin.java | 20 - .../eris_alchemy/mixin/CoralPlantBlockMixin.java | 20 - .../eris_alchemy/mixin/CoralWallFanBlockMixin.java | 20 - .../lv/enes/mc/eris_alchemy/utils/AxeUtils.java | 18 - .../lv/enes/mc/eris_alchemy/utils/BlockUtils.java | 15 - .../lv/enes/mc/eris_alchemy/utils/CoralUtils.java | 44 -- .../lv/enes/mc/eris_alchemy/utils/DyeUtils.java | 62 --- .../lv/enes/mc/eris_alchemy/utils/ItemUtils.java | 20 +- .../lv/enes/mc/eris_alchemy/utils/TagUtils.java | 16 - .../eris_alchemy/block_tag_emcs/minecraft.json | 5 + .../eris_alchemy/fake_recipes/fake_recipes.json5 | 562 +++++++++++++++++++ .../eris_alchemy/item_emcs/minecraft.json | 307 +++++++++++ .../eris_alchemy/item_emcs/patchouli.json | 3 + .../eris_alchemy/item_tag_emcs/minecraft.json | 20 + src/main/resources/eris_alchemy.mixins.json | 4 - 25 files changed, 1338 insertions(+), 856 deletions(-) delete mode 100644 src/main/java/lv/enes/mc/eris_alchemy/EMC.java create mode 100644 src/main/java/lv/enes/mc/eris_alchemy/Emc.java create mode 100644 src/main/java/lv/enes/mc/eris_alchemy/EmcLoader.java create mode 100644 src/main/java/lv/enes/mc/eris_alchemy/SimplifiedRecipe.java delete mode 100644 src/main/java/lv/enes/mc/eris_alchemy/mixin/CoralBlockMixin.java delete mode 100644 src/main/java/lv/enes/mc/eris_alchemy/mixin/CoralFanBlockMixin.java delete mode 100644 src/main/java/lv/enes/mc/eris_alchemy/mixin/CoralPlantBlockMixin.java delete mode 100644 src/main/java/lv/enes/mc/eris_alchemy/mixin/CoralWallFanBlockMixin.java delete mode 100644 src/main/java/lv/enes/mc/eris_alchemy/utils/AxeUtils.java delete mode 100644 src/main/java/lv/enes/mc/eris_alchemy/utils/BlockUtils.java delete mode 100644 src/main/java/lv/enes/mc/eris_alchemy/utils/CoralUtils.java delete mode 100644 src/main/java/lv/enes/mc/eris_alchemy/utils/DyeUtils.java delete mode 100644 src/main/java/lv/enes/mc/eris_alchemy/utils/TagUtils.java create mode 100644 src/main/resources/data/eris_alchemy/eris_alchemy/block_tag_emcs/minecraft.json create mode 100644 src/main/resources/data/eris_alchemy/eris_alchemy/fake_recipes/fake_recipes.json5 create mode 100644 src/main/resources/data/eris_alchemy/eris_alchemy/item_emcs/minecraft.json create mode 100644 src/main/resources/data/eris_alchemy/eris_alchemy/item_emcs/patchouli.json create mode 100644 src/main/resources/data/eris_alchemy/eris_alchemy/item_tag_emcs/minecraft.json diff --git a/src/main/java/lv/enes/mc/eris_alchemy/EMC.java b/src/main/java/lv/enes/mc/eris_alchemy/EMC.java deleted file mode 100644 index 92c0624..0000000 --- a/src/main/java/lv/enes/mc/eris_alchemy/EMC.java +++ /dev/null @@ -1,600 +0,0 @@ -package lv.enes.mc.eris_alchemy; - -import jakarta.annotation.Nullable; -import lv.enes.mc.eris_alchemy.utils.*; -import lv.enes.mc.eris_alchemy.utils.ItemUtils; -import net.minecraft.core.RegistryAccess; -import net.minecraft.core.registries.BuiltInRegistries; -import net.minecraft.tags.BlockTags; -import net.minecraft.tags.ItemTags; -import net.minecraft.tags.TagKey; -import net.minecraft.world.item.*; -import net.minecraft.world.item.crafting.Ingredient; -import net.minecraft.world.item.crafting.Recipe; -import net.minecraft.world.level.ItemLike; -import net.minecraft.world.level.Level; -import net.minecraft.world.level.block.Block; -import vazkii.patchouli.common.item.PatchouliItems; - -import java.text.DecimalFormat; -import java.util.*; -import java.util.stream.Stream; - -public class EMC { - private record SimplifiedRecipe(ItemStack output, List remainder, List inputs) { - public SimplifiedRecipe(ItemLike output, Ingredient... inputs) { - this(new ItemStack(output), List.of(), List.of(inputs)); - } - - public SimplifiedRecipe(ItemLike output, ItemLike... inputs) { - this(new ItemStack(output), List.of(), Arrays.stream(inputs).map(Ingredient::of).toList()); - } - - public SimplifiedRecipe(ItemLike output, ItemStack... inputs) { - this(new ItemStack(output), List.of(), Arrays.stream(inputs).map(Ingredient::of).toList()); - } - - public SimplifiedRecipe(ItemLike output, List remainder, ItemLike... inputs) { - this(new ItemStack(output), remainder, Arrays.stream(inputs).map(Ingredient::of).toList()); - } - - public SimplifiedRecipe(ItemStack output, ItemLike... inputs) { - this(output, List.of(), Arrays.stream(inputs).map(Ingredient::of).toList()); - } - - public SimplifiedRecipe(ItemStack output, ItemStack... inputs) { - this(output, List.of(), Arrays.stream(inputs).map(Ingredient::of).toList()); - } - - public SimplifiedRecipe(Recipe recipe, RegistryAccess registryAccess) { - this( - RecipeUtils.getOutput(recipe, registryAccess), - List.of(), // TODO: - RecipeUtils.getIngredients(recipe).stream().filter(ingredient -> !ingredient.isEmpty()).toList() - ); - } - } - - private static final Map ITEM_COMMON_MAP = new HashMap<>(); - private static final Map, Double> ITEM_TAG_COMMON_MAP = new HashMap<>(); - private static final Map, Double> BLOCK_TAG_COMMON_MAP = new HashMap<>(); - private static final List FAKE_RECIPES = new ArrayList<>(); - - private static final EMC defaultInstance = new EMC(null); - private static final Map instances = Collections.synchronizedMap(new WeakHashMap<>()); - - private static final DecimalFormat formatter = new DecimalFormat("0"); - static { - formatter.setMaximumFractionDigits(1); - } - - public static EMC getInstance(Level world) { - if (world == null) { - return defaultInstance; - } - - if (instances.containsKey(world)) { - return instances.get(world); - } - - var instance = new EMC(world); - instances.put(world, instance); - return instance; - } - - public static String formatEmc(double value) { - return formatter.format(value); - } - - private final Map data; - - private EMC(@Nullable Level world) { - data = Collections.synchronizedMap(new HashMap<>(ITEM_COMMON_MAP)); - ITEM_TAG_COMMON_MAP.forEach( - (tag, emcValue) -> BuiltInRegistries.ITEM - .getTagOrEmpty(tag) - .forEach(holder -> data.putIfAbsent(holder.value(), emcValue)) - ); - BLOCK_TAG_COMMON_MAP.forEach( - (tag, emcValue) -> BuiltInRegistries.BLOCK - .getTagOrEmpty(tag) - .forEach(holder -> data.putIfAbsent(holder.value().asItem(), emcValue)) - ); - - ErisAlchemy.LOGGER.info("Calculating EMC values..."); - var recipes = getRecipes(world); - var configured = new HashSet<>(data.keySet()); - BuiltInRegistries.ITEM.forEach(item -> { - configEmc(recipes, configured, item); - if (world != null && !data.containsKey(item)) { - ErisAlchemy.LOGGER.warn("No EMC value for '{}' known", item); - } - }); - } - - public OptionalDouble get(ItemStack stack) { - if (stack.isEmpty()) { - return OptionalDouble.empty(); - } - - var item = stack.getItem(); - var value = data.get(item); - if (value == null || value <= 0) { - return OptionalDouble.empty(); - } - - EmcStorage storage = null; - if (item instanceof EmcStorage emcStorage) { - storage = emcStorage; - } else if (item instanceof BlockItem blockItem) { - if (blockItem.getBlock() instanceof EmcStorage emcStorage) { - storage = emcStorage; - } - } - - if (storage != null) { - value += storage.getStoredEmc(stack); - } - - return OptionalDouble.of(value); - } - - private List getRecipes(@Nullable Level world) { - Stream recipes = Stream.concat( - FAKE_RECIPES.stream(), - AxeUtils.getStrippables() - .entrySet() - .stream() - .map(entry -> new SimplifiedRecipe(entry.getValue(), Ingredient.of(entry.getKey()))) - ); - - if (world != null) { - recipes = Stream.concat( - recipes, - world.getRecipeManager() - .getRecipes() - .stream() - .map(recipe -> new SimplifiedRecipe(recipe, world.registryAccess())) - ); - } - - return recipes.toList(); - } - - private OptionalDouble configEmc(List recipes, Set configured, Item item) { - var res = get(item.getDefaultInstance()); - if (res.isPresent() || configured.contains(item)) { - return res; - } - - configured.add(item); - - res = recipes.stream() - .filter(recipe -> recipe.output.is(item)) - .map(recipe -> calculateEmcForRecipe(recipes, configured, recipe)) - .filter(OptionalDouble::isPresent) - .mapToDouble(OptionalDouble::getAsDouble) - .average(); - res.ifPresent(emc -> data.put(item, emc)); - if (res.isPresent() && res.getAsDouble() <= 0) { - res = OptionalDouble.empty(); - } - return res; - } - - private OptionalDouble calculateEmcForRecipe( - List recipes, - Set configured, - SimplifiedRecipe recipe - ) { - try { - if (recipe.inputs.isEmpty()) { - return OptionalDouble.empty(); - } - - var inputEmc = recipe.inputs - .stream() - .map(ingredient -> calculateEmcForIngredient(recipes, configured, ingredient)) - .mapToDouble(OptionalDouble::orElseThrow) - .sum(); - - if (inputEmc <= 0) { - return OptionalDouble.empty(); - } - - var remainderEmc = recipe.remainder - .stream() - .map(remainder -> configEmc(recipes, configured, remainder.getItem())) - .mapToDouble(OptionalDouble::orElseThrow) - .sum(); - - if (remainderEmc > inputEmc) { - ErisAlchemy.LOGGER.warn("Recipe generating {} creates too much EMC out of thin air!", recipe.output); - return OptionalDouble.empty(); - } else if (remainderEmc < 0) { - return OptionalDouble.empty(); - } - - var outputDivisor = (double) recipe.output.getCount(); - - return OptionalDouble.of((inputEmc - remainderEmc) / outputDivisor); - } catch (NoSuchElementException e) { - return OptionalDouble.empty(); - } - } - - private OptionalDouble calculateEmcForIngredient( - List recipes, - Set configured, - Ingredient ingredient - ) { - return Arrays.stream(ingredient.getItems()) - .map(stack -> configEmc(recipes, configured, stack.getItem()).stream() - .map(x -> x * stack.getCount()) - .findFirst()) - .filter(OptionalDouble::isPresent) - .mapToDouble(OptionalDouble::getAsDouble) - .filter(x -> x > 0) - .average(); - } - - static { - ITEM_COMMON_MAP.putAll(Map.ofEntries( - Map.entry(Items.AIR, -1.0), - Map.entry(Items.AMETHYST_CLUSTER, -1.0), - Map.entry(Items.AMETHYST_SHARD, 1024.0), - Map.entry(Items.ANCIENT_DEBRIS, -1.0), - Map.entry(Items.APPLE, 128.0), - Map.entry(Items.BAMBOO, 2.0), - Map.entry(Items.BARRIER, -1.0), - Map.entry(Items.BEDROCK, -1.0), - Map.entry(Items.BEEF, 64.0), - Map.entry(Items.BEETROOT, 24.0), - Map.entry(Items.BEETROOT_SEEDS, 16.0), - Map.entry(Items.BIG_DRIPLEAF, 1.0), - Map.entry(Items.BLAZE_ROD, 1536.0), - Map.entry(Items.BONE, 96.0), - Map.entry(Items.BROWN_MUSHROOM, 32.0), - Map.entry(Items.BROWN_MUSHROOM_BLOCK, -1.0), - Map.entry(Items.BUDDING_AMETHYST, -1.0), - Map.entry(Items.BUNDLE, -1.0), - Map.entry(Items.CACTUS, 8.0), - Map.entry(Items.CARROT, 24.0), - Map.entry(Items.CALCITE, 1.0), - Map.entry(Items.CHAIN_COMMAND_BLOCK, -1.0), - Map.entry(Items.CHICKEN, 64.0), - Map.entry(Items.CHORUS_FLOWER, 32.0), - Map.entry(Items.CHORUS_FRUIT, 32.0), - Map.entry(Items.CHORUS_PLANT, 24.0), - Map.entry(Items.CLAY_BALL, 64.0), - Map.entry(Items.COAL, 128.0), - Map.entry(Items.COBWEB, 12.0), - Map.entry(Items.COBBLESTONE, 1.0), - Map.entry(Items.COBBLED_DEEPSLATE, 1.0), - Map.entry(Items.COCOA_BEANS, 8.0), - Map.entry(Items.COMMAND_BLOCK, -1.0), - Map.entry(Items.COMMAND_BLOCK_MINECART, -1.0), - Map.entry(Items.COPPER_INGOT, 85.0), - Map.entry(Items.CREEPER_HEAD, 34816.0), - Map.entry(Items.CRIMSON_FUNGUS, 24.0), - Map.entry(Items.CRIMSON_ROOTS, 1.0), - Map.entry(Items.CRYING_OBSIDIAN, 64.0), - Map.entry(Items.DEAD_BUSH, 1.0), - Map.entry(Items.DEBUG_STICK, -1.0), - Map.entry(Items.DIAMOND, 8192.0), - Map.entry(Items.DIRT_PATH, 1.0), - Map.entry(Items.DRAGON_BREATH, 34816.0), - Map.entry(Items.DRAGON_EGG, 139264.0), - Map.entry(Items.DRAGON_HEAD, 34816.0), - Map.entry(Items.ECHO_SHARD, 128.0), - Map.entry(Items.EGG, 32.0), - Map.entry(Items.ELYTRA, 8196.0), - Map.entry(Items.EMERALD, 1024.0), - Map.entry(Items.ENCHANTED_BOOK, -1.0), - Map.entry(Items.END_PORTAL_FRAME, -1.0), - Map.entry(Items.END_STONE, 1.0), - Map.entry(Items.ENDER_PEARL, 1024.0), - Map.entry(Items.EXPERIENCE_BOTTLE, -1.0), - Map.entry(Items.FARMLAND, -1.0), - Map.entry(Items.FEATHER, 48.0), - Map.entry(Items.FERN, 1.0), - Map.entry(Items.FIREWORK_STAR, -1.0), - Map.entry(Items.FLINT, 4.0), - Map.entry(Items.FROGSPAWN, -1.0), - Map.entry(Items.GHAST_TEAR, 4096.0), - Map.entry(Items.GLOW_BERRIES, 8.0), - Map.entry(Items.GLOW_LICHEN, 8.0), - Map.entry(Items.GLOWSTONE_DUST, 384.0), - Map.entry(Items.GOAT_HORN, 32.0), - Map.entry(Items.GOLD_INGOT, 2048.0), - Map.entry(Items.GOLD_NUGGET, 2048.0/9), - Map.entry(Items.GRASS, 1.0), - Map.entry(Items.GRAVEL, 4.0), - Map.entry(Items.GUNPOWDER, 192.0), - Map.entry(Items.HANGING_ROOTS, 1.0), - Map.entry(Items.HEART_OF_THE_SEA, 4096.0), - Map.entry(Items.HONEYCOMB, 24.0), - Map.entry(Items.ICE, 1.0), - Map.entry(Items.INFESTED_CHISELED_STONE_BRICKS, -1.0), - Map.entry(Items.INFESTED_COBBLESTONE, -1.0), - Map.entry(Items.INFESTED_CRACKED_STONE_BRICKS, -1.0), - Map.entry(Items.INFESTED_DEEPSLATE, -1.0), - Map.entry(Items.INFESTED_MOSSY_STONE_BRICKS, -1.0), - Map.entry(Items.INFESTED_STONE, -1.0), - Map.entry(Items.INFESTED_STONE_BRICKS, -1.0), - Map.entry(Items.IRON_INGOT, 256.0), - Map.entry(Items.IRON_NUGGET, 256.0/9), - Map.entry(Items.JIGSAW, -1.0), - Map.entry(Items.KELP, 32.0), - Map.entry(Items.KNOWLEDGE_BOOK, -1.0), - Map.entry(Items.LAPIS_LAZULI, 864.0), - Map.entry(Items.LARGE_AMETHYST_BUD, -1.0), - Map.entry(Items.LARGE_FERN, 1.0), - Map.entry(Items.LEATHER, 64.0), - Map.entry(Items.LIGHT, -1.0), - Map.entry(Items.LILY_PAD, 16.0), - Map.entry(Items.LINGERING_POTION, -1.0), - Map.entry(Items.MANGROVE_ROOTS, 1.0), - Map.entry(Items.MEDIUM_AMETHYST_BUD, -1.0), - Map.entry(Items.MELON_SLICE, 144.0), - Map.entry(Items.MUD, 1.0), - Map.entry(Items.MUSHROOM_STEM, -1.0), - Map.entry(Items.MUTTON, 64.0), - Map.entry(Items.NAME_TAG, -1.0), - Map.entry(Items.NAUTILUS_SHELL, 64.0), - Map.entry(Items.NETHER_QUARTZ_ORE, -1.0), - Map.entry(Items.NETHER_SPROUTS, 1.0), - Map.entry(Items.NETHER_STAR, 139264.0), - Map.entry(Items.NETHER_WART, 24.0), - Map.entry(Items.NETHERITE_SCRAP, 16384.0), - Map.entry(Items.OBSIDIAN, 64.0), - Map.entry(Items.PHANTOM_MEMBRANE, 96.0), - Map.entry(Items.PIGLIN_HEAD, 34816.0), - Map.entry(Items.PITCHER_POD, 8.0), - Map.entry(Items.PLAYER_HEAD, 34816.0), - Map.entry(Items.POINTED_DRIPSTONE, 0.25), - Map.entry(Items.PORKCHOP, 64.0), - Map.entry(Items.POTATO, 24.0), - Map.entry(Items.POTION, -1.0), - Map.entry(Items.PRISMARINE_CRYSTALS, 384.0), - Map.entry(Items.PRISMARINE_SHARD, 0.25), - Map.entry(Items.PUMPKIN, 144.0), - Map.entry(Items.QUARTZ, 64.0), - Map.entry(Items.RABBIT, 64.0), - Map.entry(Items.RABBIT_HIDE, 64.0), - Map.entry(Items.RAW_COPPER, -1.0), - Map.entry(Items.RAW_COPPER_BLOCK, -1.0), - Map.entry(Items.RAW_GOLD, -1.0), - Map.entry(Items.RAW_GOLD_BLOCK, -1.0), - Map.entry(Items.RAW_IRON, -1.0), - Map.entry(Items.RAW_IRON_BLOCK, -1.0), - Map.entry(Items.RED_MUSHROOM, 32.0), - Map.entry(Items.RED_MUSHROOM_BLOCK, -1.0), - Map.entry(Items.REDSTONE, 64.0), - Map.entry(Items.REINFORCED_DEEPSLATE, -1.0), - Map.entry(Items.REPEATING_COMMAND_BLOCK, -1.0), - Map.entry(Items.ROTTEN_FLESH, 24.0), - Map.entry(Items.SADDLE, 192.0), - Map.entry(Items.SCULK, 1.0), - Map.entry(Items.SCULK_CATALYST, 16.0), - Map.entry(Items.SCULK_SENSOR, 32.0), - Map.entry(Items.SCULK_SHRIEKER, 16.0), - Map.entry(Items.SCULK_VEIN, 1.0), - Map.entry(Items.SCUTE, 32.0), - Map.entry(Items.SEA_PICKLE, 1.0), - Map.entry(Items.SEAGRASS, 1.0), - Map.entry(Items.SHULKER_SHELL, 256.0), - Map.entry(Items.SKELETON_SKULL, 34816.0), - Map.entry(Items.SLIME_BALL, 24.0), - Map.entry(Items.SMALL_AMETHYST_BUD, -1.0), - Map.entry(Items.SMALL_DRIPLEAF, 1.0), - Map.entry(Items.SNIFFER_EGG, 32.0), - Map.entry(Items.SNOWBALL, 1.0), - Map.entry(Items.SOUL_SAND, 49.0), - Map.entry(Items.SOUL_SOIL, 49.0), - Map.entry(Items.SPAWNER, -1.0), - Map.entry(Items.SPIDER_EYE, 128.0), - Map.entry(Items.SPLASH_POTION, -1.0), - Map.entry(Items.SPONGE, 48.0), - Map.entry(Items.SPORE_BLOSSOM, 1.0), - Map.entry(Items.STICK, 4.0), - Map.entry(Items.STRING, 12.0), - Map.entry(Items.STRUCTURE_BLOCK, -1.0), - Map.entry(Items.STRUCTURE_VOID, -1.0), - Map.entry(Items.SUGAR_CANE, 32.0), - Map.entry(Items.SUSPICIOUS_GRAVEL, 4.0), - Map.entry(Items.SWEET_BERRIES, 8.0), - Map.entry(Items.TALL_GRASS, 1.0), - Map.entry(Items.TIPPED_ARROW, -1.0), - Map.entry(Items.TORCHFLOWER_SEEDS, 8.0), - Map.entry(Items.TOTEM_OF_UNDYING, 4096.0), - Map.entry(Items.TURTLE_EGG, 32.0), - Map.entry(Items.TWISTING_VINES, 8.0), - Map.entry(Items.VINE, 8.0), - Map.entry(Items.WARPED_FUNGUS, 24.0), - Map.entry(Items.WARPED_ROOTS, 1.0), - Map.entry(Items.WARPED_WART_BLOCK, 1.0), - Map.entry(Items.WEEPING_VINES, 8.0), - Map.entry(Items.WET_SPONGE, 48.0), - Map.entry(Items.WHEAT, 24.0), - Map.entry(Items.WHEAT_SEEDS, 16.0), - Map.entry(Items.WITHER_SKELETON_SKULL, 34816.0), - Map.entry(Items.WRITTEN_BOOK, -1.0), - Map.entry(Items.ZOMBIE_HEAD, 34816.0), - - Map.entry(PatchouliItems.BOOK, -1.0) - )); - - SpawnEggItem.eggs().forEach(spawnEgg -> ITEM_COMMON_MAP.put(spawnEgg, -1.0)); - - CoralUtils.streamAllCoralBlocks().forEach(block -> ITEM_COMMON_MAP.put(block.asItem(), 1.0)); - CoralUtils.streamAllDeadCoralBlocks().forEach(block -> ITEM_COMMON_MAP.put(block.asItem(), 1.0)); - CoralUtils.streamAllCorals().forEach(block -> ITEM_COMMON_MAP.put(block.asItem(), 1.0)); - CoralUtils.streamAllDeadCorals().forEach(block -> ITEM_COMMON_MAP.put(block.asItem(), 1.0)); - - BLOCK_TAG_COMMON_MAP.putAll(Map.ofEntries( - Map.entry(BlockTags.BASE_STONE_NETHER, 1.0), - Map.entry(BlockTags.BASE_STONE_OVERWORLD, 1.0), - Map.entry(BlockTags.NYLIUM, 1.0) - )); - - ITEM_TAG_COMMON_MAP.putAll(Map.ofEntries( - Map.entry(ItemTags.COAL_ORES, -1.0), - Map.entry(ItemTags.COPPER_ORES, -1.0), - Map.entry(ItemTags.DIAMOND_ORES, -1.0), - Map.entry(ItemTags.DIRT, 1.0), - Map.entry(ItemTags.MUSIC_DISCS, 4096.0), - Map.entry(ItemTags.EMERALD_ORES, -1.0), - Map.entry(ItemTags.FISHES, 64.0), - Map.entry(ItemTags.FLOWERS, 16.0), - Map.entry(ItemTags.GOLD_ORES, -1.0), - Map.entry(ItemTags.IRON_ORES, -1.0), - Map.entry(ItemTags.LAPIS_ORES, -1.0), - Map.entry(ItemTags.LEAVES, 1.0), - Map.entry(ItemTags.LOGS, 32.0), - Map.entry(ItemTags.REDSTONE_ORES, -1.0), - Map.entry(ItemTags.SAND, 1.0), - Map.entry(ItemTags.SAPLINGS, 32.0), - Map.entry(ItemTags.WOOL, 48.0) - )); - - FAKE_RECIPES.addAll(List.of( - // more oxidised coppers are worth less - new SimplifiedRecipe(new ItemStack(Items.EXPOSED_COPPER, 4), new ItemStack(Items.COPPER_BLOCK, 3)), - new SimplifiedRecipe(new ItemStack(Items.WEATHERED_COPPER, 4), new ItemStack(Items.COPPER_BLOCK, 2)), - new SimplifiedRecipe(new ItemStack(Items.OXIDIZED_COPPER, 4), new ItemStack(Items.COPPER_BLOCK, 1)), - - new SimplifiedRecipe(new ItemStack(Items.WAXED_EXPOSED_COPPER, 4), new ItemStack(Items.WAXED_COPPER_BLOCK, 3)), - new SimplifiedRecipe(new ItemStack(Items.WAXED_WEATHERED_COPPER, 4), new ItemStack(Items.WAXED_COPPER_BLOCK, 2)), - new SimplifiedRecipe(new ItemStack(Items.WAXED_OXIDIZED_COPPER, 4), new ItemStack(Items.WAXED_COPPER_BLOCK, 1)), - - // more damaged anvils are worth less - new SimplifiedRecipe(new ItemStack(Items.CHIPPED_ANVIL, 3), new ItemStack(Items.ANVIL, 2)), - new SimplifiedRecipe(new ItemStack(Items.DAMAGED_ANVIL, 3), new ItemStack(Items.ANVIL, 1)), - - // old oak slabs are the same value as modern ones - new SimplifiedRecipe(Items.PETRIFIED_OAK_SLAB, Items.OAK_SLAB), - - // chainmail armour is worth the same as normal iron armor - new SimplifiedRecipe(Items.CHAINMAIL_HELMET, Items.IRON_HELMET), - new SimplifiedRecipe(Items.CHAINMAIL_CHESTPLATE, Items.IRON_CHESTPLATE), - new SimplifiedRecipe(Items.CHAINMAIL_LEGGINGS, Items.IRON_LEGGINGS), - new SimplifiedRecipe(Items.CHAINMAIL_BOOTS, Items.IRON_BOOTS), - - // enchanted golden apple is worth uhh 16 times the non-enchanted one :3 - new SimplifiedRecipe(Items.ENCHANTED_GOLDEN_APPLE, new ItemStack(Items.GOLDEN_APPLE, 16)), - - // carving a pumpkin with shears - new SimplifiedRecipe(Items.CARVED_PUMPKIN, List.of(new ItemStack(Items.PUMPKIN_SEEDS, 4)), Items.PUMPKIN), - - // gathering honey - new SimplifiedRecipe(Items.HONEY_BOTTLE, Items.HONEYCOMB, Items.GLASS_BOTTLE), - - // smithing template duplicating recipes but -1 templates on both sides - new SimplifiedRecipe(Items.COAST_ARMOR_TRIM_SMITHING_TEMPLATE, new ItemStack(Items.DIAMOND, 7), new ItemStack(Items.COBBLESTONE)), - new SimplifiedRecipe(Items.DUNE_ARMOR_TRIM_SMITHING_TEMPLATE, new ItemStack(Items.DIAMOND, 7), new ItemStack(Items.SANDSTONE)), - new SimplifiedRecipe(Items.EYE_ARMOR_TRIM_SMITHING_TEMPLATE, new ItemStack(Items.DIAMOND, 7), new ItemStack(Items.END_STONE)), - new SimplifiedRecipe(Items.HOST_ARMOR_TRIM_SMITHING_TEMPLATE, new ItemStack(Items.DIAMOND, 7), new ItemStack(Items.TERRACOTTA)), - new SimplifiedRecipe(Items.NETHERITE_UPGRADE_SMITHING_TEMPLATE, new ItemStack(Items.DIAMOND, 7), new ItemStack(Items.NETHERRACK)), - new SimplifiedRecipe(Items.RAISER_ARMOR_TRIM_SMITHING_TEMPLATE, new ItemStack(Items.DIAMOND, 7), new ItemStack(Items.TERRACOTTA)), - new SimplifiedRecipe(Items.RIB_ARMOR_TRIM_SMITHING_TEMPLATE, new ItemStack(Items.DIAMOND, 7), new ItemStack(Items.NETHERRACK)), - new SimplifiedRecipe(Items.SENTRY_ARMOR_TRIM_SMITHING_TEMPLATE, new ItemStack(Items.DIAMOND, 7), new ItemStack(Items.COBBLESTONE)), - new SimplifiedRecipe(Items.SHAPER_ARMOR_TRIM_SMITHING_TEMPLATE, new ItemStack(Items.DIAMOND, 7), new ItemStack(Items.TERRACOTTA)), - new SimplifiedRecipe(Items.SILENCE_ARMOR_TRIM_SMITHING_TEMPLATE, new ItemStack(Items.DIAMOND, 7), new ItemStack(Items.COBBLED_DEEPSLATE)), - new SimplifiedRecipe(Items.SNOUT_ARMOR_TRIM_SMITHING_TEMPLATE, new ItemStack(Items.DIAMOND, 7), new ItemStack(Items.BLACKSTONE)), - new SimplifiedRecipe(Items.SPIRE_ARMOR_TRIM_SMITHING_TEMPLATE, new ItemStack(Items.DIAMOND, 7), new ItemStack(Items.PURPUR_BLOCK)), - new SimplifiedRecipe(Items.TIDE_ARMOR_TRIM_SMITHING_TEMPLATE, new ItemStack(Items.DIAMOND, 7), new ItemStack(Items.PRISMARINE)), - new SimplifiedRecipe(Items.VEX_ARMOR_TRIM_SMITHING_TEMPLATE, new ItemStack(Items.DIAMOND, 7), new ItemStack(Items.COBBLESTONE)), - new SimplifiedRecipe(Items.WARD_ARMOR_TRIM_SMITHING_TEMPLATE, new ItemStack(Items.DIAMOND, 7), new ItemStack(Items.COBBLED_DEEPSLATE)), - new SimplifiedRecipe(Items.WAYFINDER_ARMOR_TRIM_SMITHING_TEMPLATE, new ItemStack(Items.DIAMOND, 7), new ItemStack(Items.TERRACOTTA)), - new SimplifiedRecipe(Items.WILD_ARMOR_TRIM_SMITHING_TEMPLATE, new ItemStack(Items.DIAMOND, 7), new ItemStack(Items.MOSSY_COBBLESTONE)), - - // water bucket = bucket + water, water assumed to be same value as cobblestone - new SimplifiedRecipe(Items.WATER_BUCKET, Items.BUCKET, Items.COBBLESTONE), - - // lava bucket = bucket + lava, lava assumed to be same value as obsidian - new SimplifiedRecipe(Items.LAVA_BUCKET, Items.BUCKET, Items.OBSIDIAN), - - // powder snow bucket = bucket + snow - new SimplifiedRecipe(Items.POWDER_SNOW_BUCKET, Items.BUCKET, Items.SNOW_BLOCK), - - // milk bucket = bucket + milk, milk assumed to be same value as wheat - new SimplifiedRecipe(Items.MILK_BUCKET, Items.BUCKET, Items.WHEAT), - - // [fish] bucket = bucket + [fish] - new SimplifiedRecipe(Items.COD_BUCKET, Items.BUCKET, Items.COD), - new SimplifiedRecipe(Items.PUFFERFISH_BUCKET, Items.BUCKET, Items.PUFFERFISH), - new SimplifiedRecipe(Items.SALMON_BUCKET, Items.BUCKET, Items.SALMON), - new SimplifiedRecipe(Items.TROPICAL_FISH_BUCKET, Items.BUCKET, Items.TROPICAL_FISH), - - // yep - new SimplifiedRecipe(Items.AXOLOTL_BUCKET, Items.TROPICAL_FISH_BUCKET), - new SimplifiedRecipe(Items.TADPOLE_BUCKET, Items.AXOLOTL_BUCKET), - - // dye value is the canon - new SimplifiedRecipe(Items.INK_SAC, Items.BLACK_DYE), - - // disc value is the canon - new SimplifiedRecipe(new ItemStack(Items.DISC_FRAGMENT_5, 9), Items.MUSIC_DISC_5), - - // glowing ink sac is more expensive than an ink sac - new SimplifiedRecipe(Items.GLOW_INK_SAC, new ItemStack(Items.INK_SAC, 4)), - - // activated maps cost the same as unactivated ones - new SimplifiedRecipe(Items.FILLED_MAP, Items.MAP), - - // poisonous potato costs less than a normal one - new SimplifiedRecipe(new ItemStack(Items.POISONOUS_POTATO, 2), Items.POTATO), - - // rabbits foot costs more than rabbit meat - new SimplifiedRecipe(Items.RABBIT_FOOT, new ItemStack(Items.RABBIT, 8)), - - // [X] horse armor == [X] leggings - // wtf, why? see how much leather is used by leather horse armor - new SimplifiedRecipe(Items.IRON_HORSE_ARMOR, Items.IRON_LEGGINGS), - new SimplifiedRecipe(Items.GOLDEN_HORSE_ARMOR, Items.GOLDEN_LEGGINGS), - new SimplifiedRecipe(Items.DIAMOND_HORSE_ARMOR, Items.DIAMOND_LEGGINGS), - - // Trident = 1.5 * iron sword - new SimplifiedRecipe(new ItemStack(Items.TRIDENT, 2), new ItemStack(Items.IRON_SWORD, 3)), - - // an actual recipe but it's special, minecraft:crafting_special_suspiciousstew - new SimplifiedRecipe(Items.SUSPICIOUS_STEW, Items.BOWL, Items.BROWN_MUSHROOM, Items.RED_MUSHROOM, Items.POPPY), - - // obvious - new SimplifiedRecipe(Items.GLOBE_BANNER_PATTERN, Items.CREEPER_BANNER_PATTERN), - new SimplifiedRecipe(Items.PIGLIN_BANNER_PATTERN, Items.CREEPER_BANNER_PATTERN), - - // the vibes fit - new SimplifiedRecipe(Items.BELL, Items.SPYGLASS), - - // light sources, shroomlight has no crafting uses but is brighter - new SimplifiedRecipe(Items.SHROOMLIGHT, Items.GLOWSTONE), - - // bee nest = honeycomb block - new SimplifiedRecipe(Items.BEE_NEST, new ItemStack(Items.HONEYCOMB, 9)), - - // gilded blackstone = blackstone with gold nuggets - new SimplifiedRecipe(Items.GILDED_BLACKSTONE, new ItemStack(Items.BLACKSTONE), new ItemStack(Items.GOLD_NUGGET, 4)), - - // froglight = eaten magma cube - new SimplifiedRecipe(Items.OCHRE_FROGLIGHT, Items.MAGMA_CREAM), - new SimplifiedRecipe(Items.PEARLESCENT_FROGLIGHT, Items.MAGMA_CREAM), - new SimplifiedRecipe(Items.VERDANT_FROGLIGHT, Items.MAGMA_CREAM) - )); - - // pot sherds can be replaced with bricks when making decorated pots - ItemUtils.streamTag(ItemTags.DECORATED_POT_SHERDS).forEach(sherd -> FAKE_RECIPES.add(new SimplifiedRecipe(sherd, Items.BRICK))); - - for (var color : DyeColor.values()) { - ITEM_COMMON_MAP.put(DyeUtils.getDye(color), 8.0); - FAKE_RECIPES.addAll(List.of( - // putting concrete powder in water - new SimplifiedRecipe(DyeUtils.getConcrete(color), DyeUtils.getConcretePowder(color)), - - // an actual recipe but it's special, minecraft:crafting_special_shulkerboxcoloring - new SimplifiedRecipe(DyeUtils.getShulkerBox(color), Items.SHULKER_BOX, DyeUtils.getDye(color)) - )); - } - } -} diff --git a/src/main/java/lv/enes/mc/eris_alchemy/Emc.java b/src/main/java/lv/enes/mc/eris_alchemy/Emc.java new file mode 100644 index 0000000..fdc7c0a --- /dev/null +++ b/src/main/java/lv/enes/mc/eris_alchemy/Emc.java @@ -0,0 +1,214 @@ +package lv.enes.mc.eris_alchemy; + +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; +import lv.enes.mc.eris_alchemy.utils.ItemUtils; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.core.registries.Registries; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.tags.TagKey; +import net.minecraft.world.item.BlockItem; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.crafting.Ingredient; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.Block; + +import java.text.DecimalFormat; +import java.util.*; +import java.util.stream.Stream; + +public class Emc { + private static final Map ITEM_VALUES = new HashMap<>(); + private static final Map, OptionalDouble> ITEM_TAG_VALUES = new HashMap<>(); + private static final Map, OptionalDouble> BLOCK_TAG_VALUES = new HashMap<>(); + private static final List FAKE_RECIPES = new ArrayList<>(); + + private static final Map instances = Collections.synchronizedMap(new WeakHashMap<>()); + + private static final DecimalFormat formatter = new DecimalFormat("0"); + static { + formatter.setMaximumFractionDigits(1); + } + + public static Emc getInstance(@Nonnull Level world) { + if (instances.containsKey(world)) { + return instances.get(world); + } + + var instance = new Emc(world); + instances.put(world, instance); + return instance; + } + + public static String formatEmc(double value) { + return formatter.format(value); + } + + public static void reloadData( + Map itemValues, + Map itemTagValues, + Map blockTagValues, + List fakeRecipes + ) { + ITEM_VALUES.clear(); + ITEM_VALUES.putAll(itemValues); + + ITEM_TAG_VALUES.clear(); + itemTagValues.forEach((id, value) -> ITEM_TAG_VALUES.put(TagKey.create(Registries.ITEM, id), value)); + + BLOCK_TAG_VALUES.clear(); + blockTagValues.forEach((id, value) -> BLOCK_TAG_VALUES.put(TagKey.create(Registries.BLOCK, id), value)); + + FAKE_RECIPES.clear(); + FAKE_RECIPES.addAll(fakeRecipes); + + instances.clear(); + } + + private final Map data; + + private Emc(@Nonnull Level world) { + data = Collections.synchronizedMap(new HashMap<>(ITEM_VALUES)); + ITEM_TAG_VALUES.forEach( + (tag, emcValue) -> BuiltInRegistries.ITEM + .getTagOrEmpty(tag) + .forEach(holder -> data.putIfAbsent(ItemUtils.getId(holder), emcValue)) + ); + BLOCK_TAG_VALUES.forEach( + (tag, emcValue) -> BuiltInRegistries.BLOCK + .getTagOrEmpty(tag) + .forEach(holder -> data.putIfAbsent(ItemUtils.getId(holder), emcValue)) + ); + + ErisAlchemy.LOGGER.info("Calculating EMC values..."); + var recipes = getRecipes(world); + var configured = new HashSet<>(data.keySet()); + BuiltInRegistries.ITEM.keySet().forEach(item -> { + configEmc(recipes, configured, item); + if (!data.containsKey(item)) { + ErisAlchemy.LOGGER.warn("No EMC value for '{}' known", item); + } + }); + } + + public OptionalDouble get(ItemStack stack) { + if (stack.isEmpty()) { + return OptionalDouble.empty(); + } + + var item = stack.getItem(); + var itemId = ItemUtils.getId(item); + return get(itemId) + .stream() + .map(value -> { + EmcStorage storage = null; + if (item instanceof EmcStorage emcStorage) { + storage = emcStorage; + } else if (item instanceof BlockItem blockItem) { + if (blockItem.getBlock() instanceof EmcStorage emcStorage) { + storage = emcStorage; + } + } + if (storage != null) { + return value + storage.getStoredEmc(stack); + } + return value; + }) + .findFirst(); + } + + public OptionalDouble get(ResourceLocation itemId) { + return data.getOrDefault(itemId, OptionalDouble.empty()); + } + + private List getRecipes(@Nullable Level world) { + Stream recipes = FAKE_RECIPES.stream(); + + if (world != null) { + recipes = Stream.concat( + recipes, + world.getRecipeManager() + .getRecipes() + .stream() + .map(recipe -> new SimplifiedRecipe(recipe, world.registryAccess())) + ); + } + + return recipes.toList(); + } + + private OptionalDouble configEmc( + List recipes, + Set configured, + ResourceLocation itemId + ) { + var res = get(itemId); + if (res.isPresent() || configured.contains(itemId)) { + return res; + } + + configured.add(itemId); + var item = BuiltInRegistries.ITEM.get(itemId); + res = recipes.stream() + .filter(recipe -> recipe.output().is(item)) + .map(recipe -> calculateEmcForRecipe(recipes, configured, recipe)) + .flatMapToDouble(OptionalDouble::stream) + .average(); + res.ifPresentOrElse( + emc -> data.put(itemId, OptionalDouble.of(emc)), + () -> configured.remove(itemId) + ); + return res; + } + + private OptionalDouble calculateEmcForRecipe( + List recipes, + Set configured, + SimplifiedRecipe recipe + ) { + try { + if (recipe.input().isEmpty()) { + return OptionalDouble.empty(); + } + + var inputEmc = recipe.input() + .stream() + .map(ingredient -> calculateEmcForIngredient(recipes, configured, ingredient)) + .mapToDouble(OptionalDouble::orElseThrow) + .sum(); + + var remainderEmc = recipe.remainder() + .stream() + .map(remainder -> configEmc(recipes, configured, ItemUtils.getId(remainder))) + .mapToDouble(OptionalDouble::orElseThrow) + .sum(); + + if (remainderEmc > inputEmc) { + ErisAlchemy.LOGGER.warn("Recipe generating {} creates too much EMC out of thin air!", recipe.output()); + return OptionalDouble.empty(); + } + + var outputDivisor = (double) recipe.output().getCount(); + + return OptionalDouble.of((inputEmc - remainderEmc) / outputDivisor); + } catch (NoSuchElementException e) { + return OptionalDouble.empty(); + } + } + + private OptionalDouble calculateEmcForIngredient( + List recipes, + Set configured, + Ingredient ingredient + ) { + return Arrays.stream(ingredient.getItems()) + .map(stack -> configEmc(recipes, configured, ItemUtils.getId(stack.getItem())).stream() + .map(x -> x * stack.getCount()) + .findFirst()) + .filter(OptionalDouble::isPresent) + .mapToDouble(OptionalDouble::getAsDouble) + .filter(x -> x > 0) + .average(); + } +} diff --git a/src/main/java/lv/enes/mc/eris_alchemy/EmcLoader.java b/src/main/java/lv/enes/mc/eris_alchemy/EmcLoader.java new file mode 100644 index 0000000..dd4613f --- /dev/null +++ b/src/main/java/lv/enes/mc/eris_alchemy/EmcLoader.java @@ -0,0 +1,99 @@ +package lv.enes.mc.eris_alchemy; + +import com.google.gson.reflect.TypeToken; +import jakarta.annotation.Nonnull; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.server.packs.resources.ResourceManager; +import org.quiltmc.qsl.resource.loader.api.reloader.SimpleSynchronousResourceReloader; + +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.*; + +import static lv.enes.mc.eris_alchemy.ErisAlchemy.GSON; + +public class EmcLoader implements SimpleSynchronousResourceReloader { + public static final EmcLoader INSTANCE = new EmcLoader(); + + @Nonnull + @Override + public ResourceLocation getQuiltId() { + return new ResourceLocation(ErisAlchemy.ID, "emc_loader"); + } + + @Override + public void onResourceManagerReload(ResourceManager manager) { + var itemValues = loadAllFiles(manager, "item_emcs", new HashMap<>(), EmcLoader::loadEmcValues); + var itemTagValues = loadAllFiles(manager, "item_tag_emcs", new HashMap<>(), EmcLoader::loadEmcValues); + var blockTagValues = loadAllFiles(manager, "block_tag_emcs", new HashMap<>(), EmcLoader::loadEmcValues); + + var fakeRecipes = loadAllFiles(manager, "fake_recipes", new ArrayList<>(), EmcLoader::loadFakeRecipes); + + Emc.reloadData(itemValues, itemTagValues, blockTagValues, fakeRecipes); + } + + private static T loadAllFiles( + ResourceManager manager, + String path, + T arg, + Loader loader + ) { + manager.listResources( + ErisAlchemy.ID + "/" + path, + loc -> loc.getPath().endsWith(".json") || loc.getPath().endsWith(".json5") + ).forEach((id, res) -> { + ErisAlchemy.LOGGER.info("Loading {}:{}...", id.getNamespace(), id.getPath()); + try (var is = res.open()) { + loader.loadFile(arg, id, is); + } catch (IOException e) { + ErisAlchemy.LOGGER.error( + "Error occured while reading {}:{}", + id.getNamespace(), + id.getPath(), + e + ); + } + }); + return arg; + } + + private static void loadEmcValues(Map map, ResourceLocation id, InputStream is) + throws IOException + { + try (var reader = new InputStreamReader(is)) { + var json = GSON.fromJson(reader, new TypeToken>(){}); + json.forEach((item, newEmcRaw) -> { + var newEmc = newEmcRaw == null ? OptionalDouble.empty() : OptionalDouble.of(newEmcRaw); + var oldEmc = map.get(item); + if (oldEmc != null && !newEmc.equals(oldEmc)) { + var oldStr = oldEmc.isEmpty() ? "NONE" : Double.toString(oldEmc.getAsDouble()); + var newStr = newEmc.isEmpty() ? "NONE" : Double.toString(newEmc.getAsDouble()); + ErisAlchemy.LOGGER.warn( + "Redefining the EMC value for {} from {} to {}", + item, + oldStr, + newStr + ); + } + map.put(item, newEmc); + }); + } + } + + private static void loadFakeRecipes(List recipes, ResourceLocation id, InputStream is) + throws IOException + { + try (var reader = new InputStreamReader(is)) { + var json = GSON.fromJson(reader, new TypeToken>(){}); + recipes.addAll(json); + } + } + + @FunctionalInterface + private interface Loader { + void loadFile(T arg, ResourceLocation id, InputStream is) throws IOException; + } + + private EmcLoader() {} +} diff --git a/src/main/java/lv/enes/mc/eris_alchemy/ErisAlchemy.java b/src/main/java/lv/enes/mc/eris_alchemy/ErisAlchemy.java index bb804b3..bb84e18 100644 --- a/src/main/java/lv/enes/mc/eris_alchemy/ErisAlchemy.java +++ b/src/main/java/lv/enes/mc/eris_alchemy/ErisAlchemy.java @@ -1,18 +1,27 @@ package lv.enes.mc.eris_alchemy; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroup; import net.minecraft.core.Registry; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; +import net.minecraft.server.packs.PackType; import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.ItemStack; import org.quiltmc.loader.api.ModContainer; import org.quiltmc.qsl.base.api.entrypoint.ModInitializer; +import org.quiltmc.qsl.resource.loader.api.ResourceLoader; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class ErisAlchemy implements ModInitializer { + public static final Gson GSON = new GsonBuilder() + .registerTypeAdapter(ResourceLocation.class, new ResourceLocation.Serializer()) + .registerTypeAdapter(SimplifiedRecipe.class, new SimplifiedRecipe.Deserializer()) + .create(); + public static final String ID = "eris_alchemy"; public static final Logger LOGGER = LoggerFactory.getLogger(ID); @@ -31,6 +40,8 @@ public class ErisAlchemy implements ModInitializer { throw new RuntimeException("Hardcoded mod ID doesn't match the configured one!"); } + ResourceLoader.get(PackType.SERVER_DATA).registerReloader(EmcLoader.INSTANCE); + Registry.register(BuiltInRegistries.CREATIVE_MODE_TAB, new ResourceLocation(ID, "item_group"), ITEM_GROUP); ErisAlchemyRegistry.BlockEntities.consume( diff --git a/src/main/java/lv/enes/mc/eris_alchemy/SimplifiedRecipe.java b/src/main/java/lv/enes/mc/eris_alchemy/SimplifiedRecipe.java new file mode 100644 index 0000000..ef69b84 --- /dev/null +++ b/src/main/java/lv/enes/mc/eris_alchemy/SimplifiedRecipe.java @@ -0,0 +1,89 @@ +package lv.enes.mc.eris_alchemy; + +import com.google.gson.*; +import jakarta.annotation.Nonnull; +import lv.enes.mc.eris_alchemy.utils.RecipeUtils; +import net.minecraft.core.RegistryAccess; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.crafting.Ingredient; +import net.minecraft.world.item.crafting.Recipe; +import net.minecraft.world.item.crafting.ShapedRecipe; + +import java.lang.reflect.Type; +import java.util.List; + +public record SimplifiedRecipe(ItemStack output, List remainder, List input) { + public SimplifiedRecipe(Recipe recipe, RegistryAccess registryAccess) { + this( + RecipeUtils.getOutput(recipe, registryAccess), + List.of(), // TODO: + RecipeUtils.getIngredients(recipe).stream().filter(ingredient -> !ingredient.isEmpty()).toList() + ); + } + + static class Deserializer implements JsonDeserializer { + @Nonnull + @Override + public SimplifiedRecipe deserialize( + JsonElement jsonElement, + Type type, + JsonDeserializationContext jsonDeserializationContext + ) throws JsonParseException { + if (!jsonElement.isJsonObject()) { + throw new JsonParseException("Recipe must be an object"); + } + var obj = jsonElement.getAsJsonObject(); + + if (obj.get("output") == null || obj.get("input") == null) { + throw new JsonParseException("Recipe must have 'output' and 'input' fields"); + } + + var output = parseOutputOrRemainder(obj.get("output")); + var remainder = parseRemainders(obj.get("remainder")); + var input = parseInputs(obj.get("input")); + return new SimplifiedRecipe(output, remainder, input); + } + + private List parseInputs(JsonElement el) { + if (el.isJsonArray()) { + return el.getAsJsonArray().asList().stream().map(this::parseInput).map(Ingredient::of).toList(); + } + + return List.of(Ingredient.of(parseInput(el))); + } + + private ItemStack parseInput(JsonElement el) { + if (el.isJsonObject()) { + return ShapedRecipe.itemStackFromJson(el.getAsJsonObject()); + } else if (el.isJsonPrimitive() && el.getAsJsonPrimitive().isString()) { + var id = new ResourceLocation(el.getAsString()); + return BuiltInRegistries.ITEM.get(id).getDefaultInstance(); + } else { + throw new JsonParseException("Every recipe input should be an object or a string"); + } + } + + private ItemStack parseOutputOrRemainder(JsonElement el) { + if (el.isJsonObject()) { + return ShapedRecipe.itemStackFromJson(el.getAsJsonObject()); + } else if (el.isJsonPrimitive() && el.getAsJsonPrimitive().isString()) { + var id = new ResourceLocation(el.getAsString()); + return BuiltInRegistries.ITEM.get(id).getDefaultInstance(); + } else { + throw new JsonParseException("Recipe's output or remainder must be an object or a string"); + } + } + + private List parseRemainders(JsonElement el) { + if (el == null) { + return List.of(); + } else if (el.isJsonArray()) { + return el.getAsJsonArray().asList().stream().map(this::parseOutputOrRemainder).toList(); + } else { + return List.of(parseOutputOrRemainder(el)); + } + } + } +} diff --git a/src/main/java/lv/enes/mc/eris_alchemy/block/EnergyCondenserBlock.java b/src/main/java/lv/enes/mc/eris_alchemy/block/EnergyCondenserBlock.java index 86ac061..af58fc6 100644 --- a/src/main/java/lv/enes/mc/eris_alchemy/block/EnergyCondenserBlock.java +++ b/src/main/java/lv/enes/mc/eris_alchemy/block/EnergyCondenserBlock.java @@ -2,7 +2,7 @@ package lv.enes.mc.eris_alchemy.block; import jakarta.annotation.Nonnull; import jakarta.annotation.Nullable; -import lv.enes.mc.eris_alchemy.EMC; +import lv.enes.mc.eris_alchemy.Emc; import lv.enes.mc.eris_alchemy.EmcStorage; import lv.enes.mc.eris_alchemy.ErisAlchemyRegistry; import lv.enes.mc.eris_alchemy.block.entity.EnergyCondenserEntity; @@ -33,7 +33,7 @@ public class EnergyCondenserBlock extends ChestLikeBlock TooltipFlag options ) { if (getStoredEmc(stack) >= 0.1) { - tooltip.add(Component.literal("Stored EMC: %s".formatted(EMC.formatEmc(getStoredEmc(stack))))); + tooltip.add(Component.literal("Stored EMC: %s".formatted(Emc.formatEmc(getStoredEmc(stack))))); } } diff --git a/src/main/java/lv/enes/mc/eris_alchemy/block/entity/EnergyCondenserEntity.java b/src/main/java/lv/enes/mc/eris_alchemy/block/entity/EnergyCondenserEntity.java index 0f39ccb..a264722 100644 --- a/src/main/java/lv/enes/mc/eris_alchemy/block/entity/EnergyCondenserEntity.java +++ b/src/main/java/lv/enes/mc/eris_alchemy/block/entity/EnergyCondenserEntity.java @@ -1,7 +1,7 @@ package lv.enes.mc.eris_alchemy.block.entity; import jakarta.annotation.Nonnull; -import lv.enes.mc.eris_alchemy.EMC; +import lv.enes.mc.eris_alchemy.Emc; import lv.enes.mc.eris_alchemy.ErisAlchemyRegistry.BlockEntities; import lv.enes.mc.eris_alchemy.ErisAlchemyRegistry.Blocks; import lv.enes.mc.eris_alchemy.ErisAlchemyRegistry.Materials; @@ -81,7 +81,7 @@ public class EnergyCondenserEntity extends ChestLikeEntity implements ExtendedSc @Override public void tick(Level world, BlockPos pos, BlockState state) { super.tick(world, pos, state); - EMC.getInstance(world).get(items.get(0)).ifPresent(cost -> { + Emc.getInstance(world).get(items.get(0)).ifPresent(cost -> { tryConsumeEmc(world, cost); tryCloneTemplate(cost); }); @@ -128,7 +128,7 @@ public class EnergyCondenserEntity extends ChestLikeEntity implements ExtendedSc return; } - var emc = EMC.getInstance(world); + var emc = Emc.getInstance(world); var template = items.get(0); var sacrifice = items.stream() .skip(1) // skip the template diff --git a/src/main/java/lv/enes/mc/eris_alchemy/client/EnergyCondenserScreen.java b/src/main/java/lv/enes/mc/eris_alchemy/client/EnergyCondenserScreen.java index b6762c8..7b9871b 100644 --- a/src/main/java/lv/enes/mc/eris_alchemy/client/EnergyCondenserScreen.java +++ b/src/main/java/lv/enes/mc/eris_alchemy/client/EnergyCondenserScreen.java @@ -1,6 +1,6 @@ package lv.enes.mc.eris_alchemy.client; -import lv.enes.mc.eris_alchemy.EMC; +import lv.enes.mc.eris_alchemy.Emc; import lv.enes.mc.eris_alchemy.ErisAlchemy; import lv.enes.mc.eris_alchemy.menu.EnergyCondenserMenu; import net.minecraft.client.gui.GuiGraphics; @@ -36,7 +36,7 @@ public class EnergyCondenserScreen extends ChestLikeScreen @Override protected void renderLabels(GuiGraphics graphics, int mouseX, int mouseY) { - graphics.drawString(font, EMC.formatEmc(menu.getStoredEmc()), 28, 6, 0xFFFFFF); + graphics.drawString(font, Emc.formatEmc(menu.getStoredEmc()), 28, 6, 0xFFFFFF); } @Override diff --git a/src/main/java/lv/enes/mc/eris_alchemy/client/ErisAlchemyClient.java b/src/main/java/lv/enes/mc/eris_alchemy/client/ErisAlchemyClient.java index a69d2e1..f4de045 100644 --- a/src/main/java/lv/enes/mc/eris_alchemy/client/ErisAlchemyClient.java +++ b/src/main/java/lv/enes/mc/eris_alchemy/client/ErisAlchemyClient.java @@ -1,6 +1,6 @@ package lv.enes.mc.eris_alchemy.client; -import lv.enes.mc.eris_alchemy.EMC; +import lv.enes.mc.eris_alchemy.Emc; import net.fabricmc.fabric.api.client.rendering.v1.BuiltinItemRendererRegistry; import net.minecraft.client.gui.screens.MenuScreens; import net.minecraft.client.renderer.blockentity.BlockEntityRenderers; @@ -18,9 +18,12 @@ public class ErisAlchemyClient implements ClientModInitializer { ErisAlchemyClientRegistry.MenuScreens.consume(MenuScreens::register); ItemTooltipCallback.EVENT.register((stack, player, context, tooltip) -> { - var world = player == null ? null : player.level(); - var emc = EMC.getInstance(world).get(stack); - emc.ifPresent(value -> tooltip.add(Component.literal("EMC %s".formatted(EMC.formatEmc(value))))); + if (player == null) { + return; + } + + var emc = Emc.getInstance(player.level()).get(stack); + emc.ifPresent(value -> tooltip.add(Component.literal("EMC %s".formatted(Emc.formatEmc(value))))); }); } } diff --git a/src/main/java/lv/enes/mc/eris_alchemy/mixin/CoralBlockMixin.java b/src/main/java/lv/enes/mc/eris_alchemy/mixin/CoralBlockMixin.java deleted file mode 100644 index d8024c9..0000000 --- a/src/main/java/lv/enes/mc/eris_alchemy/mixin/CoralBlockMixin.java +++ /dev/null @@ -1,20 +0,0 @@ -package lv.enes.mc.eris_alchemy.mixin; - -import lv.enes.mc.eris_alchemy.utils.CoralUtils; -import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.CoralBlock; -import org.spongepowered.asm.mixin.Final; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; - -@Mixin(CoralBlock.class) -public abstract class CoralBlockMixin implements CoralUtils.CoralSuper { - @Final - @Shadow - private Block deadBlock; - - @Override - public Block lv_enes_mc$getDead() { - return deadBlock; - } -} diff --git a/src/main/java/lv/enes/mc/eris_alchemy/mixin/CoralFanBlockMixin.java b/src/main/java/lv/enes/mc/eris_alchemy/mixin/CoralFanBlockMixin.java deleted file mode 100644 index 86ab8f6..0000000 --- a/src/main/java/lv/enes/mc/eris_alchemy/mixin/CoralFanBlockMixin.java +++ /dev/null @@ -1,20 +0,0 @@ -package lv.enes.mc.eris_alchemy.mixin; - -import lv.enes.mc.eris_alchemy.utils.CoralUtils; -import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.CoralFanBlock; -import org.spongepowered.asm.mixin.Final; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; - -@Mixin(CoralFanBlock.class) -public abstract class CoralFanBlockMixin implements CoralUtils.CoralSuper { - @Final - @Shadow - private Block deadBlock; - - @Override - public Block lv_enes_mc$getDead() { - return deadBlock; - } -} diff --git a/src/main/java/lv/enes/mc/eris_alchemy/mixin/CoralPlantBlockMixin.java b/src/main/java/lv/enes/mc/eris_alchemy/mixin/CoralPlantBlockMixin.java deleted file mode 100644 index a5614f9..0000000 --- a/src/main/java/lv/enes/mc/eris_alchemy/mixin/CoralPlantBlockMixin.java +++ /dev/null @@ -1,20 +0,0 @@ -package lv.enes.mc.eris_alchemy.mixin; - -import lv.enes.mc.eris_alchemy.utils.CoralUtils; -import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.CoralPlantBlock; -import org.spongepowered.asm.mixin.Final; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; - -@Mixin(CoralPlantBlock.class) -public abstract class CoralPlantBlockMixin implements CoralUtils.CoralSuper { - @Final - @Shadow - private Block deadBlock; - - @Override - public Block lv_enes_mc$getDead() { - return deadBlock; - } -} diff --git a/src/main/java/lv/enes/mc/eris_alchemy/mixin/CoralWallFanBlockMixin.java b/src/main/java/lv/enes/mc/eris_alchemy/mixin/CoralWallFanBlockMixin.java deleted file mode 100644 index 8ffa07e..0000000 --- a/src/main/java/lv/enes/mc/eris_alchemy/mixin/CoralWallFanBlockMixin.java +++ /dev/null @@ -1,20 +0,0 @@ -package lv.enes.mc.eris_alchemy.mixin; - -import lv.enes.mc.eris_alchemy.utils.CoralUtils; -import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.CoralWallFanBlock; -import org.spongepowered.asm.mixin.Final; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; - -@Mixin(CoralWallFanBlock.class) -public abstract class CoralWallFanBlockMixin implements CoralUtils.CoralSuper { - @Final - @Shadow - private Block deadBlock; - - @Override - public Block lv_enes_mc$getDead() { - return deadBlock; - } -} diff --git a/src/main/java/lv/enes/mc/eris_alchemy/utils/AxeUtils.java b/src/main/java/lv/enes/mc/eris_alchemy/utils/AxeUtils.java deleted file mode 100644 index 22c0bad..0000000 --- a/src/main/java/lv/enes/mc/eris_alchemy/utils/AxeUtils.java +++ /dev/null @@ -1,18 +0,0 @@ -package lv.enes.mc.eris_alchemy.utils; - -import net.minecraft.world.item.AxeItem; -import net.minecraft.world.item.Tier; -import net.minecraft.world.level.block.Block; - -import java.util.Map; - -/** This extends AxeItem only to read the STRIPPABLES variable :3 */ -public final class AxeUtils extends AxeItem { - public static Map getStrippables() { - return STRIPPABLES; - } - - private AxeUtils(Tier material, float attackDamage, float attackSpeed, Properties settings) { - super(material, attackDamage, attackSpeed, settings); - } -} diff --git a/src/main/java/lv/enes/mc/eris_alchemy/utils/BlockUtils.java b/src/main/java/lv/enes/mc/eris_alchemy/utils/BlockUtils.java deleted file mode 100644 index 88b6231..0000000 --- a/src/main/java/lv/enes/mc/eris_alchemy/utils/BlockUtils.java +++ /dev/null @@ -1,15 +0,0 @@ -package lv.enes.mc.eris_alchemy.utils; - -import net.minecraft.core.registries.BuiltInRegistries; -import net.minecraft.tags.TagKey; -import net.minecraft.world.level.block.Block; - -import java.util.stream.Stream; - -public final class BlockUtils { - public static Stream streamTag(TagKey tag) { - return TagUtils.stream(BuiltInRegistries.BLOCK, tag); - } - - private BlockUtils() {} -} diff --git a/src/main/java/lv/enes/mc/eris_alchemy/utils/CoralUtils.java b/src/main/java/lv/enes/mc/eris_alchemy/utils/CoralUtils.java deleted file mode 100644 index 1136c9e..0000000 --- a/src/main/java/lv/enes/mc/eris_alchemy/utils/CoralUtils.java +++ /dev/null @@ -1,44 +0,0 @@ -package lv.enes.mc.eris_alchemy.utils; - -import net.minecraft.tags.BlockTags; -import net.minecraft.world.level.block.*; - -import java.util.stream.Stream; - -public final class CoralUtils { - /** - * @see lv.enes.mc.eris_alchemy.mixin.CoralBlockMixin - * @see lv.enes.mc.eris_alchemy.mixin.CoralFanBlockMixin - * @see lv.enes.mc.eris_alchemy.mixin.CoralPlantBlockMixin - * @see lv.enes.mc.eris_alchemy.mixin.CoralWallFanBlockMixin - */ - public interface CoralSuper { - Block lv_enes_mc$getDead(); - } - - public static Stream streamAllCoralBlocks() { - return BlockUtils.streamTag(BlockTags.CORAL_BLOCKS).map(b -> (CoralBlock)b); - } - - public static Stream streamAllCorals() { - return BlockUtils.streamTag(BlockTags.CORALS).map(b -> (BaseCoralPlantTypeBlock)b); - } - - public static Stream streamAllDeadCoralBlocks() { - return streamAllCoralBlocks().map(CoralUtils::getDeadCoralBlock); - } - - public static Stream streamAllDeadCorals() { - return streamAllCorals().map(CoralUtils::getDeadCoral); - } - - public static Block getDeadCoral(BaseCoralPlantTypeBlock live ) { - return ((CoralSuper)live).lv_enes_mc$getDead(); - } - - public static Block getDeadCoralBlock(CoralBlock live) { - return ((CoralSuper)live).lv_enes_mc$getDead(); - } - - private CoralUtils() {} -} diff --git a/src/main/java/lv/enes/mc/eris_alchemy/utils/DyeUtils.java b/src/main/java/lv/enes/mc/eris_alchemy/utils/DyeUtils.java deleted file mode 100644 index 3ceb965..0000000 --- a/src/main/java/lv/enes/mc/eris_alchemy/utils/DyeUtils.java +++ /dev/null @@ -1,62 +0,0 @@ -package lv.enes.mc.eris_alchemy.utils; - -import net.minecraft.world.item.DyeColor; -import net.minecraft.world.item.DyeItem; -import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.Blocks; -import net.minecraft.world.level.block.ConcretePowderBlock; -import net.minecraft.world.level.block.ShulkerBoxBlock; - -public final class DyeUtils { - public static Block getConcrete(DyeColor color) { - return switch (color) { - case BLACK -> Blocks.BLACK_CONCRETE; - case BLUE -> Blocks.BLUE_CONCRETE; - case BROWN -> Blocks.BROWN_CONCRETE; - case CYAN -> Blocks.CYAN_CONCRETE; - case GRAY -> Blocks.GRAY_CONCRETE; - case GREEN -> Blocks.GREEN_CONCRETE; - case LIGHT_BLUE -> Blocks.LIGHT_BLUE_CONCRETE; - case LIGHT_GRAY -> Blocks.LIGHT_GRAY_CONCRETE; - case LIME -> Blocks.LIME_CONCRETE; - case MAGENTA -> Blocks.MAGENTA_CONCRETE; - case ORANGE -> Blocks.ORANGE_CONCRETE; - case PINK -> Blocks.PINK_CONCRETE; - case PURPLE -> Blocks.PURPLE_CONCRETE; - case RED -> Blocks.RED_CONCRETE; - case WHITE -> Blocks.WHITE_CONCRETE; - case YELLOW -> Blocks.YELLOW_CONCRETE; - }; - } - - public static ConcretePowderBlock getConcretePowder(DyeColor color) { - return (ConcretePowderBlock)switch (color) { - case BLACK -> Blocks.BLACK_CONCRETE_POWDER; - case BLUE -> Blocks.BLUE_CONCRETE_POWDER; - case BROWN -> Blocks.BROWN_CONCRETE_POWDER; - case CYAN -> Blocks.CYAN_CONCRETE_POWDER; - case GRAY -> Blocks.GRAY_CONCRETE_POWDER; - case GREEN -> Blocks.GREEN_CONCRETE_POWDER; - case LIGHT_BLUE -> Blocks.LIGHT_BLUE_CONCRETE_POWDER; - case LIGHT_GRAY -> Blocks.LIGHT_GRAY_CONCRETE_POWDER; - case LIME -> Blocks.LIME_CONCRETE_POWDER; - case MAGENTA -> Blocks.MAGENTA_CONCRETE_POWDER; - case ORANGE -> Blocks.ORANGE_CONCRETE_POWDER; - case PINK -> Blocks.PINK_CONCRETE_POWDER; - case PURPLE -> Blocks.PURPLE_CONCRETE_POWDER; - case RED -> Blocks.RED_CONCRETE_POWDER; - case WHITE -> Blocks.WHITE_CONCRETE_POWDER; - case YELLOW -> Blocks.YELLOW_CONCRETE_POWDER; - }; - } - - public static DyeItem getDye(DyeColor color) { - return DyeItem.byColor(color); - } - - public static ShulkerBoxBlock getShulkerBox(DyeColor color) { - return (ShulkerBoxBlock)ShulkerBoxBlock.getBlockByColor(color); - } - - private DyeUtils() {} -} diff --git a/src/main/java/lv/enes/mc/eris_alchemy/utils/ItemUtils.java b/src/main/java/lv/enes/mc/eris_alchemy/utils/ItemUtils.java index 26d4405..4414d06 100644 --- a/src/main/java/lv/enes/mc/eris_alchemy/utils/ItemUtils.java +++ b/src/main/java/lv/enes/mc/eris_alchemy/utils/ItemUtils.java @@ -1,14 +1,22 @@ package lv.enes.mc.eris_alchemy.utils; +import net.minecraft.core.Holder; import net.minecraft.core.registries.BuiltInRegistries; -import net.minecraft.tags.TagKey; -import net.minecraft.world.item.Item; - -import java.util.stream.Stream; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.ItemLike; public final class ItemUtils { - public static Stream streamTag(TagKey tag) { - return TagUtils.stream(BuiltInRegistries.ITEM, tag); + public static ResourceLocation getId(Holder holder) { + return getId(holder.value()); + } + + public static ResourceLocation getId(ItemLike item) { + return BuiltInRegistries.ITEM.getKey(item.asItem()); + } + + public static ResourceLocation getId(ItemStack stack) { + return getId(stack.getItem()); } private ItemUtils() {} diff --git a/src/main/java/lv/enes/mc/eris_alchemy/utils/TagUtils.java b/src/main/java/lv/enes/mc/eris_alchemy/utils/TagUtils.java deleted file mode 100644 index 93e577f..0000000 --- a/src/main/java/lv/enes/mc/eris_alchemy/utils/TagUtils.java +++ /dev/null @@ -1,16 +0,0 @@ -package lv.enes.mc.eris_alchemy.utils; - -import net.minecraft.core.Holder; -import net.minecraft.core.Registry; -import net.minecraft.tags.TagKey; - -import java.util.stream.Stream; -import java.util.stream.StreamSupport; - -public final class TagUtils { - public static Stream stream(Registry registry, TagKey tag) { - return StreamSupport.stream(registry.getTagOrEmpty(tag).spliterator(), false).map(Holder::value); - } - - private TagUtils() {} -} diff --git a/src/main/resources/data/eris_alchemy/eris_alchemy/block_tag_emcs/minecraft.json b/src/main/resources/data/eris_alchemy/eris_alchemy/block_tag_emcs/minecraft.json new file mode 100644 index 0000000..c271159 --- /dev/null +++ b/src/main/resources/data/eris_alchemy/eris_alchemy/block_tag_emcs/minecraft.json @@ -0,0 +1,5 @@ +{ + "minecraft:base_stone_nether": 1, + "minecraft:base_stone_overworld": 1, + "minecraft:nylium": 1 +} \ No newline at end of file diff --git a/src/main/resources/data/eris_alchemy/eris_alchemy/fake_recipes/fake_recipes.json5 b/src/main/resources/data/eris_alchemy/eris_alchemy/fake_recipes/fake_recipes.json5 new file mode 100644 index 0000000..4511005 --- /dev/null +++ b/src/main/resources/data/eris_alchemy/eris_alchemy/fake_recipes/fake_recipes.json5 @@ -0,0 +1,562 @@ +[{ + // More oxidised coppers are worth less + "output": { + "item": "exposed_copper", + "count": 4 + }, + "input": { + "item": "copper_block", + "count": 3 + } +}, { + "output": { + "item": "weathered_copper", + "count": 4 + }, + "input": { + "item": "copper_block", + "count": 2 + } +}, { + "output": { + "item": "oxidized_copper", + "count": 4 + }, + "input": { + "item": "copper_block", + "count": 1 + } +}, { + // More oxidised coppers are worth less also if they're waxed + "output": { + "item": "waxed_exposed_copper", + "count": 4 + }, + "input": { + "item": "waxed_copper_block", + "count": 3 + } +}, { + "output": { + "item": "waxed_weathered_copper", + "count": 4 + }, + "input": { + "item": "waxed_copper_block", + "count": 2 + } +}, { + "output": { + "item": "waxed_oxidized_copper", + "count": 4 + }, + "input": { + "item": "waxed_copper_block", + "count": 1 + } +}, { + // More damaged anvils are worth less + "output": { + "item": "chipped_anvil", + "count": 3 + }, + "input": { + "item": "anvil", + "count": 2 + } +}, { + "output": { + "item": "damaged_anvil", + "count": 3 + }, + "input": { + "item": "anvil", + "count": 1 + } +}, { + // Old oak slabs are the same value as modern ones + "output": "petrified_oak_slab", + "input": "oak_slab" +}, { + // Chainmail armour is worth the same as normal iron armor + "output": "chainmail_helmet", + "input": "iron_helmet" +}, { + "output": "chainmail_chestplate", + "input": "iron_chestplate" +}, { + "output": "chainmail_leggings", + "input": "iron_leggings" +}, { + "output": "chainmail_boots", + "input": "iron_boots" +}, { + // Enchanted golden apple is worth uhh 16 times the non-enchanted one :3 + "output": "enchanted_golden_apple", + "input": { + "item": "golden_apple", + "count": 16 + } +}, { + // Carving a pumpkin with shears + "output": "carved_pumpkin", + "remainder": { + "item": "pumpkin_seeds", + "count": 4 + }, + "input": "pumpkin" +}, { + // Gathering honey + "output": "honey_bottle", + "input": [ + "honeycomb", + "glass_bottle" + ] +}, { + // Smithing template duplication recipes but -1 template on both sides + "output": "coast_armor_trim_smithing_template", + "input": [ + { + "item": "diamond", + "count": 7 + }, + "cobblestone" + ] +}, { + "output": "dune_armor_trim_smithing_template", + "input": [ + { + "item": "diamond", + "count": 7 + }, + "sandstone" + ] +}, { + "output": "eye_armor_trim_smithing_template", + "input": [ + { + "item": "diamond", + "count": 7 + }, + "end_stone" + ] +}, { + "output": "host_armor_trim_smithing_template", + "input": [ + { + "item": "diamond", + "count": 7 + }, + "terracotta" + ] +}, { + "output": "netherite_upgrade_smithing_template", + "input": [ + { + "item": "diamond", + "count": 7 + }, + "netherrack" + ] +}, { + "output": "raiser_armor_trim_smithing_template", + "input": [ + { + "item": "diamond", + "count": 7 + }, + "terracotta" + ] +}, { + "output": "rib_armor_trim_smithing_template", + "input": [ + { + "item": "diamond", + "count": 7 + }, + "netherrack" + ] +}, { + "output": "sentry_armor_trim_smithing_template", + "input": [ + { + "item": "diamond", + "count": 7 + }, + "cobblestone" + ] +}, { + "output": "shaper_armor_trim_smithing_template", + "input": [ + { + "item": "diamond", + "count": 7 + }, + "terracotta" + ] +}, { + "output": "silence_armor_trim_smithing_template", + "input": [ + { + "item": "diamond", + "count": 7 + }, + "cobbled_deepslate" + ] +}, { + "output": "snout_armor_trim_smithing_template", + "input": [ + { + "item": "diamond", + "count": 7 + }, + "blackstone" + ] +}, { + "output": "spire_armor_trim_smithing_template", + "input": [ + { + "item": "diamond", + "count": 7 + }, + "purpur_block" + ] +}, { + "output": "tide_armor_trim_smithing_template", + "input": [ + { + "item": "diamond", + "count": 7 + }, + "prismarine" + ] +}, { + "output": "vex_armor_trim_smithing_template", + "input": [ + { + "item": "diamond", + "count": 7 + }, + "cobblestone" + ] +}, { + "output": "ward_armor_trim_smithing_template", + "input": [ + { + "item": "diamond", + "count": 7 + }, + "cobbled_deepslate" + ] +}, { + "output": "wayfinder_armor_trim_smithing_template", + "input": [ + { + "item": "diamond", + "count": 7 + }, + "terracotta" + ] +}, { + "output": "wild_armor_trim_smithing_template", + "input": [ + { + "item": "diamond", + "count": 7 + }, + "mossy_cobblestone" + ] +}, { + "output": "water_bucket", + "input": [ + "bucket", + "stone" // Pretend this is water + ] +}, { + "output": "lava_bucket", + "input": [ + "bucket", + "obsidian" // Pretend this is lava + ] +}, { + "output": "powder_snow_bucket", + "input": [ + "bucket", + "snow" + ] +}, { + "output": "milk_bucket", + "input": [ + "bucket", + "wheat" // Pretend this is milk + ] +}, { + "output": "cod_bucket", + "input": [ + "cod", + "bucket" + ] +}, { + "output": "pufferfish_bucket", + "input": [ + "pufferfish", + "bucket" + ] +}, { + "output": "salmon_bucket", + "input": [ + "salmon", + "bucket" + ] +}, { + "output": "tropical_fish_bucket", + "input": [ + "tropical_fish", + "bucket" + ] +}, { + "output": "axolotl_bucket", + "input": "tropical_fish_bucket" +}, { + "output": "tadpole_bucket", + "input": "axolotl_bucket" +}, { + // disc value is the canon + "output": { + "item": "disc_fragment_5", + "count": 9 + }, + "input": "music_disc_5" +}, { + "output": "glow_ink_sac", + "input": { + "item": "ink_sac", + "count": 4 + } +}, { + "output": "filled_map", + "input": "map" +}, { + "output": { + "item": "poisonous_potato", + "count": 2 + }, + "input": "potato" +}, { + "output": "rabbit_foot", + "input": { + "item": "rabbit", + "count": 8 + } +}, { + // leather horse armor takes same amount of leather as leather leggings + // so we do a similar exchange for iron, gold, & diamond + "output": "iron_horse_armor", + "input": "iron_leggings" +}, { + "output": "golden_horse_armor", + "input": "golden_leggings" +}, { + "output": "diamond_horse_armor", + "input": "diamond_leggings" +}, { + "output": { + "item": "trident", + "count": 2 + }, + "input": { + "item": "iron_sword", + "count": 3 + } +}, { + "output": "suspicious_stew", + "input": [ + "bowl", + "brown_mushroom", + "red_mushroom", + "poppy" + ] +}, { + "output": "globe_banner_pattern", + "input": "creeper_banner_pattern" +}, { + "output": "piglin_banner_pattern", + "input": "creeper_banner_pattern" +}, { + "output": "bell", + "input": "spyglass" +}, { + "output": "shroomlight", + "input": "glowstone" +}, { + "output": "bee_nest", + "input": { + "item": "honeycomb", + "count": 9 + } +}, { + "output": "gilded_blackstone", + "input": [ + "blackstone", + { + "item": "gold_nugget", + "count": 4 + } + ] +}, { + "output": "ochre_froglight", + "input": "magma_cream" +}, { + "output": "pearlescent_froglight", + "input": "magma_cream" +}, { + "output": "verdant_froglight", + "input": "magma_cream" +}, { + "output": "black_concrete", + "input": "black_concrete_powder" +}, { + "output": "blue_concrete", + "input": "blue_concrete_powder" +}, { + "output": "brown_concrete", + "input": "brown_concrete_powder" +}, { + "output": "cyan_concrete", + "input": "cyan_concrete_powder" +}, { + "output": "gray_concrete", + "input": "gray_concrete_powder" +}, { + "output": "green_concrete", + "input": "green_concrete_powder" +}, { + "output": "light_blue_concrete", + "input": "light_blue_concrete_powder" +}, { + "output": "light_gray_concrete", + "input": "light_gray_concrete_powder" +}, { + "output": "lime_concrete", + "input": "lime_concrete_powder" +}, { + "output": "magenta_concrete", + "input": "magenta_concrete_powder" +}, { + "output": "orange_concrete", + "input": "orange_concrete_powder" +}, { + "output": "pink_concrete", + "input": "pink_concrete_powder" +}, { + "output": "purple_concrete", + "input": "purple_concrete_powder" +}, { + "output": "red_concrete", + "input": "red_concrete_powder" +}, { + "output": "white_concrete", + "input": "white_concrete_powder" +}, { + "output": "yellow_concrete", + "input": "yellow_concrete_powder" +}, { + "output": "black_shulker_box", + "input": [ + "shulker_box", + "black_dye" + ] +}, { + "output": "blue_shulker_box", + "input": [ + "shulker_box", + "blue_dye" + ] +}, { + "output": "brown_shulker_box", + "input": [ + "shulker_box", + "brown_dye" + ] +}, { + "output": "cyan_shulker_box", + "input": [ + "shulker_box", + "cyan_dye" + ] +}, { + "output": "gray_shulker_box", + "input": [ + "shulker_box", + "gray_dye" + ] +}, { + "output": "green_shulker_box", + "input": [ + "shulker_box", + "green_dye" + ] +}, { + "output": "light_blue_shulker_box", + "input": [ + "shulker_box", + "light_blue_dye" + ] +}, { + "output": "light_gray_shulker_box", + "input": [ + "shulker_box", + "light_gray_dye" + ] +}, { + "output": "lime_shulker_box", + "input": [ + "shulker_box", + "lime_dye" + ] +}, { + "output": "magenta_shulker_box", + "input": [ + "shulker_box", + "magenta_dye" + ] +}, { + "output": "orange_shulker_box", + "input": [ + "shulker_box", + "orange_dye" + ] +}, { + "output": "pink_shulker_box", + "input": [ + "shulker_box", + "pink_dye" + ] +}, { + "output": "purple_shulker_box", + "input": [ + "shulker_box", + "purple_dye" + ] +}, { + "output": "red_shulker_box", + "input": [ + "shulker_box", + "red_dye" + ] +}, { + "output": "white_shulker_box", + "input": [ + "shulker_box", + "white_dye" + ] +}, { + "output": "yellow_shulker_box", + "input": [ + "shulker_box", + "yellow_dye" + ] +}, { + "output": "stripped_bamboo_block", + "input": "bamboo_block" +}] \ No newline at end of file diff --git a/src/main/resources/data/eris_alchemy/eris_alchemy/item_emcs/minecraft.json b/src/main/resources/data/eris_alchemy/eris_alchemy/item_emcs/minecraft.json new file mode 100644 index 0000000..d4066ce --- /dev/null +++ b/src/main/resources/data/eris_alchemy/eris_alchemy/item_emcs/minecraft.json @@ -0,0 +1,307 @@ +{ + "minecraft:air": null, + "minecraft:allay_spawn_egg": null, + "minecraft:amethyst_cluster": null, + "minecraft:amethyst_shard": 1024, + "minecraft:ancient_debris": null, + "minecraft:apple": 128, + "minecraft:axolotl_spawn_egg": null, + "minecraft:bamboo": 2, + "minecraft:barrier": null, + "minecraft:bat_spawn_egg": null, + "minecraft:bedrock": null, + "minecraft:bee_spawn_egg": null, + "minecraft:beef": 64, + "minecraft:beetroot": 24, + "minecraft:beetroot_seeds": 16, + "minecraft:big_dripleaf": 1, + "minecraft:black_dye": 8, + "minecraft:blaze_rod": 1536, + "minecraft:blaze_spawn_egg": null, + "minecraft:blue_dye": 8, + "minecraft:bone": 96, + "minecraft:brain_coral": 1.0, + "minecraft:brain_coral_block": 1.0, + "minecraft:brain_coral_fan": 1.0, + "minecraft:brown_dye": 8, + "minecraft:brown_mushroom": 32, + "minecraft:brown_mushroom_block": null, + "minecraft:bubble_coral": 1.0, + "minecraft:bubble_coral_block": 1.0, + "minecraft:bubble_coral_fan": 1.0, + "minecraft:budding_amethyst": null, + "minecraft:bundle": null, + "minecraft:cactus": 8, + "minecraft:calcite": 1, + "minecraft:camel_spawn_egg": null, + "minecraft:carrot": 24, + "minecraft:cat_spawn_egg": null, + "minecraft:cave_spider_spawn_egg": null, + "minecraft:chain_command_block": null, + "minecraft:chicken": 64, + "minecraft:chicken_spawn_egg": null, + "minecraft:chorus_flower": 32, + "minecraft:chorus_fruit": 32, + "minecraft:chorus_plant": 24, + "minecraft:clay_ball": 64, + "minecraft:coal": 128, + "minecraft:cobbled_deepslate": 1, + "minecraft:cobblestone": 1, + "minecraft:cobweb": 12, + "minecraft:cocoa_beans": 8, + "minecraft:cod_spawn_egg": null, + "minecraft:command_block": null, + "minecraft:command_block_minecart": null, + "minecraft:copper_ingot": 85, + "minecraft:cow_spawn_egg": null, + "minecraft:creeper_head": 34816, + "minecraft:creeper_spawn_egg": null, + "minecraft:crimson_fungus": 24, + "minecraft:crimson_roots": 1, + "minecraft:crying_obsidian": 64, + "minecraft:cyan_dye": 8, + "minecraft:dead_brain_coral": 1.0, + "minecraft:dead_brain_coral_block": 1.0, + "minecraft:dead_brain_coral_fan": 1.0, + "minecraft:dead_bubble_coral": 1.0, + "minecraft:dead_bubble_coral_block": 1.0, + "minecraft:dead_bubble_coral_fan": 1.0, + "minecraft:dead_bush": 1, + "minecraft:dead_fire_coral": 1.0, + "minecraft:dead_fire_coral_block": 1.0, + "minecraft:dead_fire_coral_fan": 1.0, + "minecraft:dead_horn_coral": 1.0, + "minecraft:dead_horn_coral_block": 1.0, + "minecraft:dead_horn_coral_fan": 1.0, + "minecraft:dead_tube_coral": 1.0, + "minecraft:dead_tube_coral_block": 1.0, + "minecraft:dead_tube_coral_fan": 1.0, + "minecraft:debug_stick": null, + "minecraft:diamond": 8192, + "minecraft:dirt_path": 1, + "minecraft:dolphin_spawn_egg": null, + "minecraft:donkey_spawn_egg": null, + "minecraft:dragon_breath": 34816, + "minecraft:dragon_egg": 139264, + "minecraft:dragon_head": 34816, + "minecraft:drowned_spawn_egg": null, + "minecraft:echo_shard": 128, + "minecraft:egg": 32, + "minecraft:elder_guardian_spawn_egg": null, + "minecraft:elytra": 8196, + "minecraft:emerald": 1024, + "minecraft:enchanted_book": null, + "minecraft:end_portal_frame": null, + "minecraft:end_stone": 1, + "minecraft:ender_dragon_spawn_egg": null, + "minecraft:ender_pearl": 1024, + "minecraft:enderman_spawn_egg": null, + "minecraft:endermite_spawn_egg": null, + "minecraft:evoker_spawn_egg": null, + "minecraft:experience_bottle": null, + "minecraft:farmland": null, + "minecraft:feather": 48, + "minecraft:fern": 1, + "minecraft:fire_coral": 1.0, + "minecraft:fire_coral_block": 1.0, + "minecraft:fire_coral_fan": 1.0, + "minecraft:firework_star": null, + "minecraft:flint": 4, + "minecraft:fox_spawn_egg": null, + "minecraft:frog_spawn_egg": null, + "minecraft:frogspawn": null, + "minecraft:ghast_spawn_egg": null, + "minecraft:ghast_tear": 4096, + "minecraft:glow_berries": 8, + "minecraft:glow_lichen": 8, + "minecraft:glow_squid_spawn_egg": null, + "minecraft:glowstone_dust": 384, + "minecraft:goat_horn": 32, + "minecraft:goat_spawn_egg": null, + "minecraft:gold_ingot": 2048, + "minecraft:gold_nugget": 227.556, + "minecraft:grass": 1, + "minecraft:gravel": 4, + "minecraft:gray_dye": 8, + "minecraft:green_dye": 8, + "minecraft:guardian_spawn_egg": null, + "minecraft:gunpowder": 192, + "minecraft:hanging_roots": 1, + "minecraft:heart_of_the_sea": 4096, + "minecraft:hoglin_spawn_egg": null, + "minecraft:honeycomb": 24, + "minecraft:horn_coral": 1.0, + "minecraft:horn_coral_block": 1.0, + "minecraft:horn_coral_fan": 1.0, + "minecraft:horse_spawn_egg": null, + "minecraft:husk_spawn_egg": null, + "minecraft:ice": 1, + "minecraft:infested_chiseled_stone_bricks": null, + "minecraft:infested_cobblestone": null, + "minecraft:infested_cracked_stone_bricks": null, + "minecraft:infested_deepslate": null, + "minecraft:infested_mossy_stone_bricks": null, + "minecraft:infested_stone": null, + "minecraft:infested_stone_bricks": null, + "minecraft:ink_sac": 8, + "minecraft:iron_golem_spawn_egg": null, + "minecraft:iron_ingot": 256, + "minecraft:iron_nugget": 28.4444, + "minecraft:jigsaw": null, + "minecraft:kelp": 32, + "minecraft:knowledge_book": null, + "minecraft:lapis_lazuli": 864, + "minecraft:large_amethyst_bud": null, + "minecraft:large_fern": 1, + "minecraft:leather": 64, + "minecraft:light": null, + "minecraft:light_blue_dye": 8, + "minecraft:light_gray_dye": 8, + "minecraft:lily_pad": 16, + "minecraft:lime_dye": 8, + "minecraft:lingering_potion": null, + "minecraft:llama_spawn_egg": null, + "minecraft:magenta_dye": 8, + "minecraft:magma_cube_spawn_egg": null, + "minecraft:mangrove_roots": 1, + "minecraft:medium_amethyst_bud": null, + "minecraft:melon_slice": 144, + "minecraft:mooshroom_spawn_egg": null, + "minecraft:mud": 1, + "minecraft:mule_spawn_egg": null, + "minecraft:mushroom_stem": null, + "minecraft:mutton": 64, + "minecraft:name_tag": null, + "minecraft:nautilus_shell": 64, + "minecraft:nether_quartz_ore": null, + "minecraft:nether_sprouts": 1, + "minecraft:nether_star": 139264, + "minecraft:nether_wart": 24, + "minecraft:netherite_scrap": 16384, + "minecraft:obsidian": 64, + "minecraft:ocelot_spawn_egg": null, + "minecraft:orange_dye": 8, + "minecraft:panda_spawn_egg": null, + "minecraft:parrot_spawn_egg": null, + "minecraft:phantom_membrane": 96, + "minecraft:phantom_spawn_egg": null, + "minecraft:pig_spawn_egg": null, + "minecraft:piglin_brute_spawn_egg": null, + "minecraft:piglin_head": 34816, + "minecraft:piglin_spawn_egg": null, + "minecraft:pillager_spawn_egg": null, + "minecraft:pink_dye": 8, + "minecraft:pitcher_pod": 8, + "minecraft:player_head": 34816, + "minecraft:pointed_dripstone": 0.25, + "minecraft:polar_bear_spawn_egg": null, + "minecraft:porkchop": 64, + "minecraft:potato": 24, + "minecraft:potion": null, + "minecraft:prismarine_crystals": 384, + "minecraft:prismarine_shard": 0.25, + "minecraft:pufferfish_spawn_egg": null, + "minecraft:pumpkin": 144, + "minecraft:purple_dye": 8, + "minecraft:quartz": 64, + "minecraft:rabbit": 64, + "minecraft:rabbit_hide": 64, + "minecraft:rabbit_spawn_egg": null, + "minecraft:ravager_spawn_egg": null, + "minecraft:raw_copper": null, + "minecraft:raw_copper_block": null, + "minecraft:raw_gold": null, + "minecraft:raw_gold_block": null, + "minecraft:raw_iron": null, + "minecraft:raw_iron_block": null, + "minecraft:red_dye": 8, + "minecraft:red_mushroom": 32, + "minecraft:red_mushroom_block": null, + "minecraft:redstone": 64, + "minecraft:reinforced_deepslate": null, + "minecraft:repeating_command_block": null, + "minecraft:rotten_flesh": 24, + "minecraft:saddle": 192, + "minecraft:salmon_spawn_egg": null, + "minecraft:sculk": 1, + "minecraft:sculk_catalyst": 16, + "minecraft:sculk_sensor": 32, + "minecraft:sculk_shrieker": 16, + "minecraft:sculk_vein": 1, + "minecraft:scute": 32, + "minecraft:sea_pickle": 1, + "minecraft:seagrass": 1, + "minecraft:sheep_spawn_egg": null, + "minecraft:shulker_shell": 256, + "minecraft:shulker_spawn_egg": null, + "minecraft:silverfish_spawn_egg": null, + "minecraft:skeleton_horse_spawn_egg": null, + "minecraft:skeleton_skull": 34816, + "minecraft:skeleton_spawn_egg": null, + "minecraft:slime_ball": 24, + "minecraft:slime_spawn_egg": null, + "minecraft:small_amethyst_bud": null, + "minecraft:small_dripleaf": 1, + "minecraft:sniffer_egg": 32, + "minecraft:sniffer_spawn_egg": null, + "minecraft:snow_golem_spawn_egg": null, + "minecraft:snowball": 1, + "minecraft:soul_sand": 49, + "minecraft:soul_soil": 49, + "minecraft:spawner": null, + "minecraft:spider_eye": 128, + "minecraft:spider_spawn_egg": null, + "minecraft:splash_potion": null, + "minecraft:sponge": 48, + "minecraft:spore_blossom": 1, + "minecraft:squid_spawn_egg": null, + "minecraft:stick": 4, + "minecraft:stray_spawn_egg": null, + "minecraft:strider_spawn_egg": null, + "minecraft:string": 12, + "minecraft:structure_block": null, + "minecraft:structure_void": null, + "minecraft:sugar_cane": 32, + "minecraft:suspicious_gravel": 4, + "minecraft:sweet_berries": 8, + "minecraft:tadpole_spawn_egg": null, + "minecraft:tall_grass": 1, + "minecraft:tipped_arrow": null, + "minecraft:torchflower_seeds": 8, + "minecraft:totem_of_undying": 4096, + "minecraft:trader_llama_spawn_egg": null, + "minecraft:tropical_fish_spawn_egg": null, + "minecraft:tube_coral": 1.0, + "minecraft:tube_coral_block": 1.0, + "minecraft:tube_coral_fan": 1.0, + "minecraft:turtle_egg": 32, + "minecraft:turtle_spawn_egg": null, + "minecraft:twisting_vines": 8, + "minecraft:vex_spawn_egg": null, + "minecraft:villager_spawn_egg": null, + "minecraft:vindicator_spawn_egg": null, + "minecraft:vine": 8, + "minecraft:wandering_trader_spawn_egg": null, + "minecraft:warden_spawn_egg": null, + "minecraft:warped_fungus": 24, + "minecraft:warped_roots": 1, + "minecraft:warped_wart_block": 1, + "minecraft:weeping_vines": 8, + "minecraft:wet_sponge": 48, + "minecraft:wheat": 24, + "minecraft:wheat_seeds": 16, + "minecraft:white_dye": 8, + "minecraft:witch_spawn_egg": null, + "minecraft:wither_skeleton_skull": 34816, + "minecraft:wither_skeleton_spawn_egg": null, + "minecraft:wither_spawn_egg": null, + "minecraft:wolf_spawn_egg": null, + "minecraft:written_book": null, + "minecraft:yellow_dye": 8, + "minecraft:zoglin_spawn_egg": null, + "minecraft:zombie_head": 34816, + "minecraft:zombie_horse_spawn_egg": null, + "minecraft:zombie_spawn_egg": null, + "minecraft:zombie_villager_spawn_egg": null, + "minecraft:zombified_piglin_spawn_egg": null +} \ No newline at end of file diff --git a/src/main/resources/data/eris_alchemy/eris_alchemy/item_emcs/patchouli.json b/src/main/resources/data/eris_alchemy/eris_alchemy/item_emcs/patchouli.json new file mode 100644 index 0000000..6940bdf --- /dev/null +++ b/src/main/resources/data/eris_alchemy/eris_alchemy/item_emcs/patchouli.json @@ -0,0 +1,3 @@ +{ + "patchouli:guide_book": null +} \ No newline at end of file diff --git a/src/main/resources/data/eris_alchemy/eris_alchemy/item_tag_emcs/minecraft.json b/src/main/resources/data/eris_alchemy/eris_alchemy/item_tag_emcs/minecraft.json new file mode 100644 index 0000000..70e4803 --- /dev/null +++ b/src/main/resources/data/eris_alchemy/eris_alchemy/item_tag_emcs/minecraft.json @@ -0,0 +1,20 @@ +{ + "minecraft:coal_ores": null, + "minecraft:copper_ores": null, + "minecraft:decorated_pot_sherds": 64, + "minecraft:diamond_ores": null, + "minecraft:dirt": 1, + "minecraft:music_discs": 4096, + "minecraft:emerald_ores": null, + "minecraft:fishes": 64, + "minecraft:flowers": 16, + "minecraft:gold_ores": null, + "minecraft:iron_ores": null, + "minecraft:lapis_ores": null, + "minecraft:leaves": 1, + "minecraft:logs": 32, + "minecraft:redstone_ores": null, + "minecraft:sand": 1, + "minecraft:saplings": 32, + "minecraft:wool": 48 +} \ No newline at end of file diff --git a/src/main/resources/eris_alchemy.mixins.json b/src/main/resources/eris_alchemy.mixins.json index fb52b89..0fb729a 100644 --- a/src/main/resources/eris_alchemy.mixins.json +++ b/src/main/resources/eris_alchemy.mixins.json @@ -8,10 +8,6 @@ ], "mixins": [ "ContainerOpenersCounterMixin", - "CoralBlockMixin", - "CoralFanBlockMixin", - "CoralPlantBlockMixin", - "CoralWallFanBlockMixin", "RecipeMixin", "SmithingTransformRecipeMixin" ], -- cgit v1.2.3