Interface HeirloomAddon
public interface HeirloomAddon
Interface that all Heirloom addons must implement.
Example implementation:
public class DistilleryAddon implements HeirloomAddon {
@Override
public String getAddonId() { return "distillery"; }
@Override
public String getVersion() { return "1.0.0"; }
@Override
public void onEnable(HeirloomAPI api) {
// Register items, crops, etc.
api.items().register(ItemRegistration.builder()
.id("RED_WINE")
.name("&cRed Wine")
.texture("http://...")
.edible(true));
}
}
-
Method Summary
Modifier and TypeMethodDescriptionGet the unique identifier for this addon.Get the addon version string.default voidCalled when the addon is disabled.voidonEnable(HeirloomAPI api) Called when the addon is enabled and registered with Heirloom.default voidonReload()Called when Heirloom reloads its configurations.
-
Method Details
-
getAddonId
String getAddonId()Get the unique identifier for this addon. Should be lowercase with underscores (e.g., "distillery", "animal_husbandry"). -
getVersion
String getVersion()Get the addon version string. -
onEnable
Called when the addon is enabled and registered with Heirloom. Use this to register items, crops, properties, etc.- Parameters:
api- The HeirloomAPI instance
-
onDisable
default void onDisable()Called when the addon is disabled. Use this to clean up any resources. -
onReload
default void onReload()Called when Heirloom reloads its configurations. Addons can use this to reload their own configs if needed.
-