[Question] Can i add class with the api?
Nobodyno-boop opened this issue · 5 comments
I wanna use the MagicApi for create a custom class: CustomClass
Can i do this?
Yes, simply call
Plugin#onLoad
Wiki is down (https://github.com/elBukkit/MagicPlugin/wiki/Actions).
Without the wiki is not very eady to understand, how i make own Action ^^
The wiki is hosted on github... is that really down for you?
Truth be told it’ll be easier to make your own action if you depend on Magic and not the API, so you can inherit from the BaseAction class. If you can do that, just look at any of the actions int the source code, it’s pretty easy. Just implement prepare and process methods.
In the wiki link like :
"All you need to do is to implement the SpellAction interface found in MagicAPI. Alternately, you can extend BaseSpellAction in MagicLib, which takes care of some of the boilerplate code for you." SpellAction link is broken :/
Oh, yeah sadly the doxygen docs got broken. I'll replace with a link to the classes:
If using BaseSpellAction (which I would recommend), you will need to build against the Magic plugin itself, not the API. The plugin is not available in the Central Maven repo, so you will have to add the elMakers repo:
<repositories>
<repository>
<id>elMakers</id>
<url>http://maven.elmakers.com/repository/</url>
</repository>
</repositories>
Then you would add Magic as a dependency like this:
<dependencies>
<dependency>
<groupId>com.elmakers.mine.bukkit.plugins</groupId>
<artifactId>Magic</artifactId>
<version>8.3</version>
<scope>provided</scope>
</dependency>
</dependencies>