[SPIGOT-3473] Custom Anvil Inventory Returns CraftInventoryCustom not CraftInventoryAnvil Created: 29/Jul/17 Updated: 29/Jul/17 Resolved: 29/Jul/17 |
|
Status: | Resolved |
Project: | Spigot |
Component/s: | None |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Bug | Priority: | Minor |
Reporter: | Nathan Lathrop | Assignee: | Unassigned |
Resolution: | Invalid | Votes: | 0 |
Labels: | Anvils, anvil, cast, inventory | ||
Environment: |
All spigot based servers 1.12--R0.1 |
Description |
In attempting to manipulate the text field in an anvil menu, I would create an inventory with Bukkit.createInventory(player, InventoryType.Anvil) which then in all return cases returns CraftInventoryCustom which can be cast to neither CraftInventoryAnvil nor AnvilInventory. |
Comments |
Comment by md_5 [ 29/Jul/17 ] |
All custom inventories are custom. You cannot replicate Minecraft inventories with this method. This is because these inventories require a presence in the world and player for much of their functionality. |
Comment by Black Hole [ 29/Jul/17 ] |
As a workaround set the item at index 0 with a custom name. That name will be used in the text field. |