OreCruncher / ThermalRecycling

Thermal Expansion add-on for recycling
MIT License
10 stars 7 forks source link

Change quantities of item used when scrapping? #93

Closed Darkosto closed 8 years ago

Darkosto commented 8 years ago

Is it possible to change the number of items consumed when scrapping using minetweaker? For example, I have labeled cobblestone as inferior scrap but it consumes an entire stack to recycle. Is there a line I can enter to change the number it uses to produce scrap?

Thank you :)

OreCruncher commented 8 years ago

There is a way, but it's not perfect. Here is what you can do:

ItemDataRegistry.setScrapValue(<minecraft:cobblestone>, SCRAPVALUE_INFERIOR); ItemDataRegistry.setBlockedFromScrapping(<minecraft:cobblestone>, false); RecipeDataRegistry.add(<minecraft:cobblestone> * 64, [<minecraft:cobblestone>]);

By not perfect the output of the scrap operation is a single piece of cobblestone. This means that for a certain percentage of operations the result will be a piece of cobblestone. I do think, however, it gets you a long way toward what you want to do.

Ideally you would want to set up a scrap recipe without any output. Right now the parameter checking in the Minetweaker interface layer checks that the output has at least one item. I need to relax that check. Once that build is available you would just have to specify "[]" as the output parameters and it will do exactly what you want.

EDIT: For existing recipes that have an output list you would have to remove the recipe and re-add it. This doesn't apply to your case of cobblestone, but I mention in case someone else wants to do something similar for other items, say requiring 2 minecarts to scrap to 5 iron ingots.

OreCruncher commented 8 years ago

Making a fix so that you can do this in a script:

ItemDataRegistry.setScrapValue(<minecraft:cobblestone>, SCRAPVALUE_INFERIOR); ItemDataRegistry.setBlockedFromScrapping(<minecraft:cobblestone>, false); RecipeDataRegistry.add(<minecraft:cobblestone> * 64, null);

This will be in the next BETA drop.

OreCruncher commented 8 years ago

Posted a BETA that includes the change: http://minecraft.curseforge.com/projects/thermal-recycling/files

Darkosto commented 8 years ago

Thank you very much for your help :)

Darkosto commented 8 years ago

Hey OreCruncher!

Thank you once again for your assistance. With the latest update on Curse, I cannot seem to have the Thermal Recycler use less than 64 cobblestone per operation. This is currently my Minetweaker file: http://pastebin.com/0xS7D5V0

Could you please help me figure out exactly what I'm doing wrong?

Thank you :)

OreCruncher commented 8 years ago

Yep - that is the way it is working. The Thermal Recycler is waiting for 64 blocks of cobblestone before it commences operation. This is the line that is configuring it:

RecipeDataRegistry.add(minecraft:cobblestone *64, null);

If you want to have it consume less, change the 64 to some other value.

Darkosto commented 8 years ago

That's the reason I'm checking my work, I have set that value of 64 to other values and it still consumes the full stack of Cobblestone. I made sure to do a full client restart between value changes and it still takes 64 cobble per operation.

OreCruncher commented 8 years ago

You are running local, right? Not attaching to a server?

Darkosto commented 8 years ago

That's correct, this is single player. Not on a server.

OreCruncher commented 8 years ago

I tried this script in my sandbox and it is working:

import mods.recycling.ItemDataRegistry; import mods.recycling.RecipeDataRegistry;

ItemDataRegistry.setScrapValue(minecraft:cobblestone, SCRAPVALUE_INFERIOR); ItemDataRegistry.setBlockedFromScrapping(minecraft:cobblestone, false); RecipeDataRegistry.add(minecraft:cobblestone *32, null);

The script you linked to above - this the only script executing on the system?

Darkosto commented 8 years ago

For Thermal Recycling? That is correct, I have only that 1 file for the mod. Nothing else should be messing with it.

OreCruncher commented 8 years ago

This is a head scratcher. Is the modpack available somewhere for download? It may be one of the other mods messing with things.

Darkosto commented 8 years ago

I can make it available to you, what is your minecraft ign? I'll add you as a private tester for the pack on the ATLauncher

OreCruncher commented 8 years ago

OreCruncher is my ign. I haven't use the ATLauncher so be patient. :)

Darkosto commented 8 years ago

No worries, just make sure you're signed into the launcher and the modpack "Dawn of the Void" will show up for you on the very bottom. That particular script for recycling may be a bit out of date but it will get you everything you need to test it out.

OreCruncher commented 8 years ago

Just downloaded ATLauncher 3.2.3.1 and it is not showing in the list. Tried searching for "Dawn of the Void" as well.

Darkosto commented 8 years ago

Are you signed into the launcher?

OreCruncher commented 8 years ago

If you mean did I create an account on the account tab, yes.

EDIT: Just checked right this second and it is now showing up.

OreCruncher commented 8 years ago

OK - it is the Twilight Forest Large Cobble block that is messing with it. That recipe takes 64 cobblestone to make one large cobble. What is happening is that Thermal Recycling is picking the more expensive scrapping recipe in order to avoid infinite resource loops (where you can run an items through the Thermal Recycler and get more than you started with).

What you need to do is tell Thermal Recyling to ignore Cobblestone during it's recipe scan phase. This will prevent Thermal Recycling from analyzing the cobble stone recipes (Large Cobble block -> 64 cobble). Then when you set the standard scrap recipe requiring 32 blocks it will take.

Here is what I added to the bottom of your script:

ItemDataRegistry.setIgnoreRecipe(minecraft:cobblestone, true); RecipeDataRegistry.add(minecraft:cobblestone *32, null);

Let me know if you have further questions.

P.S. The pack looks cool. :)