Mask 2.1.2

A plugin framework/library to simplify boilerplate tasks.

  1. Moderocky
    Native Minecraft Version:
    1.16
    Tested Minecraft Versions:
    • 1.13
    • 1.14
    • 1.15
    • 1.16
    Source Code:
    https://gitlab.com/Pandaemonium/Mask
    Contributors:
    Mackenzie (Moderocky), blce
    This API is aimed primarily at beginner plugin-makers.

    The primary goal is to try and simplify most of the dull or complex tasks that are required in plugin creation.

    I use this in production, which is pretty much a guarantee that I will keep it updated and maintained.
    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.


    Looking for the JavaDocs?
    Looking for the Repository?
    Looking for the Support Discord?
    Looking for the Mask Wiki?



    Included Features
    • Simplifying basic tasks
    • Simplified one-step yaml converters
    • Built-in configurable web server template system
    • Configurable jSon-based web API system
    • Special callback system for advanced tasks
    • Easy reflection API (good for tricky NMS work)
    • Item factory for faster creation/editing of items
    • GUI menu creation system (BETA)
    • Automatic object property expression generation (BETA)
    • Automatic config-handling annotations
    • Additional debug tools
    • Automatic Skript addon registration (using Plugin template)
    • Exposition of some extra features from Skript

    Upcoming Features

    • Remote socket API
    • Annotations for automatic Skript effect generation (good for exposing your plugin for Skript)
    • Improved debug systems
    • Template data storage system


    Maven
    Repository/dependency:
    Code (Text):

    <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 (Text):

    <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 a simple example.

    Mask contains a simplified config handler that makes use of annotations.
    This can be used to easily serialise/de-serialise your config.

    An example config can be seen here.


    To use, implement the 'Config' interface.

    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):
    @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

    Remember: many more feature examples can be found in the repository.

    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.