Line 25: |
Line 25: |
| | | |
| {{Tip/Important|An ingredient should be wrapped in a supplier to avoid calling the object directly. Tiers are loaded before registries are populated, so the call to the item needs to be deferred.}} | | {{Tip/Important|An ingredient should be wrapped in a supplier to avoid calling the object directly. Tiers are loaded before registries are populated, so the call to the item needs to be deferred.}} |
− |
| |
| | | |
| == <tt>ToolItem</tt> == | | == <tt>ToolItem</tt> == |
Line 33: |
Line 32: |
| Each tool has four parameters: tier, attack damage, attack speed, and properties. Tiers and properties have already been explained in this and within the [[Making Items|item]] docs. Attack damage specifies how much damage to do above the current base set for that specific tier. Attack speed specifies the speed modifier to apply to your current attack speed (defaults to <code>4.0D</code>). | | Each tool has four parameters: tier, attack damage, attack speed, and properties. Tiers and properties have already been explained in this and within the [[Making Items|item]] docs. Attack damage specifies how much damage to do above the current base set for that specific tier. Attack speed specifies the speed modifier to apply to your current attack speed (defaults to <code>4.0D</code>). |
| | | |
− | {{Colored box|title=Tip|content=If you decide to extend <code>ToolItem</code>, there will be a fifth parameter which defines which blocks this tool is effective on. This parameter can just be an empty set as that is now specified on each block itself.}} | + | {{Tip|content=If you decide to extend <code>ToolItem</code>, there will be a fifth parameter which defines which blocks this tool is effective on. This parameter can just be an empty set as that is now specified on each block itself.}} |
− | | |
| | | |
| == Registering == | | == Registering == |
Line 40: |
Line 38: |
| A tool must be [[Registration|registered]] the same as an item. If using one of the subtypes of <code>ToolItem</code>, that is all that is required. If not, you will need to chain <code>addToolType</code> onto your properties. This will take in a <code>ToolType</code> and a harvest level. The type is held within <code>ToolType</code> itself. The harvest level will be the value from your tier using <code>IItemTier#getHarvestLevel</code>. | | A tool must be [[Registration|registered]] the same as an item. If using one of the subtypes of <code>ToolItem</code>, that is all that is required. If not, you will need to chain <code>addToolType</code> onto your properties. This will take in a <code>ToolType</code> and a harvest level. The type is held within <code>ToolType</code> itself. The harvest level will be the value from your tier using <code>IItemTier#getHarvestLevel</code>. |
| | | |
− | {{Colored box|title=Tip|content=If you would like to use a custom tool type, you can call <code>ToolType::get</code>. All strings passed in should have their modid appended to them to remove any conflict issues (e.g. <code>examplemod::custom_tool_type</code>). If a standard implementation across mods is used for compatibility, no namespace is needed.}} | + | {{Tip|content=If you would like to use a custom tool type, you can call <code>ToolType::get</code>. All strings passed in should have their modid appended to them to remove any conflict issues (e.g. <code>examplemod::custom_tool_type</code>). If a standard implementation across mods is used for compatibility, no namespace is needed.}} |