Skip to content

Repository files navigation

ZenithProxy RedstoneNotifyCommand Plugin

ZenithProxy is a Minecraft proxy and bot.

This plugin adds a notification whenever a redstone lamp is powered on for a certain amount of time. When a powered on redstone lamp is detected the plugin will scan for signs that are placed on the side of the redstone lamp block. If any signs are found, all texts on all found signs will be included in the notification message.

Commands

  • /lampNotify on/off - Enable or disable redstone lamp notifications
  • /lampNotify discord on/off - Toggle Discord notification messages
  • /lampNotify triggerDelay [delay in ticks] - Set the amount of time a lamp has to be powered on before triggering a notification (default: 20 ticks)

Installing Plugins

Plugins are only supported on the java ZenithProxy release channel (i.e. not linux).

Place plugin jars in the plugins folder inside the same folder as the ZenithProxy launcher.

Restart ZenithProxy to load plugins. Loading plugins after launch or hot reloading is not supported.

Creating Plugins

Use this repository as a template to create your own plugin repository.

Plugin Structure

Each plugin needs a main class that implements ZenithProxyPlugin and is annotated with @Plugin.

Plugin metadata like its unique id, version, and supported MC versions is defined in the @Plugin annotation.

See example

Plugin API

The ZenithProxyPlugin interface requires you to implement an onLoad method.

This method provides a PluginAPI object that you can use to register modules, commands, and config files.

Module and Command classes are implemented the same as in the ZenithProxy source code.

I recommend looking at existing modules, commands, and plugins for examples.

JavaDocs

https://maven.2b2t.vc/javadoc/releases/com/zenith/ZenithProxy/1.21.4-SNAPSHOT

Building Plugins

Execute the Gradle build task: ./gradlew build - or double-click the task in Intellij

The built plugin jar will be in the build/libs directory.

Testing Plugins

Execute the run task: ./gradlew run - or double-click the task in Intellij

This will run ZenithProxy with your plugin loaded in the run directory.

New Plugin Checklist

  1. Edit gradle.properties:
    • plugin_name - Name of your plugin, used in the plugin jar name (e.g. ExamplePlugin)
    • maven_group - Java package for your project (e.g. com.github.rfresh2)
  2. Move files to your new corresponding package / maven group:
    • Example: src/main/java/org/example -> src/main/java/com/github/rfresh2
    • First create the new package in src/main/java. Then click and drag original subpackages/classes to your new one
    • Do this with Intellij to avoid manually editing all the source files
    • You must also move folders/package for the src/main/templates folder
    • Also make sure to update the package import at the very top of BuiltConstants.java, it will not be done automatically
  3. Edit ExamplePlugin.java, or remove it and create a new main class
    • Make sure to update the @Plugin annotation

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages