BTW Extended Addon API v1.1.4

This sub-forum is dedicated to add-ons and texture packs for Better Than Wolves.
Post Reply
User avatar
dawnraider
Posts: 1876
Joined: Sun Dec 11, 2011 7:00 pm

BTW Extended Addon API v1.1.4

Post by dawnraider »

This is an API designed to increase compatibility between BTW addons and to help make the process a little easier.

Any addon author is free to use it or make hook requests (or to submit code through a pull request)

Download here
Source code here

This API makes changes to your worlds which means it is unsafe to uninstall!
Due to how villagers had to be handled, they are broken into multiple classes now which means MC will not know how to load them if you load a world without the API.

Further documentation is present in the code itself
Hooks:
General
  • Version checking and display on login
  • Client packet intercepting (e.g. for replacing behavior)
  • Custom particle spawning
Block
  • Replace references to a block with another block class, with checks for addon conflict.
  • Set map color for blocks per metadata.
EntityList
  • Replace an entity with another entity class in a safe manner, avoiding potential crashes which can arise from FC's hooks which do not expect references to old classes to still exist in the code. (Unfortunately this is currently bugged to not work on mob spawning, but will work on all other entities, including mobs loaded from the save file).
  • Changed entity mapping with spawn egg to public.
FCEntityVillager
  • Changed to an abstract class. Extend the class to add professions.
Item
  • Replace references to an item with another item class, with checks for addon conflict.
  • Set custom entity to use for the item in world.
ServerCommandManager
  • Register new commands, including client or server only.
Templates:
AddonBlockDirectional
  • Template for orientable block (e.g. logs).
  • Handles all metadata rotation and texture rendering.
  • Can have up to 4 sub-types.
License
This API is provided under the Creative Commons 4.0 Attribution license, which you can view here. You may do anything you please with this API as long as you give credit.
Last edited by dawnraider on Sun May 16, 2021 5:52 pm, edited 9 times in total.
Come join us on discord! https://discord.gg/fhMK5kx
Get the Deco Addon here!
Get the Better Terrain Addon here!
Get the Vanilla Mix TP here!
Get the Conquest TP here!
User avatar
jorgebonafe
Posts: 2714
Joined: Mon Sep 19, 2011 3:22 am
Location: Brasil

Re: BTW Extended Addon API v1.0

Post by jorgebonafe »

Will this version have conflicts with the changes I copied to my addon in order to register commands? Do I have to change anything?
Better Than Wolves was borne of anal sex. True Story.
User avatar
dawnraider
Posts: 1876
Joined: Sun Dec 11, 2011 7:00 pm

Re: BTW Extended Addon API v1.0

Post by dawnraider »

Yeah this will conflict. You can remove any of the base class mods you made and replace it with a call like this:

Code: Select all

ServerCommandManager.registerAddonCommand(new BTACommandBiome());
There are similar calls to register a command only with the client or server.
Come join us on discord! https://discord.gg/fhMK5kx
Get the Deco Addon here!
Get the Better Terrain Addon here!
Get the Vanilla Mix TP here!
Get the Conquest TP here!
User avatar
jorgebonafe
Posts: 2714
Joined: Mon Sep 19, 2011 3:22 am
Location: Brasil

Re: BTW Extended Addon API v1.0

Post by jorgebonafe »

Cool. I'll update when I can, thanks
Better Than Wolves was borne of anal sex. True Story.
User avatar
dawnraider
Posts: 1876
Joined: Sun Dec 11, 2011 7:00 pm

Re: BTW Extended Addon API v1.0

Post by dawnraider »

Added missing license

License
This API is provided under the Creative Commons 4.0 Attribution license, which you can view here. You may do anything you please with this API as long as you give credit.
Come join us on discord! https://discord.gg/fhMK5kx
Get the Deco Addon here!
Get the Better Terrain Addon here!
Get the Vanilla Mix TP here!
Get the Conquest TP here!
User avatar
dawnraider
Posts: 1876
Joined: Sun Dec 11, 2011 7:00 pm

Re: BTW Extended Addon API v1.1.0

Post by dawnraider »

Version 1.1.0 has been released!
Download here
Note that this release is incompatible with BTA 1.3.3 and Deco 2.13.3. Minor releases for those addons will be coming soon to update to this version of the API.

Edit: BTA 1.3.4 and Deco 2.13.4 have been released with compatibility for this API version.

The villager changes in this version required me to split villager professions into their own entities. Backwards compatibility has been added for villagers in the old format, though it is still a good idea to back up your worlds.
However, support cannot be added for going the other way. Worlds which update to this version of the API cannot be downgraded safely. If you do load a world that you have loaded with this version later with a version of the API before 1.1.0, or without the API, your villagers will disappear.
Unfortunately this was the only way to be able to break professions into their own classes because of how MC handles entities internally.
Back up your worlds just in case!

Version 1.1.0 changes:
  • Removed spaces from filename to assist users on linux.
  • Added some hooks for my upcoming automation addon.
  • Added hooks to spawn custom item entities per item.
  • Added hooks to allow more specific customization of map colors, including per metadata.
  • Refactored how villagers work to allow for addons to add new professions. Further work here will be done to allow for modifying existing professions without modifying base classes.
  • Changed item replacement slightly to fix conflict warnings.
  • Changed item and block replacement to have more detailed error messages.
    Come join us on discord! https://discord.gg/fhMK5kx
    Get the Deco Addon here!
    Get the Better Terrain Addon here!
    Get the Vanilla Mix TP here!
    Get the Conquest TP here!
    User avatar
    dawnraider
    Posts: 1876
    Joined: Sun Dec 11, 2011 7:00 pm

    Re: BTW Extended Addon API v1.1.0

    Post by dawnraider »

    I forgot to mention in the changelog that I added an AddonBlockDirectional template class which can be used to create directional blocks like logs.
    Come join us on discord! https://discord.gg/fhMK5kx
    Get the Deco Addon here!
    Get the Better Terrain Addon here!
    Get the Vanilla Mix TP here!
    Get the Conquest TP here!
    User avatar
    dawnraider
    Posts: 1876
    Joined: Sun Dec 11, 2011 7:00 pm

    Re: BTW Extended Addon API v1.1.1

    Post by dawnraider »

    Version 1.1.1 has been released!
    Download here

    Version 1.1.1 changes:
    • Fixed an issue where opening a world from before API 1.1.0 would delete villagers.
    • Fixed an issue where curing or attacking villagers would cause the game to crash.
    • Fixed an issue where villager spawn eggs did not have names.
    • Fixed an issue where maps would cause severe performance issues.
    • Fixed an issue where spawning an item entity would log errors to the console. These errors never caused real issues and were simply a result of running code on both the client and server when it should've only been run on the server.
    Come join us on discord! https://discord.gg/fhMK5kx
    Get the Deco Addon here!
    Get the Better Terrain Addon here!
    Get the Vanilla Mix TP here!
    Get the Conquest TP here!
    User avatar
    dawnraider
    Posts: 1876
    Joined: Sun Dec 11, 2011 7:00 pm

    Re: BTW Extended Addon API v1.1.1

    Post by dawnraider »

    Download updated to fix out of date version string in server version. Client version unaffected.
    Come join us on discord! https://discord.gg/fhMK5kx
    Get the Deco Addon here!
    Get the Better Terrain Addon here!
    Get the Vanilla Mix TP here!
    Get the Conquest TP here!
    User avatar
    dawnraider
    Posts: 1876
    Joined: Sun Dec 11, 2011 7:00 pm

    Re: BTW Extended Addon API v1.1.2

    Post by dawnraider »

    version 1.1.2 has been released!
    Download here

    Version 1.1.2 changes:
    • Fixed an issue where the client would crash when an entity spawned on a server with an id above 255. Notably, this fixes an issue in multiplayer where clients would be kicked and unable to rejoin when curing villagers.
    Come join us on discord! https://discord.gg/fhMK5kx
    Get the Deco Addon here!
    Get the Better Terrain Addon here!
    Get the Vanilla Mix TP here!
    Get the Conquest TP here!
    User avatar
    dawnraider
    Posts: 1876
    Joined: Sun Dec 11, 2011 7:00 pm

    Re: BTW Extended Addon API v1.1.3

    Post by dawnraider »

    Version 1.1.3 has been released!
    Download here

    Version 1.1.3 changes:
    • Fixed a BTW issue which could cause a crash when trying to remove crucible or cauldron recipes with different numbers of input ingredients vs output ingredients.
    Come join us on discord! https://discord.gg/fhMK5kx
    Get the Deco Addon here!
    Get the Better Terrain Addon here!
    Get the Vanilla Mix TP here!
    Get the Conquest TP here!
    User avatar
    dawnraider
    Posts: 1876
    Joined: Sun Dec 11, 2011 7:00 pm

    Re: BTW Extended Addon API v1.1.4

    Post by dawnraider »

    Version 1.1.4 has been released!
    Download here

    Version 1.1.4 changes:
    • Fixed an issue where curing zombie villagers always produced peasants.
    Come join us on discord! https://discord.gg/fhMK5kx
    Get the Deco Addon here!
    Get the Better Terrain Addon here!
    Get the Vanilla Mix TP here!
    Get the Conquest TP here!
    Post Reply