Tech Reborn

Tech Reborn

33M Downloads

Auto Crafting Table making Fireworks without consuming Gunpowder/Paper

akrauze opened this issue ยท 5 comments

commented

Describe the bug
Auto Crafting Table making Fireworks without consuming Gunpowder/Paper.

Steps to Reproduce
Steps to reproduce the behavior:

  • Place a Auto Crafting Table connected to power
  • Place a ANY storage (vanilla chest works same way as TR Storage)
  • Setup Auto Crafting Table to output to the storage
  • Place two Paper and 2,4 or 6 Gunpowder on the proper configuration
  • Auto Crafting Table makes Fireworks without consuming neither Gunpowder nor Paper.

Screenshots
video

Environment (please complete the following information with the version):

  • Minecraft: 1.21.1
  • Mod Loader: Fabric

Logs
No relevant logs

Additional context
Mod List: Tech Reborn (233564), Reborn Core (237903), Cupboard (326652), FallingTree (349559), Connectivity (470193), Portable Mobs (503922), Ender Dragon Egg Respawn (Fabric) (832446), Respawning Structures[Forge/Fabric] (969937), AutoModpack (k68glP2e), Trinkets (5aaWibi9), Elytra Slot (mSQF1NpT), Towns and Towers (DjLobEOy), Scarecrows' Territory (1RaTTUPz), YetAnotherConfigLib (YACL) (1eAoo2KR), Comforts (SaCpeal4), Clumps (Wnxd13zP), Custom Mob Spawns (PHfxYsDH), Cloth Config API (9s6osm5g), WTHIT (6AQIaxuO), Artifacts (P0Mu4wcQ), Concurrent Chunk Management Engine (Fabric) (VSNURh3q), SuperMartijn642's Core Lib (rOUBggPv), Cristel Lib (cl223EMc), Almanac (Gi02250Z), Mod Menu (mOgUt4GM), Advanced Backups (Jrmoreqs), ImmediatelyFast (5ZwdcRci), Additional Enchanted Miner (jhxX1zVW), FerriteCore (uXXizFIs), Forge Config API Port (ohNO6lps), Hold That Chunk (LXJlc5WJ), Item Collectors (y9vDr4Th), Architectury API (lhGA9TYQ), Lightweight Inventory Sorting (JrrZfsph), SuperMartijn642's Config Lib (LN9BxssP), Clock HUD (58HcosC7), Fabric API (P7dR8mSH), Rebind Narrator (qw2Ls89j), bad packets (ftdbN0KK), Carry On (joEfVgkn), Xaero's World Map (NcUtCpym), Open Parties and Claims (gF3BGWvG), FPS - Display (DIlqwRFH), Anvil Never Too Expensive (TEOa2X8B), Scalable Cat's Force (zr0QMQMo), Xaero's Minimap (1bokaNcj), Alternate Current (r0v8vy1s), spark (l6YH9Als), Let Me Despawn (vE2FN5qn), Simple Copper Pipes (9r4ZkgSN), Lithium (gvQqBUqZ), Neruina - Ticking Entity Fixer (1s5x833P), Iris Shaders (YL57xq9U), Stack to Nearby Chests (HtGckJVc), Debugify (QwxR6Gcd), ModernFix (nmDcB62a), Roughly Enough Items (REI) (nfn13YXA), Wormhole (Portals) (6nHZTTjQ), Tesseract (OUhp5O2m), Sodium (AANobbMI)

commented

Thank you for reporting this bug.
You can download a preview build to fix it:
https://github.com/TechReborn/TechReborn/actions/runs/12976094682
(Download Artifacts and unzip the TechreBorn-5.12.3.jar)

Currently 1.21.4 is still in beta version. If you encounter any problems, please raise an issue.

commented

This can be reproduced in 1.21.4 SP with only Fabric API, CoreReborn and TechReborn.

commented

AutoCraftingTable cannot get the ingredients for SpecialCraftingRecipe.
The following recipe will not consume items:
Image

commented

That seems a major limitation that unless I'm missing something should be quite simple (not very elegant) to resolve....

		List<Ingredient> ingredients;
		if(recipe instanceof SpecialCraftingRecipe) {
			ingredients = getSpecialRecipeIngredients((SpecialCraftingRecipe) recipe);
		} else {
			ingredients = recipe.getIngredientPlacement().getIngredients();
		}

With all the Special Recipes this probably should belong on a helper/utility class.

	private List<Ingredient> getSpecialRecipeIngredients(CraftingRecipe recipe) {
		List<Ingredient> ingredients = new ArrayList<>();
		if(recipe instanceof FireworkRocketRecipe) {
			for(i = 0; i < 4; i++) {
				var itemStack = inventory.getStack(i);
				if(itemStack.isOf(Items.GUNPOWDER)) {
					ingredients.add(Ingredient.ofItem(Items.GUNPOWDER));
				} else if (itemStack.isOf(Items.PAPER)) {
					ingredients.add(Ingredient.ofItem(Items.GUNPOWDER));
				} else if (itemStack.isOf(Items.FIREWORK_STAR)) {
					ingredients.add(Ingredient.ofItem(Items.FIREWORK_STAR));
				}
			}

		}
		return ingredients;
	}
commented

Simple and crude hard coding can indeed solve some problems. I found that the processing logic in the Crafting Table code is different. In addition, the Auto Crafting Table has performance issues, so I am considering refactoring it.