Tutorials/Programs and editors/Tectonicus/Custom Blocks

By default Tectonicus will render all the standard Minecraft blocks, but if you're using mods that add new block types then those blocks will be skipped. By making a custom block config you can add in custom block types to Tectonicus so that maps made with your favourite mods will show correctly.

Internally all blocks in Minecraft have a unique number, or id. You can see all of these here: Block_ids. Mods will add blocks by using block ids currently not in use - if you're a mod author then you can make a block config for others to use, or you can ask the mod author to document the new blocks and their ids.

Tutorial: Adding a simple custom block
First, you need to create a custom block file. An empty file looks like this:

 

Since this is xml, the extension is usually .xml, but this is not required. We'll save this to C:/customBlockConfig.xml.

Say you've got a mod that adds a 'cheese' block, made entirely out of hard cheese. It's a solid block (like dirt or stone) but has a yellow image on all sides. You'd add your cheese block so your config looks like this:



 

There are a few important things to notice:

* The 'Solid' tag means that this block is completely solid, like dirt. * The 'id' is the id of the block. * The 'name' is the name given to the block * The 'texture' is the image file to use. Png, gif or jpeg are supported.

Then you need to include your custom config when drawing your map. Find your config file, and add the config to the 'layer' tags as shown (the last two attributes are the new ones):



Render your map, and the new block should appear!

Replacing Existing Blocks
If you want to change how a regular Minecraft block looks, then you can just redefine it in your custom block. For example, if we changed the id above from 200 to 12 (the block id of sand) then all of your sand would appear as cheese.

Removing Existing Blocks
If you *only* want custom blocks then you can set 'useDefaultBlocks' to 'false'. This means that you don't get all of the regular Minecraft blocks. You could then use this to make a config containing *only* ores (coal, iron, gold, diamonds) to get a map of where they are under ground. This config would look like this:

     

The interesting thing to note here is the texture="terrain[0, 2]" bit. Minecraft block images are stored in a single big image called terrain.png (see Texture_pack). Here terrain[0, 2] means use the block image from terrain.png in the first column and third row (the place where gold ore is).

Any image may be used with [] to select a tile from it, as long as the image has the same grid size as terrain.png (ie. 16x16). Eg.

  

Using Images From A Texture Pack
As well as using images directly from your hard drive, you can use images from either Minecraft or your texture pack.

 <Solid id="201" name="Cloud" texture="environment/clouds.png"/> </blockConfig>

As with regular textures, first the texture pack is checked and if the file does not exist there then the regular minecraft jar is checked.

Different Kinds Of Block
So far we have only used 'Solid' blocks, like stone and dirt. You can also add differently shaped blocks if a similar one already exists in Minecraft. For example a custom plant:

 <Plant id="202" name="Rose" texture="C:/Rose.png"/> </blockConfig>

Here the 'Plant' used instead of 'Solid' means instead of a solid block Tectonicus will draw a X with the image, like regular minecraft plants.

For examples of all the different kinds of block you can add, please see the default block config used by Tectonicus itself: http://www.triangularpixels.com/Tectonicus/defaultBlockConfig.xml

Air
Air blocks are empty space. Use them if you want to disable a regular minecraft block.

<Air id="0" name="Air"/>

Solid blocks
Creates a square cube like dirt or stone. May have the same image on all sides, or a different image on the top.

Optionally may be drawn with 'alphaTest'. This doesn't draw transparent pixels (like glass or mob spawners)

<Solid id="1" name="Stone" texture="terrain[1, 0]"/>

<Solid id="46" name="TNT" side="terrain[8, 0]" top="terrain[9, 0]"/>

<Solid id="52" name="Mob Spawner" texture="terrain[1, 4]" alphaTest="true"/>

Water
A solid block with transparent sides and special handling to make deeper water darker.

<Water id="8" name="Water" texture="terrain[15, 12]"/>

Log
A solid block with different side and top textures. Texture changes based on the block's data value.

<Log id="17" name="Log" normal="terrain[4, 1]" spruce="terrain[4, 7]" birch="terrain[5, 7]" top="terrain[5, 1]"/>