Skip to content

Using the API

Meredith Espinosa edited this page Jul 14, 2019 · 2 revisions

DynaGear adds an API for registering new materials and equipment types. Each is accessible from its own entrypoint.

Equipment Types

All equipment types need to extend the EquipmentType interface. This interface helps define various properties of an equipment type for easier generation. Equipment types are registered when the dynagear:equipment_types entrypoint is run, using EquipmentTypeAdder#addEquipmentTypes. Attempting to register equipment types at any other time will not work.

As items are dynamically generated, you will want to have your Item subclass override getTranslationKey() and getText(). See DynaSwordItem and other DynaGear equipment subclasses for an example on how to do this.

Materials

Materials are defined by the ConfiguredMaterial class, and contain all the information for constructing both tools and armor from the material. Materials are registered when the dynagear:materials entrypoint is run, using MaterialAdder#addMaterials. Attempting to register materials at any other time will not work.

Materials can also be defined through config, through the spec on the main page. Config-defined materials will have higher priority than materials registered through code.

Clone this wiki locally