Skip to content

Commit e013fec

Browse files
committed
Add support for upside-down recipes, Closes #3
1 parent 7bb6675 commit e013fec

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/main/java/org/cyclops/structuredcrafting/craft/WorldCraftingMatrix.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public boolean craft() {
8787
BlockPos[] positions = new BlockPos[9];
8888
IItemStackProvider[] providers = new IItemStackProvider[9];
8989
ItemStack itemStack = null;
90-
for(int k = 0; k < 2; k++) {
90+
for(int k = 0; k < 3; k++) {
9191
// Set crafting grid
9292
if(itemStack == null) {
9393
for (int i = -1; i < 2; i++) {
@@ -103,8 +103,10 @@ public boolean craft() {
103103
// This makes sure we can also accept recipes which are rotated, mirroring is already supported by Vanilla.
104104
if (k == 0) {
105105
INVENTORY_CRAFTING.setItemStack(i + 1, j + 1, itemStackInput);
106-
} else {
106+
} else if(k == 1) {
107107
INVENTORY_CRAFTING.setItemStack(j + 1, i + 1, itemStackInput);
108+
} else if(k == 2) {
109+
INVENTORY_CRAFTING.setItemStack(i + 1, 2 - (j + 1), itemStackInput);
108110
}
109111
positions[arrayIndex] = pos;
110112
providers[arrayIndex] = result != null ? result.getRight() : null;

0 commit comments

Comments
 (0)