mirror of
https://github.com/layue13/MoonBridge.git
synced 2026-10-25 18:46:18 +00:00
- proxy/:core、plugin-api、luckperms 及其上游子模块 vendor/luckperms - messaging/、backend/ 保持在根目录(messaging 是代理与后端共用的 API) - build-logic/(原 proxy-build-logic) - testing/:smoke/ 与 benchmarks/,不进入发行物 Gradle 项目名不变(settings.gradle.kts 映射目录),任务路径与 Maven 坐标照旧。 脚本的仓库根定位、文档与记录中的链接同步更新。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
44 lines
1.3 KiB
Java
44 lines
1.3 KiB
Java
package dev.moonbridge.api;
|
|
|
|
import dev.moonbridge.api.event.Events;
|
|
import dev.moonbridge.api.permission.Permissions;
|
|
import dev.moonbridge.messaging.Messaging;
|
|
import java.io.IOException;
|
|
import java.nio.file.Path;
|
|
import java.util.Map;
|
|
import java.util.UUID;
|
|
import org.slf4j.Logger;
|
|
|
|
/** Services available to a loaded proxy plugin. Retained player and server handles expire after disable. */
|
|
public interface PluginContext {
|
|
/** Random identifier for this proxy process incarnation, shared with forwarded backend sessions. */
|
|
UUID proxyEpoch();
|
|
|
|
Players players();
|
|
|
|
Servers servers();
|
|
|
|
Commands commands();
|
|
|
|
Events events();
|
|
|
|
/** Returns this plugin's lifecycle-owned message channel scope. */
|
|
Messaging messaging();
|
|
|
|
Logger logger();
|
|
|
|
/** Player permission queries backed by the proxy's configured provider. */
|
|
Permissions permissions();
|
|
|
|
/** Dedicated persistent data directory owned by this plugin. */
|
|
Path dataDirectory();
|
|
|
|
/** Adds a dependency JAR from this plugin's data directory to its plugin class loader. */
|
|
void addLibrary(Path jar) throws IOException;
|
|
|
|
/** Immutable configuration assigned to this plugin by the proxy. */
|
|
default Map<String, String> settings() {
|
|
return Map.of();
|
|
}
|
|
}
|