Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/25/17 in all areas

  1. I haven't done much with making my own APIs for my mods, but here are some random ideas: - You could make an empty interface that you would require mods using your API to use. In the attach capabilities event, you could check if a mod's TileEntity implements said interface and attach your capability accordingly. - Make a custom annotation that you would require other mods' tile entities to have if they want your capability. In your mod's preinit, you can scan for all classes with said annotation via the ASMDataTable (you can see how Forge does it with @ICapabilityInject in CapabilityManager#injectCapabilities). You could populate a list with all those classes and then use it to apply your capability in the capabilities event. - You could require all mods who want your capability to send you a IMC message with their TileEntity class name, which you would add to a list. Then in the event you can check if the TE is in the list and attach the capability if it is. The first one is definitely the easiest to do (although it might not be the best), the second and third are just ramblings but might be helpful if you want to do anything more complicated in the future. I'm not really an expert, so there might be a much better way to do this.
    1 point
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.