Skip to content
Joe edited this page Jul 3, 2016 · 2 revisions

To add your machine, you register it with the MachineRegistry, which does the heavy lifting for you. There are three steps you must follow to get your machine working:

  1. Register Machine
  2. Register Recipes
  3. Add textures
  4. Finish

Register Machine

In the preInit method of your mod(or common proxy), put something like this: Machine x = new Machine(); x.name = "blockname"; Make sure you replace the blockname.

Register Recipes

Just under, add: MachineRecipeHandler recipes = new MachineRecipeHandler(); recipes.registerItemRecipe(Items.apple, new ItemStack(Items.apple, 2)); x.recipes = recipes; You can add block and item recipes to the MachineRecipeHandler object. MachineRecipeHandler.registerItemRecipe(Item input, ItemStack output)

MachineRecipeHandler.registerBlockRecipe(Block input, ItemStack output)

Register Textures

Set the machine texture path: x.blockTextureBase = "example:machine"; This is like a normal texture path, except that something is added on to the end. If your block texture base was example:machine, you would put:

  • Front Texture : assets/example/textures/blocks/machine_1.png
  • Bottom/Top texture Texture : assets/example/textures/blocks/machine_0.png
  • Side Texture : assets/example/textures/blocks/machine_2.png

Finish

To finish off, in your language file, you must localise the machine name, e.g. if it is called 'blockname', then you might put blockname=My Machine Block in assets/modid/lang/en_US.lang, where modid is your mod's id. And in your preInit method: MachineRegistry.registerMachine(x);

If you wish to edit this wiki, please ensure that the grammar is accurate.

Clone this wiki locally