-
Notifications
You must be signed in to change notification settings - Fork 1
Using the API
Using the API is quite simple. It let's you make modules and tracks for use in the modular conveyors. You simply need to make an item which implements IModifier. The API will be updated to be the same between the 1.10, 1.11, and 1.12 versions of the mod. This will make it easier to add modifiers in different Minecraft versions.
Once you do this you have a few methods you must use. The update
method is used for causing stuff to happen whilst an entity is on the conveyor. Here's an example:
The getDescription
method is used for setting the tooltip of the modifier. Here's an example:
The getType
method is used for telling what type of modifier your item is. It can either be a MODULE
or a TRACK
.
Here's an example:
isConductive
is primarily used for telling the client if your modifier changes based on redstone, in which case you can have the texture change based on redstone input. This will also add a tooltip to the modifier showing it's affected by redstone. Here's an example:
getModID
is used for setting the location you wish for your modifiers texture to be found. This texture will be displayed on top of the modular conveyor if your modifier is in it's inventory. If you used the id example
and the unlocalized name of your modifier was modifier_example
, it would search for its texture in example:textures/blocks/modules/modifier_example.png
and tracks in example:textures/blocks/tracks/modifier_example.png
. Here's an example:
If isConductive
returns true, then when looking for the modifiers texture it will add _powered
and _unpowered
at the end, depending on if the conveyor the modifier is in is powered or not.
If you need to have the modifier passively update, you can also implement IUpdatePassive
. This works exactly the same as update
, except it does not give an entity instance and is called on every tick rather than only when an entity is on the conveyor.
IWrenchable
can be implemented on blocks in order to have onWrenched
be called when a Conveyor Wrench right-clicks the block. You can set what happens in onWrenched, but by default if the block is a BlockHorizontal, it will rotate it. Here's an example:
This guide is currently very unpolished, and I will come back to change and review it later.