[SPIGOT-82] InventoryType.WORKBENCH doesn't create correct inventory screen Created: 01/Dec/14 Updated: 03/Dec/14 Resolved: 03/Dec/14 |
|
Status: | Closed |
Project: | Spigot |
Component/s: | None |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Bug | Priority: | Major |
Reporter: | cindy_k | Assignee: | Thinkofname |
Resolution: | Fixed | Votes: | 1 |
Labels: | Craftbukkit, bug | ||
Environment: |
Craftbukkit 1.8 |
Description |
i = getServer().createInventory(new UsesHolder(), InventoryType.WORKBENCH); http://paste.md-5.net/juxituxejo.java |
Comments |
Comment by Fabian Faßbender [ 01/Dec/14 ] |
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/pull-requests/18/overview fixes the showing of all Inventory Types. One thing to say: @Override public Inventory createInventory(InventoryHolder owner, InventoryType type) { switch ( type ) { case WORKBENCH: CraftInventory craftInventory = null; Player player = null; if ( owner instanceof Player ) { player = (Player) owner; craftInventory = (CraftInventoryPlayer) player.getInventory(); } if ( craftInventory != null && craftInventory.getInventory() instanceof PlayerInventory ) { ContainerWorkbench workbench = new ContainerWorkbench( (PlayerInventory) craftInventory.getInventory(), ((CraftWorld) player.getWorld()).getHandle(), new BlockPosition( player.getLocation().getX(), player.getLocation().getY(), player.getLocation().getZ() ) ); workbench.checkReachable = false; InventoryCraftResult inventoryCraftResult = new InventoryCraftResult(); InventoryCrafting inventoryCrafting = new InventoryCrafting(workbench,3,3,((CraftPlayer)player).getHandle()); return new CraftInventoryCrafting(inventoryCrafting, inventoryCraftResult); } } // TODO: Create the appropriate type, rather than Custom? return new CraftInventoryCustom(owner, type); } failed. It opens the Inventory and takes items but does not update the Inventory itself. |