[BUILDTOOLS-205] Player Inventory Content Length and Inventory size mismatch. Created: 04/Mar/16  Updated: 11/Dec/17  Resolved: 04/Mar/16

Status: Closed
Project: BuildTools
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: zack6849 Assignee: Unassigned
Resolution: Invalid Votes: 0
Labels: 1.9, Craftbukkit, PlayerInventory, inventory
Environment:

Windows 10 64 Bit, Java JDK 8, not that any of those really matter.



 Description   

Cloning an inventory of a player will throw an Illegal Argument exception, as the latest builds of spigot seem to expect a player inventory to be 39 slots, where it is currently 41.

Example Code:
{{ Inventory original = player.getInventory();
Inventory cloned = Bukkit.createInventory(null, original.getType());
System.out.println("Current inventory size: " + original.getSize() + " Type: " + original.getType() + " Default size: " + original.getType().getDefaultSize());
System.out.println("Original Inventory Type: " + original.getType());
System.out.println("Cloned Inventory Type: " + cloned.getType());
System.out.println("Original Inventory Size: " + original.getSize());
System.out.println("Cloned Inventory Size: " + cloned.getSize());
System.out.println("Original Content Size: " + original.getContents().length);
cloned.setContents(original.getContents()); //This line will throw an exception, because original's contents is larger than original's type max size
}}



 Comments   
Comment by zack6849 [ 04/Mar/16 ]

Don't know how to delete this issue, real issue is here: https://hub.spigotmc.org/jira/browse/SPIGOT-1724

Comment by zack6849 [ 04/Mar/16 ]

Sorry, dont know why this got filed as a builtools issue!

Generated at Sat Dec 13 14:33:55 UTC 2025 using Jira 10.3.13#10030013-sha1:56dd970ae30ebfeda3a697d25be1f6388b68a422.