-
Bug
-
Resolution: Invalid
-
Minor
-
Windows 10 64 Bit, Java JDK 8, not that any of those really matter.
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
}}