[FEAT] Paper Support
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
package com.hypherionmc.craterlib.paper;
|
||||
|
||||
import com.hypherionmc.craterlib.api.events.server.CraterRegisterCommandEvent;
|
||||
import com.hypherionmc.craterlib.core.event.CraterEventBus;
|
||||
import com.hypherionmc.craterlib.core.platform.CommonPlatform;
|
||||
import com.hypherionmc.craterlib.utils.InternalServiceUtil;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
public class CraterLibPlugin extends JavaPlugin {
|
||||
|
||||
private final PaperEventListener listener = new PaperEventListener();
|
||||
|
||||
public CraterLibPlugin() {
|
||||
super();
|
||||
InternalServiceUtil.loader = getClassLoader();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
listener.onServerStarting(MinecraftServer.getServer());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
CraterEventBus.INSTANCE.postEvent(new CraterRegisterCommandEvent(MinecraftServer.getServer().createCommandSourceStack().dispatcher()));
|
||||
getServer().getPluginManager().registerEvents(listener, this);
|
||||
getServer().getScheduler().scheduleSyncDelayedTask(this, listener::onServerStarted);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user