Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,4 @@ tasks.named("clean") {
tasks.named("build") {
dependsOn("shadowJar")
dependsOn("copyJars")
}
}
2 changes: 1 addition & 1 deletion bungeecord/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ dependencies {
compileOnly(project(":common"))
compileOnly("net.md-5:bungeecord-api:1.18-R0.1-SNAPSHOT")
compileOnly("net.kyori:adventure-platform-bungeecord:4.1.0")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ class BSCBungee: Plugin(), BSCPlugin {

proxy.pluginManager.registerListener(this, PlayerListener())
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ abstract class BSCBungeeCommand(name: String, permission: String?, aliases: List
fun warnTell(s: String) {
legacyTell("&e$s")
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ class CommandManager(private val plugin: BSCBungee) {
plugin.proxy.pluginManager.registerCommand(plugin, it)
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ class BetterStaffChatCommand: BSCBungeeCommand("betterstaffchat", null, listOf("

return
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ class StaffChatCommand(name: String, aliases: List<String>): BSCBungeeCommand(na

plugin.staffChatUtil.sendMessage(PlayerUtil.getReceiveAudience(), args.joinToString(separator = " "), PlayerUtil.getSenderName(sender), PlayerUtil.getServer(sender), PlayerMeta(null, null))
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ class StaffChatMuteCommand(name: String, aliases: List<String>): BSCBungeeComman

return
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ class StaffChatToggleCommand(name: String, aliases: List<String>): BSCBungeeComm

return
}
}
}
Original file line number Diff line number Diff line change
@@ -1,51 +1,50 @@
package dev.austech.betterstaffchat.bungeecord.libby;

import static java.util.Objects.requireNonNull;

import dev.austech.betterstaffchat.common.libraries.libby.LibraryManager;
import dev.austech.betterstaffchat.common.libraries.libby.classloader.URLClassLoaderHelper;
import dev.austech.betterstaffchat.common.libraries.libby.logging.adapters.JDKLogAdapter;
import net.md_5.bungee.api.plugin.Plugin;

import java.net.URLClassLoader;
import java.nio.file.Path;

import static java.util.Objects.requireNonNull;
import net.md_5.bungee.api.plugin.Plugin;

/**
* A runtime dependency manager for Bungee plugins.
*/
public class BungeeLibraryManager extends LibraryManager {
/**
* Plugin classpath helper
*/
private final URLClassLoaderHelper classLoader;
/**
* Plugin classpath helper
*/
private final URLClassLoaderHelper classLoader;

/**
* Creates a new Bungee library manager.
*
* @param plugin the plugin to manage
*/
public BungeeLibraryManager(Plugin plugin) {
this(plugin, "lib");
}
/**
* Creates a new Bungee library manager.
*
* @param plugin the plugin to manage
*/
public BungeeLibraryManager(Plugin plugin) { this(plugin, "lib"); }

/**
* Creates a new Bungee library manager.
*
* @param plugin the plugin to manage
* @param directoryName download directory name
*/
public BungeeLibraryManager(Plugin plugin, String directoryName) {
super(new JDKLogAdapter(requireNonNull(plugin, "plugin").getLogger()), plugin.getDataFolder().toPath(), directoryName);
classLoader = new URLClassLoaderHelper((URLClassLoader) plugin.getClass().getClassLoader(), this);
}
/**
* Creates a new Bungee library manager.
*
* @param plugin the plugin to manage
* @param directoryName download directory name
*/
public BungeeLibraryManager(Plugin plugin, String directoryName) {
super(new JDKLogAdapter(requireNonNull(plugin, "plugin").getLogger()),
plugin.getDataFolder().toPath(), directoryName);
classLoader = new URLClassLoaderHelper(
(URLClassLoader)plugin.getClass().getClassLoader(), this);
}

/**
* Adds a file to the Bungee plugin's classpath.
*
* @param file the file to add
*/
@Override
protected void addToClasspath(Path file) {
classLoader.addToClasspath(file);
}
/**
* Adds a file to the Bungee plugin's classpath.
*
* @param file the file to add
*/
@Override
protected void addToClasspath(Path file) {
classLoader.addToClasspath(file);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ class PlayerListener: Listener {
BSCBungee.instance.staffChatUtil.sendSwitchMessage(PlayerUtil.getReceiveAudience(), event.player.name, PlayerUtil.getServerReplacement(event.from), PlayerUtil.getServer(event.player), PlayerMeta(null, null))
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ object PlayerUtil {

return info.name
}
}
}
2 changes: 1 addition & 1 deletion common/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
// Nothing needs to be in this file
// Nothing needs to be in this file
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ interface BSCPlugin {
BUKKIT,
BUNGEECORD
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ import java.util.UUID
class PlayerMeta(
val prefix: String?,
val suffix: String?
) {}
) {}
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,4 @@ object BSCLibraries {

return libraryList
}
}
}
Loading