Pitan76 / item-alchemy

https://www.curseforge.com/minecraft/mc-mods/item-alchemy-fabric
20 stars 7 forks source link

Infinite EMC with Mining Dimensions mod #33

Open valous2 opened 1 year ago

valous2 commented 1 year ago

Fabric version: 0.14.14 Item-alchemy version: 0.4.6 Mining Dimensions [FABRIC] version: 1.19.2-1.4.27

I noticed that the portal blocks created in the mining dimensions mod can be exploited to obtain infinite emc because emc value assigned to blocks is equal to the handheld teleporter plus the emc of the original stone brick. This would be okay is the handheld teleporter was consumed when used to make the block but it is not.

Steps to reproduce:

  1. Buy a stone brick for 1 emc.
  2. Place stone brick into crafting grid with any teleporter to make a portal block.
  3. Turn portal block back into emc value equal to both blocks.
  4. repeat

I realize there a newer version of this mod at the time of this posting and will try to see if it fixes this but thought I'd report it just in case it does not as I had not seen this mentioned before. image image

PTOM76 commented 1 year ago

This is a bit of a tricky issue. It looks like it will take some time to fix. /itemalchemy setemc [item] [emc] As a temporary measure, EMC can be set for each item with the above command.

valous2 commented 1 year ago

Ok take your time and thanks for letting me know about the command. That should fix the issue for the time being.

OffsetMonkey538 commented 1 year ago

interesting... maybe we could check if an item has a recipe which takes in an item that will not get consumed and just set the emc to 0?

OffsetMonkey538 commented 1 year ago

Or maybe using the emc of the items that will get consumed would make more sense, then it would have the emc of 1 like the stone brick it came from ^

OffsetMonkey538 commented 1 year ago

Looking at the code, it should be as easy as a

if (stack.getRecipeRemainer().getItem() == stack.getItem()) continue;

in the EMCManager.addEmcFromRecipe method. That should filter out items that don't get used. Might make sense to store the remainder item and input item as more variables for readability but whatever. I would try that and then make a pr but I'm leaving in a few minutes and wont be back until next week.