mirror of
				https://github.com/SquidDev-CC/CC-Tweaked
				synced 2025-10-31 05:33:00 +00:00 
			
		
		
		
	Correctly obey stack limits in OffsetStorage.extract/insert
Many thanks to Lem for managing to reproduce it. It was actually an easy bug bug to spot on second look, but having a reliable way to verify was super helpful. Fixes #1338
This commit is contained in:
		| @@ -22,7 +22,7 @@ public class InventoryUtilTest { | ||||
| 
 | ||||
|         var remainder = InventoryUtil.storeItemsFromOffset(container, new ItemStack(Items.COBBLESTONE, 32), 4); | ||||
|         assertThat("Remainder is empty", remainder, isStack(ItemStack.EMPTY)); | ||||
|         assertThat("Was inserted into slot", container.getItem(4), isStack(new ItemStack(Items.COBBLESTONE, 32))); | ||||
|         assertThat("Was inserted into slot", container.getItem(4), isStack(Items.COBBLESTONE, 32)); | ||||
|     } | ||||
| 
 | ||||
|     @Test | ||||
| @@ -33,6 +33,6 @@ public class InventoryUtilTest { | ||||
| 
 | ||||
|         var remainder = InventoryUtil.storeItemsFromOffset(container, new ItemStack(Items.COBBLESTONE, 32), 4); | ||||
|         assertThat("Remainder is empty", remainder, isStack(ItemStack.EMPTY)); | ||||
|         assertThat("Was inserted into slot", container.getItem(1), isStack(new ItemStack(Items.COBBLESTONE, 32))); | ||||
|         assertThat("Was inserted into slot", container.getItem(1), isStack(Items.COBBLESTONE, 32)); | ||||
|     } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Jonathan Coates
					Jonathan Coates