Skip to content

Commit 3516721

Browse files
committed
Fix multi-output recipes voiding > 1 in Fabric, Closes #44
1 parent e7866c3 commit 3516721

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

loader-common/src/main/java/org/cyclops/structuredcrafting/gametest/GameTestsCommon.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ public void testCraftFromWorldToChestStairs(GameTestHelper helper) {
195195

196196
helper.succeedWhen(() -> {
197197
// Result
198-
assertChestContains(helper, POS.offset(2, 2, 1), new ItemStack(Blocks.OAK_STAIRS));
198+
assertChestContains(helper, POS.offset(2, 2, 1), new ItemStack(Blocks.OAK_STAIRS, 4));
199199

200200
// Inputs must be consumed
201201
helper.assertBlockNotPresent(Blocks.OAK_PLANKS, POS.offset(3, 1, 3));
@@ -229,7 +229,7 @@ public void testCraftFromChestsToChestStairs(GameTestHelper helper) {
229229

230230
helper.succeedWhen(() -> {
231231
// Result
232-
assertChestContains(helper, POS.offset(2, 2, 1), new ItemStack(Blocks.OAK_STAIRS));
232+
assertChestContains(helper, POS.offset(2, 2, 1), new ItemStack(Blocks.OAK_STAIRS, 4));
233233

234234
// Inputs must be consumed
235235
assertChestEmpty(helper, POS.offset(3, 1, 3));
@@ -562,7 +562,7 @@ protected void assertChestEmpty(GameTestHelper helper, BlockPos pos) {
562562
}
563563

564564
protected void assertChestContains(GameTestHelper helper, BlockPos pos, ItemStack itemStack) {
565-
helper.assertBlockEntityData(pos, (ChestBlockEntity chest) -> ItemStack.isSameItemSameComponents(chest.getItem(0), itemStack), () -> "Chest is not empty");
565+
helper.assertBlockEntityData(pos, (ChestBlockEntity chest) -> ItemStack.matches(chest.getItem(0), itemStack), () -> "Chest is not empty");
566566
}
567567

568568
}

loader-fabric/src/main/java/org/cyclops/structuredcrafting/craft/provider/InventoryItemStackProviderFabric.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public boolean addItemStack(Level world, BlockPos pos, Direction side, ItemStack
7777
Storage<ItemVariant> storage = ItemStorage.SIDED.find(world, pos, side);
7878
if (storage != null) {
7979
try (Transaction tx = Transaction.openOuter()) {
80-
long inserted = storage.insert(ItemVariant.of(itemStack), 1, tx);
80+
long inserted = storage.insert(ItemVariant.of(itemStack), itemStack.getCount(), tx);
8181
if (simulate) {
8282
tx.abort();
8383
} else {

0 commit comments

Comments
 (0)