-
Notifications
You must be signed in to change notification settings - Fork 1
Usage
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:
- Register Machine
- Register Recipes
- Add textures
- Finish
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.
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)
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
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);
Need Help? Submit an issue with [Help] in the title.
If you wish to edit this wiki, please ensure that the grammar is accurate.