1. Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

API Mask 1.0.5

A plugin framework primarily aimed at Skript addons to simplify boilerplate tasks.

  1. Moderocky
    Contributors:
    Moderocky
    Supported Minecraft Versions:
    • 1.12, 1.13, 1.14, 1.15
    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. :emoji_slight_smile:

    Included Features
    • Automatic Skript addon registration
    • Automatic config-handling annotations
    • Built-in class debugging tools
    • Simplification of certain tasks (meta and keys)
    • 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
    Upcoming Features
    • 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:
    Code (Text):
    1.  
    2. <repository>
    3.     <id>gitlab-maven</id>
    4.     <url>https://gitlab.com/api/v4/projects/16515908/packages/maven</url>
    5. </repository>
    6.  
    7.  
    8. <dependency>
    9.    <groupId>com.moderocky</groupId>
    10.    <artifactId>Mask</artifactId>
    11.    <version>1.0.4</version>
    12. </dependency>
    13.  
    Package re-mapping (prevents conflicts if there are two plugins using this dependency).
    Code (Text):
    1.  
    2. <plugin>
    3.     <groupId>org.apache.maven.plugins</groupId>
    4.     <artifactId>maven-shade-plugin</artifactId>
    5.     <version>3.1.1</version>
    6.     <executions>
    7.        <execution>
    8.           <phase>package</phase>
    9.           <goals>
    10.              <goal>shade</goal>
    11.           </goals>
    12.           <configuration>
    13.              <artifactSet>
    14.                 <includes>
    15.                    <include>com.moderocky:Mask</include>
    16.                 </includes>
    17.              </artifactSet>
    18.              <relocations>
    19.                 <relocation>
    20.                    <pattern>com.moderocky.mask</pattern>
    21.                    <shadedPattern>your.package.here.mask</shadedPattern>
    22.                 </relocation>
    23.              </relocations>
    24.  
    25.              <createDependencyReducedPom>false</createDependencyReducedPom>
    26.           </configuration>
    27.        </execution>
    28.     </executions>
    29.  </plugin>
    30.  
    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 and even add comments to it (something snake-yaml doesn't handle by itself.)

    To use, implement the 'Config' interface.

    An example config can be seen here:
    https://gitlab.com/Moderocky/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 (Text):
    1. @Configurable // marks this field to be mapped
    2. @Bounded // sets bounds for a number field
    3. @Keyed // allows a custom yaml key to be used
    4. @Regex // passes string input through a matcher
    5. @Comment // allows a comment to be left
    6. @Serialise // currently does nothing, will soon allow a custom (de)serialising method to be used
    7. @Header // attaches to the class, specify yaml header comments

    Other basic examples can be found here: https://gitlab.com/Moderocky/Mask/-/tree/master/src/examples
    I will try to remember to add more as I add more features.

Recent Updates

  1. Config Overwriter
  2. Converters

Recent Reviews

  1. novastosha
    novastosha
    5/5,
    Version: 1.0.5
    Woaw, Perfect timing, The time that i was making an addon you made this now i'm using this