parent
8641bb59f0
commit
d597b1e33e
@ -31,7 +31,7 @@ authme = { module = "fr.xephi:authme", version.ref = "authme" }
|
||||
|
||||
libby-core = { group = "net.byteflux", name = "libby-core", version.ref = "libby" }
|
||||
libby-bukkit = { group = "net.byteflux", name = "libby-bukkit", version.ref = "libby" }
|
||||
#libby-paper = "TODO"
|
||||
libby-paper = { group = "net.byteflux", name = "libby-paper", version.ref = "libby" }
|
||||
libby-velocity = { group = "net.byteflux", name = "libby-velocity", version.ref = "libby" }
|
||||
|
||||
miniplaceholders = { group = "io.github.miniplaceholders", name = "miniplaceholders-api", version.ref = "miniplaceholders" }
|
||||
|
@ -27,7 +27,7 @@ dependencies {
|
||||
implementation(projects.authmevelocityApiPaper)
|
||||
|
||||
implementation(libs.libby.bukkit)
|
||||
//implementation(libs.libby.paper)
|
||||
implementation(libs.libby.paper)
|
||||
}
|
||||
|
||||
tasks {
|
||||
|
@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright (C) 2023 AuthMeVelocity Contributors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.github._4drian3d.authmevelocity.paper;
|
||||
|
||||
import io.papermc.paper.plugin.bootstrap.PluginBootstrap;
|
||||
import io.papermc.paper.plugin.bootstrap.PluginProviderContext;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public class AuthMeVelocityBootstrap implements PluginBootstrap {
|
||||
@Override
|
||||
public void bootstrap(@NotNull PluginProviderContext context) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull JavaPlugin createPlugin(@NotNull PluginProviderContext context) {
|
||||
return new AuthMeVelocityPlugin(context.getDataDirectory());
|
||||
}
|
||||
}
|
@ -26,25 +26,44 @@ import io.github._4drian3d.authmevelocity.common.configuration.PaperConfiguratio
|
||||
import io.github._4drian3d.authmevelocity.paper.listeners.AuthMeListener;
|
||||
import io.github._4drian3d.authmevelocity.paper.listeners.MessageListener;
|
||||
import net.byteflux.libby.BukkitLibraryManager;
|
||||
import net.byteflux.libby.LibraryManager;
|
||||
import net.byteflux.libby.PaperLibraryManager;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.nio.file.Path;
|
||||
import java.util.logging.Level;
|
||||
|
||||
public final class AuthMeVelocityPlugin extends JavaPlugin {
|
||||
private static final String CHANNEL = "authmevelocity:main";
|
||||
|
||||
private final Path dataFolder;
|
||||
private ConfigurationContainer<PaperConfiguration> config;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public AuthMeVelocityPlugin() {
|
||||
this.dataFolder = getDataFolder().toPath();
|
||||
}
|
||||
|
||||
public AuthMeVelocityPlugin(final Path dataFolder) {
|
||||
this.dataFolder = dataFolder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
new LibsManager(new BukkitLibraryManager(this)).loadLibraries();
|
||||
LibraryManager libraryManager;
|
||||
try {
|
||||
Class.forName("io.papermc.paper.plugin.bootstrap.PluginBootstrap");
|
||||
libraryManager = new PaperLibraryManager(this);
|
||||
} catch (ClassNotFoundException e) {
|
||||
libraryManager = new BukkitLibraryManager(this);
|
||||
}
|
||||
new LibsManager(libraryManager).loadLibraries();
|
||||
|
||||
try {
|
||||
this.config = ConfigurationContainer.load(getDataFolder().toPath(), PaperConfiguration.class);
|
||||
} catch (Exception e) {
|
||||
this.config = ConfigurationContainer.load(dataFolder, PaperConfiguration.class);
|
||||
} catch (Throwable e) {
|
||||
getLogger().log(Level.SEVERE, "Could not load config.conf file", e);
|
||||
getServer().getPluginManager().disablePlugin(this);
|
||||
return;
|
||||
|
@ -31,7 +31,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
public final class MessageListener implements PluginMessageListener {
|
||||
private final AuthMeVelocityPlugin plugin;
|
||||
|
||||
public MessageListener(AuthMeVelocityPlugin plugin) {
|
||||
public MessageListener(final AuthMeVelocityPlugin plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
|
17
paper/src/main/resources/paper-plugin.yml
Normal file
17
paper/src/main/resources/paper-plugin.yml
Normal file
@ -0,0 +1,17 @@
|
||||
name: AuthMeVelocity
|
||||
version: '${version}'
|
||||
main: io.github._4drian3d.authmevelocity.paper.AuthMeVelocityPlugin
|
||||
description: AuthMeReloaded Support for Velocity
|
||||
authors:
|
||||
- xQuickGlare
|
||||
- 4drian3d
|
||||
website: https://modrinth.com/plugin/authmevelocity
|
||||
api-version: '1.19'
|
||||
folia-supported: true
|
||||
dependencies:
|
||||
- name: MiniPlaceholders
|
||||
required: false
|
||||
bootstrap: false
|
||||
- name: AuthMe
|
||||
required: true
|
||||
bootstrap: false
|
Loading…
x
Reference in New Issue
Block a user