[FIX] Modify template for release Hytale
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -55,3 +55,7 @@ desktop.ini
|
||||
*.bak
|
||||
*.swp
|
||||
*~
|
||||
|
||||
# Template specific
|
||||
libs/HytaleServer.jar
|
||||
buildSrc/
|
||||
@@ -1,7 +1,6 @@
|
||||
plugins {
|
||||
id("java-library")
|
||||
id("com.gradleup.shadow") version "9.3.1"
|
||||
id("run-hytale")
|
||||
}
|
||||
|
||||
group = findProperty("pluginGroup") as String? ?: "com.example"
|
||||
@@ -15,7 +14,7 @@ repositories {
|
||||
|
||||
dependencies {
|
||||
// Hytale Server API (provided by server at runtime)
|
||||
compileOnly(files("libs/hytale-server.jar"))
|
||||
compileOnly(files("libs/HytaleServer.jar"))
|
||||
|
||||
// Common dependencies (will be bundled in JAR)
|
||||
implementation("com.google.code.gson:gson:2.10.1")
|
||||
@@ -26,13 +25,6 @@ dependencies {
|
||||
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
|
||||
}
|
||||
|
||||
// Configure server testing
|
||||
runHytale {
|
||||
// TODO: Update this URL when Hytale server is available
|
||||
// Using Paper server as placeholder for testing the runServer functionality
|
||||
jarUrl = "https://fill-data.papermc.io/v1/objects/d5f47f6393aa647759f101f02231fa8200e5bccd36081a3ee8b6a5fd96739057/paper-1.21.10-115.jar"
|
||||
}
|
||||
|
||||
tasks {
|
||||
// Configure Java compilation
|
||||
compileJava {
|
||||
|
||||
0
libs/.gitkeep
Normal file
0
libs/.gitkeep
Normal file
@@ -1,54 +1,88 @@
|
||||
package com.example.templateplugin;
|
||||
|
||||
import com.hypixel.hytale.server.core.plugin.JavaPlugin;
|
||||
import com.hypixel.hytale.server.core.plugin.JavaPluginInit;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.logging.Level;
|
||||
|
||||
/**
|
||||
* Main plugin class.
|
||||
*
|
||||
*
|
||||
* TODO: Implement your plugin logic here.
|
||||
*
|
||||
*
|
||||
* @author YourName
|
||||
* @version 1.0.0
|
||||
*/
|
||||
public class TemplatePlugin {
|
||||
public class TemplatePlugin extends JavaPlugin {
|
||||
|
||||
private static TemplatePlugin instance;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor - Called when plugin is loaded.
|
||||
*/
|
||||
public TemplatePlugin() {
|
||||
public TemplatePlugin(@Nonnull JavaPluginInit init) {
|
||||
super(init);
|
||||
instance = this;
|
||||
System.out.println("[TemplatePlugin] Plugin loaded!");
|
||||
getLogger().at(Level.INFO).log("[TemplatePlugin] Plugin loaded!");
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when plugin is enabled.
|
||||
*/
|
||||
public void onEnable() {
|
||||
System.out.println("[TemplatePlugin] Plugin enabled!");
|
||||
|
||||
// TODO: Initialize your plugin here
|
||||
// - Load configuration
|
||||
// - Register event listeners
|
||||
// - Register commands
|
||||
// - Start services
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when plugin is disabled.
|
||||
*/
|
||||
public void onDisable() {
|
||||
System.out.println("[TemplatePlugin] Plugin disabled!");
|
||||
|
||||
// TODO: Cleanup your plugin here
|
||||
// - Save data
|
||||
// - Stop services
|
||||
// - Close connections
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get plugin instance.
|
||||
*/
|
||||
public static TemplatePlugin getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when plugin is set up.
|
||||
*/
|
||||
@Override
|
||||
protected void setup() {
|
||||
getLogger().at(Level.INFO).log("[TemplatePlugin] Plugin setup!");
|
||||
|
||||
// TODO: Initialize your plugin here
|
||||
// - Load configuration
|
||||
// - Register event listeners
|
||||
// - Register commands
|
||||
// - Start services
|
||||
registerEvents();
|
||||
registerCommands();
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when plugin is enabled.
|
||||
*/
|
||||
@Override
|
||||
protected void start() {
|
||||
getLogger().at(Level.INFO).log("[TemplatePlugin] Plugin enabled!");
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when plugin is disabled.
|
||||
*/
|
||||
@Override
|
||||
public void shutdown() {
|
||||
getLogger().at(Level.INFO).log("[TemplatePlugin] Plugin disabled!");
|
||||
|
||||
// TODO: Cleanup your plugin here
|
||||
// - Save data
|
||||
// - Stop services
|
||||
// - Close connections
|
||||
}
|
||||
|
||||
/**
|
||||
* Register your commands here.
|
||||
*/
|
||||
private void registerEvents() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Register your commands here.
|
||||
*/
|
||||
private void registerCommands() {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user