Last active
August 29, 2015 14:10
-
-
Save maxov/32bf70235b8b97440129 to your computer and use it in GitHub Desktop.
inventory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Player player; | |
ItemStack myItemStack = ItemStacks.builder().itemType(ItemType.PLANKS).dataValue(3); | |
// used by player and crafting table -- has matrix and result | |
CraftingInventory crafting = player.getInventory().getCraftingInventory(); | |
// the 'input' to the crafting inventory | |
// it is a grid of items | |
ItemGrid matrix = crafting.getMatrix(); | |
// _ * | |
// _ _ | |
matrix.setContents(1, 0, itemStack); | |
matrix.setContents(new Vector2i(1, 0), itemStack); | |
// a single item slot | |
ItemSingle result = crafting.getResult(): | |
// we can also use the old, indexed way way | |
player.getInventory().setContents(2, itemStack); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment