The mod developer has officially decided that the mod was going to 1.15.2! If you still want to read the document detailing what could happen in regards to updating the mod to Minecraft 1.15, you can find it here. You can also voice your opinion on Discord.

Third-Party Mod Integration/Making an Addon

From Advent of Ascension Wiki
Jump to: navigation, search

Advent of Ascension offers open accessibility for developers wanting to add integration to AoA, or create add-ons.

Information[edit | edit source]

While Advent of Ascension isn't open-source, it does support third-party add-ons and allows developers to browse most of the source code to assist with doing so. This page will detail the requirements for either integrating with AoA, or making an add-on.

DISCLAIMER[edit | edit source]

This page is not a tutorial on mod development, and it is expected you know how to set up your forge development environment to create mods prior to using the below information.

Maven Repository[edit | edit source]

To effectively create an add-on or integrate with AoA, you will need to add it to your development environment. To do this, you will need to edit the repositories section of your build.gradle file to add AoA's repository.

If you do not already have a repositories section of your build.gradle, you'll need to create one.

Build.gradle layout.

From there, add the below lines into the repositories section:

    maven {
        url "https://dl.bintray.com/tslat/aoa3"
    }

Once this is done, create a libs folder in your project directory, and drop in the AoA jar file from Curseforge (the one you use to play AoA). Then, in the dependencies section, add in the following line:

    compileOnly ("net.tslat.aoa3:aoa3:<version>") {transitive = false} // This allows you to browse/integrate AoA code
    runtime files("./libs/<jarname>") // This adds the mod to your runtime when debugging/testing

Replacing:

  • <version> with the version of AoA you're developing for - E.G. net.tslat.aoa3:aoa3:3.3
  • <jarname> with the name of the jarfile in your libs folder - E.G. AoA3-3.3.jar

Once the build.gradle has been edited, re-run the setupDecompWorkspace task in gradle, then refresh your gradle project via the gradle panel.

Key Classes[edit | edit source]

Below are some key classes that developers may be interested in or find useful.

  • PlayerUtil - A utility class that contains various useful methods for interacting with AoA's player data, such as skills and resources.
  • EntityUtil - A utility class that contains various useful methods for interacting with AoA's entities. Contains helper methods for type-immunities, type-damage dealing, and more.
  • PlayerDataManager - The container that holds all the relevant information and methods for AoA's player data. You can get a player's container via PlayerUtil#getAdventPlayer(). Containers only exist on the server, not the client.
  • ConfigurationUtil - Contains all of the configuration options for AoA.
  • AoAMeleeMob, AoARangedMob, AoAFlyingMeleeMob, AoAFlyingRangedMob, AoAAnimal - The base classes for nearly all of AoA's creatures.
  • AoAAmbientNPC, AoATrader - The base classes for AoA's NPC entities.
  • Enums - The holder class for almost all of AoA's enum types. These enums are used in various methods throughout the mod.
  • ArmourRegister - Contains references to all of AoA's armour items after item registration.
  • BlockRegister - Contains references to all of AoA's blocks after block registration.
  • ItemRegister - Contains references to all of AoA's items after item registration.
  • CreativeTabsRegister - Contains references to all of AoA's creative tabs, for placing items in the creative menu.
  • EnchantmentsRegister - Contains references to all of AoA's enchantments.
  • MaterialsRegister - Contains references to all of AoA's tool, sword, and armour materials after item registration.
  • SoundsRegister - Contains references to all of AoA's sounds after sound registration.
  • ToolRegister - Contains references to all of AoA's tools after item registration.
  • WeaponRegister - Contains references to all of AoA's weapons after item registration.
  • SpecialHarvestTool - An interface that passes HarvestDropsEvents to any class that implements it, for custom interactions.
  • BaseArchergun - The base class for all AoA Archerguns. Contains all of the reference methods used for item stats and effects.
  • BaseBlaster - The base class for all AoA Blasters. Contains all of the reference methods used for item stats and effects.
  • BaseBow - The base class for all AoA Bows. Contains all of the reference methods used for item stats and effects.
  • BaseCannon - The base class for all AoA Cannons. Contains all of the reference methods used for item stats and effects.
  • BaseGreatblade - The base class for all AoA Greatblades. Contains all of the reference methods used for item stats and effects.
  • BaseGun - The base class for all AoA Guns. Contains all of the reference methods used for item stats and effects.
  • BaseMaul - The base class for all AoA Mauls. Contains all of the reference methods used for item stats and effects.
  • BaseShotgun - The base class for all AoA Shotguns. Contains all of the reference methods used for item stats and effects.
  • BaseSniper - The base class for all AoA Snipers. Contains all of the reference methods used for item stats and effects.
  • BaseStaff - The base class for all AoA Staves. Contains all of the reference methods used for item stats and effects.
  • BaseSword - The base class for all AoA Swords. Contains all of the reference methods used for item stats and effects.
  • BaseThrownWeapon - The base class for all AoA Thrown Weapons. Contains all of the reference methods used for item stats and effects.
  • BaseVulcane - The base class for all AoA Vulcanes. Contains all of the reference methods used for item stats and effects.

Inter-Mod Comms (IMC)[edit | edit source]

Advent of Ascension offers several IMC functions for quick optional integration. See below for the available functions and their uses.

Adding Custom Guides[edit | edit source]

IMC Key: mod_provides_guides

Message Type: Any

Usage:

Takes the Mod ID of the sending mod and registers it as a guides provider. Guides txt files should be placed in the assets/<modid>/lang/aoa3/guides/ directory of your mod.

Handling Bestiary Entries[edit | edit source]

IMC Key: mod_handles_bestiaries

Message Type: Function

Usage:

Takes a Function<EntityLivingBase, Tuple<List<String>, String>> argument from the message and uses that when opening a bestiary entry for any entity from your Mod ID.

The expected format for the Tuple is that the first is a list of stat lines in String format, and the second is an optional bestiary lore/description entry.

Handling Bestiary Info[edit | edit source]

IMC Key: mod_has_bestiary_entries

Message Type: Any

Usage:

Takes the Mod ID of the sending mod and registers it as a bestiary info provider. Bestiary txt files should be placed in the assets/<modid>/lang/aoa3/bestiary/ directory of your mod.

Adding Custom Advent Gui Themes[edit | edit source]

IMC Key: add_advent_gui_theme

Message Type: Function

Usage:

Takes a Function<String, String> argument from the message and grabs several optional data pieces from it to register a new Advent Gui theme.

Function arguments:

  • "name" - Return the formatted name of your theme, to be displayed on the button selector for themes.
  • "background" - (Optional) The filepath to your theme background texture. E.G. "textures/gui/maingui/themes/default/background.png"
  • "buttons" - (Optional) The filepath to your theme buttons texture. E.G. "textures/gui/maingui/themes/default/buttons.png"
  • "overlay" - (Optional) The filepath to your theme overlay texture. E.G. "textures/gui/maingui/themes/default/overlay.png"

Registering a Hunter Entity[edit | edit source]

IMC Key: register_hunter_entity

Message Type: String

Usage:

Takes a String argument from the message and parses it to register an entity as a hunter entity.

The expected format of the string is: "<EntityID> lvl:<HunterLevel> xp:<XP>" - E.G. "aoa3:cyclops lvl:10 xp:50.5"

Block Heartstone Drops From Entity[edit | edit source]

IMC Key: blacklist_heartstone_entity

Message Type: String

Usage:

Takes a String argument from the message and parses it to blacklist an entity ID from spawning Heartstones.

The expected format of the string is "<EntityID>" - E.G. "aoa3:cyclops"

Block Bloodlust Spawns From Entity[edit | edit source]

IMC Key: blacklist_bloodlust_entity

Message Type: String

Usage:

Takes a String argument from the message and parses it to blacklist an entity ID from spawning Bloodlusts.

The expected format of the string is "<EntityID>" - E.G. "aoa3:cyclops"