mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-24 17:11:58 +01:00
Move extension demo to demo project (can be loaded with indev classes currently)
This commit is contained in:
parent
b5cc2c4126
commit
070a45cb97
@ -0,0 +1,21 @@
|
||||
package net.minestom.demo.extension;
|
||||
|
||||
import net.minestom.server.extensions.Extension;
|
||||
|
||||
public class TestExtension extends Extension {
|
||||
@Override
|
||||
public void initialize() {
|
||||
System.out.println("Initialize test extension");
|
||||
|
||||
try {
|
||||
Class.forName("com.mysql.cj.jdbc.Driver", true, getOrigin().getClassLoader());
|
||||
} catch (ClassNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void terminate() {
|
||||
System.out.println("Terminate test extension");
|
||||
}
|
||||
}
|
13
demo/src/main/resources/extension.json
Normal file
13
demo/src/main/resources/extension.json
Normal file
@ -0,0 +1,13 @@
|
||||
{
|
||||
"entrypoint": "net.minestom.demo.extension.TestExtension",
|
||||
"name": "TestExtension",
|
||||
"version": "1.0.0",
|
||||
"externalDependencies": {
|
||||
"repositories": [
|
||||
{ "name": "Central", "url": "https://repo1.maven.org/maven2/" }
|
||||
],
|
||||
"artifacts": [
|
||||
"mysql:mysql-connector-java:8.0.26"
|
||||
]
|
||||
}
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
package testextension;
|
||||
|
||||
import net.minestom.server.MinecraftServer;
|
||||
import net.minestom.server.extensions.Extension;
|
||||
|
||||
public class TestExtension extends Extension {
|
||||
|
||||
@Override
|
||||
public void preInitialize() {
|
||||
System.out.println("During preinit");
|
||||
MinecraftServer.setTerminalEnabled(false);
|
||||
System.out.println("Mwahaha i disabled the terminal");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialize() {
|
||||
System.out.println("Hello from extension!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void terminate() {
|
||||
|
||||
}
|
||||
}
|
@ -1,4 +0,0 @@
|
||||
{
|
||||
"entrypoint": "testextension.TestExtension",
|
||||
"name": "Test_extension"
|
||||
}
|
Loading…
Reference in New Issue
Block a user