-
Notifications
You must be signed in to change notification settings - Fork 0
Inventory
The inventory is currently defined by a static array in blocklisttask.cpp:
static const BLOCK_WDATA user_selectable[] = {
BLOCK_STONE,
BLOCK_COBBLESTONE,
BLOCK_DIRT,
BLOCK_GRASS,
BLOCK_SAND,
BLOCK_WOOD,
BLOCK_LEAVES,
BLOCK_PLANKS_NORMAL,
BLOCK_PLANKS_DARK,
BLOCK_PLANKS_BRIGHT,
BLOCK_WALL,
BLOCK_GLASS,
BLOCK_DOOR,
BLOCK_COAL_ORE,
BLOCK_GOLD_ORE,
BLOCK_IRON_ORE,
BLOCK_DIAMOND_ORE,
BLOCK_REDSTONE_ORE,
BLOCK_IRON,
BLOCK_GOLD,
BLOCK_DIAMOND,
BLOCK_GLOWSTONE,
BLOCK_NETHERRACK,
BLOCK_TNT,
BLOCK_SPONGE,
BLOCK_FURNACE,
BLOCK_CRAFTING_TABLE,
BLOCK_BOOKSHELF,
BLOCK_PUMPKIN,
getBLOCKWDATA(BLOCK_WATER, RANGE_WATER),
getBLOCKWDATA(BLOCK_LAVA, RANGE_LAVA),
getBLOCKWDATA(BLOCK_FLOWER, 0),
getBLOCKWDATA(BLOCK_FLOWER, 1),
getBLOCKWDATA(BLOCK_MUSHROOM, 0),
getBLOCKWDATA(BLOCK_MUSHROOM, 1),
getBLOCKWDATA(BLOCK_WHEAT, 0),
BLOCK_SPIDERWEB,
BLOCK_TORCH,
getBLOCKWDATA(BLOCK_CAKE, 0),
BLOCK_REDSTONE_LAMP,
BLOCK_REDSTONE_SWITCH,
BLOCK_PRESSURE_PLATE,
BLOCK_REDSTONE_WIRE,
BLOCK_REDSTONE_TORCH,
getBLOCKWDATA(BLOCK_WOOL, 0),
getBLOCKWDATA(BLOCK_WOOL, 1),
getBLOCKWDATA(BLOCK_WOOL, 2),
getBLOCKWDATA(BLOCK_WOOL, 3),
getBLOCKWDATA(BLOCK_WOOL, 4),
getBLOCKWDATA(BLOCK_WOOL, 5),
getBLOCKWDATA(BLOCK_WOOL, 6),
getBLOCKWDATA(BLOCK_WOOL, 7),
getBLOCKWDATA(BLOCK_WOOL, 8),
getBLOCKWDATA(BLOCK_WOOL, 9),
getBLOCKWDATA(BLOCK_WOOL, 10),
getBLOCKWDATA(BLOCK_WOOL, 11),
getBLOCKWDATA(BLOCK_WOOL, 12),
getBLOCKWDATA(BLOCK_WOOL, 13),
getBLOCKWDATA(BLOCK_WOOL, 14),
getBLOCKWDATA(BLOCK_WOOL, 15),
BLOCK_CACTUS,
getBLOCKWDATA(BLOCK_SLAB, 0),
getBLOCKWDATA(BLOCK_SLAB, 1),
getBLOCKWDATA(BLOCK_SLAB, 2),
getBLOCKWDATA(BLOCK_SLAB, 3),
getBLOCKWDATA(BLOCK_SLAB, 4),
getBLOCKWDATA(BLOCK_SLAB, 5),
getBLOCKWDATA(BLOCK_SLAB, 6),
getBLOCKWDATA(BLOCK_SLAB, 7),
getBLOCKWDATA(BLOCK_CARPET, 0),
getBLOCKWDATA(BLOCK_CARPET, 1),
getBLOCKWDATA(BLOCK_CARPET, 2),
getBLOCKWDATA(BLOCK_CARPET, 3),
getBLOCKWDATA(BLOCK_CARPET, 4),
getBLOCKWDATA(BLOCK_CARPET, 5),
getBLOCKWDATA(BLOCK_CARPET, 6),
getBLOCKWDATA(BLOCK_CARPET, 7),
getBLOCKWDATA(BLOCK_CARPET, 8),
getBLOCKWDATA(BLOCK_CARPET, 9),
getBLOCKWDATA(BLOCK_CARPET, 10),
getBLOCKWDATA(BLOCK_CARPET, 11),
getBLOCKWDATA(BLOCK_CARPET, 12),
getBLOCKWDATA(BLOCK_CARPET, 13),
getBLOCKWDATA(BLOCK_CARPET, 14),
getBLOCKWDATA(BLOCK_CARPET, 15)
};It contains every block, including special blocks displayed in the inventory, the block order in the inventory is the same as the one in the array Additionally, special thanks to @m-doescode for creating the scrollable inventory code and adjusting their implementation so that it is suitable for this fork. @m-doescode's inventory code allows the inventory to scroll, allowing for infinite items.
To modify the inventory, you just need to add the item to the array in the desired location, to add an item to the array, you can either:
A. Use the block ID (use for standard blocks) For example:
BLOCK_DIRTwould add dirt to the array
B. Use the block with data (use for special blocks) For example:
getBLOCKWDATA(BLOCK_WOOL, 15)which would add a wool block with its data bits (see Block Data Structure to whatever is supplied as the argument.
NOTE: If you are using orientation data in your block, make sure to keep in mind the binary structure of the block as you pass your data to the argument, otherwise, the supplied data argument will overwrite the orientation data, so be sure to bit-shift it properly
- Home
- Building Crafti
- Crafti Versions
- Crafti Textures
-
Crafti Development
-
Inventory
- Adding blocks to inventory
- Changing inventory parameters
-
Blocks
- Regular Blocks
- Special Blocks
- Special Block Definitions
- Special Block Textures
- Special Block Name
- Special Block Renderers/Logic
- Special Block Data
- Tick() and Saving Data
- Tutorial: Redstone Wool
- Advanced Block Documentation
- Warning
- All Included Renderers
- Block Meshes
- Block Collision
- Block Transparency
- Block Renderer Texture "Cropping"
- All Block Renderer Parameters
- All Block Renderer Functions
- Block Data Structure
- Redstone
- How Redstone works in Crafti
- Redstone in special blocks
- World
- Chunks
- World Generation
- Structure Generation
- Localisation
- Setting the game's language
- Adding a language
-
Inventory