Tuesday, August 25, 2015

Custom blocks, custom block shapes & custom crafting recipes

In this tutorial I will show you how to add new blocks to the game.
  1. Adding a new Block
  2. Shaping the Block
  3. Adding a recipe for the Block

1.Adding a new block:

2. Shaping the block

Code reference: Tile::setShape. It takes 6 input parameters: minX, minY, minZ, maxX, maxY, maxZ
Usage: tileInstancePointer->setShape(...)
The minX, minY, minZ parameters are the offset of starting points of the drawn block, and the maxX, maxY and maxZ are the ends.

Some sample shapes:
  • Cube: Tile::setShape(0.25, 0.25, 0.25, 0.75, 0.75, 0.75);
  • Pillar: Tile::setShape(0.25, 0, 0.25, 0.75, 1, 0.75);
  • Enchanting Table: Tile::setShape(0, 0, 0, 1, 0.75, 1);
 

 3. Custom block recipes

4 comments:

  1. Could you upload tge main.cpp files on dropbox? I can not read in the video. Pls

    ReplyDelete
  2. Could you upload tge main.cpp files on dropbox? I can not read in the video. Pls

    ReplyDelete
  3. I can not add blocks! When active Addon and start the game shows an error!

    ReplyDelete
  4. You know how i can make dual wieldings??????

    ReplyDelete