Migrate to new Hytale plugin template structure
Replaces the previous Kotlin-based Gradle build and template files with a new Java-based Gradle build system and updated example plugin code. Removes old build scripts, plugin template, and configuration, and introduces a new ExamplePlugin with updated manifest, command, and recipe example. Updates documentation and project configuration to match the new structure and usage.
This commit is contained in:
27
src/main/java/org/example/plugin/ExamplePlugin.java
Normal file
27
src/main/java/org/example/plugin/ExamplePlugin.java
Normal file
@@ -0,0 +1,27 @@
|
||||
package org.example.plugin;
|
||||
|
||||
import com.hypixel.hytale.logger.HytaleLogger;
|
||||
import com.hypixel.hytale.server.core.plugin.JavaPlugin;
|
||||
import com.hypixel.hytale.server.core.plugin.JavaPluginInit;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
/**
|
||||
* This class serves as the entrypoint for your plugin. Use the setup method to register into game registries or add
|
||||
* event listeners.
|
||||
*/
|
||||
public class ExamplePlugin extends JavaPlugin {
|
||||
|
||||
private static final HytaleLogger LOGGER = HytaleLogger.forEnclosingClass();
|
||||
|
||||
public ExamplePlugin(@Nonnull JavaPluginInit init) {
|
||||
super(init);
|
||||
LOGGER.atInfo().log("Hello from " + this.getName() + " version " + this.getManifest().getVersion().toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setup() {
|
||||
LOGGER.atInfo().log("Setting up plugin " + this.getName());
|
||||
this.getCommandRegistry().registerCommand(new ExampleCommand(this.getName(), this.getManifest().getVersion().toString()));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user