-
Notifications
You must be signed in to change notification settings - Fork 3
Integrating other plugins with CreeperHeal2
This is a small guide to setting up and adding CreeperHeal2 to your build dependencies. The guide uses Maven as I unfortunately do not have much experience with Gradle.
Since CreeperHeal2's package is hosted on GitHub packages, there is a bit of setup required to build against it. CreeperHeal2's project is also an example of these setup steps if you need help.
In your project:
- Add a
.mvn
folder with a file calledmaven.config
that contains the following
-ssettings.xml
- Add a file called
settings.xml
that contains the following
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>creeperheal2</id>
<username>jcansdale-robot</username>
<!-- Public token with `read:packages` scope -->
<password>29d72a1b56270e6ace5317ff1b4442a6c3ced9ed</password>
</server>
</servers>
</settings>
- Add to your
pom.xml
<repositories>
...
<repository>
<id>creeperheal2</id>
<name>CreeperHeal2</name>
<url>https://maven.pkg.github.com/pmdevita/CreeperHeal2url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
...
</repositories>
...
<dependencies>
...
<dependency>
<groupId>net.countercraft</groupId>
<artifactId>movecraft</artifactId>
<version>8.0.0_beta-5</version>
<scope>provided</scope>
</dependency>
...
</dependencies>
This has to be done because GitHub packages requires a login to access even public packages. Kind of annoying but it works once its set up.
First off, there is automated docs for CreeperHeal2's API, both in Javadocs or Dokka depending on if you are using Java or Kotlin respectively.
The API pages are still a mess so this is a brief walkthrough of useful utilities within it.
Before you do anything, you'll need a reference to the main CreeperHeal2 plugin object
Bukkit.getPluginManager().getPlugin("CreeperHeal2");
An event fired when CreeperHeal2 is about to save an explosion's blocks. Useful for masking out blocks, making sure CreeperHeal ignores them.
It's generally best to mask out blocks you don't want CreeperHeal2 and other plugins to touch by listening to explosion events with a priority of NORMAL, LOW, or LOWEST, but if you're specifically trying to stop CreeperHeal2 from touching certain blocks, this event is for you.
The explosion manager can be obtained by calling CreeperHeal2.getManager()