- Contributors
- Mackenzie (Moderocky), blce
- Supported Minecraft Versions
- 1.12
- 1.13
- 1.14
- 1.15
- 1.16
This API is aimed primarily at plugin-makers or beginner addon developers.
The primary goal is to try and simplify most of the dull or complex tasks that are required in addon/plugin creation.
I use it in production, which is pretty much a guarantee that I will keep it updated.
Almost no features rely on Minecraft version-specific methods so it ought to work on almost any version.
Note: You probably want to get this via the repository, the jar itself won't be much help.
Mask Wiki?
Included Features
Other basic examples can be found here: https://gitlab.com/Pandaemonium/Mask/-/tree/master/src/examples
I will try to remember to add more as I add more features.
The primary goal is to try and simplify most of the dull or complex tasks that are required in addon/plugin creation.
I use it in production, which is pretty much a guarantee that I will keep it updated.
Almost no features rely on Minecraft version-specific methods so it ought to work on almost any version.
Note: You probably want to get this via the repository, the jar itself won't be much help.
Mask Wiki?
Included Features
- Automatic Skript addon registration (optional)
- Automatic config-handling annotations
- Built-in class debugging tools
- Simplification of certain tasks (meta and keys)
- Templates for common things
- Caches and special maps for dealing with positional objects
- N-Dimensional maps (for dealing with objects by property)
- Special callback system for advanced tasks (async in progress)
- Simplified reflection methods (good for tricky NMS work)
- Automatic object property expression generation (BETA)
- Exposition of some useful features from Skript
- Full Skript syntax API (handlers and automatic registration)
- Syntax configuration system (easily enable/disable/change syntax on the fly)
- Annotations for automatic Skript effect generation (for exposing your plugin for Skript)
- Improved debugging system
- Additional storage API (for avoiding variables)
- Converters to and from irritating Skript types
Maven
Repository/dependency:
Package re-mapping (prevents conflicts if there are two plugins using this dependency).
Gradle
I don't know how Gradle handles package mapping.
I'm sure you can work this out for yourselves.
Repository/dependency:
Code:
<repository>
<id>mask-repo</id>
<url>https://gitlab.com/api/v4/projects/18568066/packages/maven</url>
</repository>
<dependency>
<groupId>com.moderocky</groupId>
<artifactId>Mask</artifactId>
<version>2.1.2</version>
</dependency>
Package re-mapping (prevents conflicts if there are two plugins using this dependency).
Code:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.1.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
<includes>
<include>com.moderocky:Mask</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>com.moderocky.mask</pattern>
<shadedPattern>your.package.here.mask</shadedPattern>
</relocation>
</relocations>
<createDependencyReducedPom>false</createDependencyReducedPom>
</configuration>
</execution>
</executions>
</plugin>
Gradle
I don't know how Gradle handles package mapping.
I'm sure you can work this out for yourselves.
This seems to be the most popular feature, so I've tried to provide some documentation.
Mask contains a simplified config handler that makes use of annotations.
This can be used to easily serialise/de-serialise your config.
To use, implement the 'Config' interface.
An example config can be seen here:
https://gitlab.com/Pandaemonium/Mask/-/blob/master/src/examples/java/com/moderocky/example/config/ExampleConfig.java
Remember: by default, your field-names are converted from camelCase to snake_case to provide the yaml key.
If you want to change this, you can use the @Keyed annotation to specify something else.
Available annotations:
Mask contains a simplified config handler that makes use of annotations.
This can be used to easily serialise/de-serialise your config.
To use, implement the 'Config' interface.
An example config can be seen here:
https://gitlab.com/Pandaemonium/Mask/-/blob/master/src/examples/java/com/moderocky/example/config/ExampleConfig.java
Remember: by default, your field-names are converted from camelCase to snake_case to provide the yaml key.
If you want to change this, you can use the @Keyed annotation to specify something else.
Available annotations:
Code:
@Configurable // marks this field to be mapped
@Bounded // sets bounds for a number field
@Keyed // allows a custom yaml key to be used
@Regex // passes string input through a matcher
@Comment // allows a comment to be left
@Serialise // currently does nothing, will soon allow a custom (de)serialising method to be used
@Header // attaches to the class, specify yaml header comments
Other basic examples can be found here: https://gitlab.com/Pandaemonium/Mask/-/tree/master/src/examples
I will try to remember to add more as I add more features.