Extended Crafting

Extended Crafting

34M Downloads

Bottom right item in crafting table is not copied when using recipe maker

Goldenlion5648 opened this issue ยท 1 comments

commented

Describe the bug
Using the Recipe maker for a crafttweaker recipe does not copy the item in the bottom right slot
Caused by this:

int slots = inventory.getSlots();
int sr = (int) Math.floor(Math.sqrt(slots));
if (slots / sr != slots)
slots -= 1;
for (int i = 0; i < slots; i++) {

To Reproduce
Use the recipe maker on any of the crafting tables from extended crafting, even when empty the last slot is not filled with minecraft:air

Expected behavior
Bottom right item should be copied

Screenshots / Scripts / Logs
Please add your logs and scripts (if applicable).
image
yields:
image

Versions (please complete the following information):

  • Minecraft: 1.16.4
  • Forge: 35.1.6
  • Cucumber: Cucumber-1.16.4-4.1.5.jar
  • Extended Crafting: ExtendedCrafting-1.16.4-3.1.2.jar
  • CraftTweaker (if applicable): CraftTweaker-1.16.4-7.0.0.63.jar
commented

This would also fix the issue of this code never running at the end of making the recipe, causing the ending ] to be left out

if (i + 1 == sr || (i + 1) % sr == 0) {
string.append("]");
if (i + 1 < slots) {
string.append(", ");
string.append(NEW_LINE);
} else {
string.append(System.lineSeparator());
}
}
}
string.append("]);");