Archive eaglerxrewind (plugin, 1.5.2, 1.8.8, clean)
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
|
||||
plugins {
|
||||
id "java-library"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
api project(":eaglermotd")
|
||||
compileOnly project(":api-bungee")
|
||||
compileOnly(libs.bungeecord.api)
|
||||
compileOnly(libs.pluginannotations)
|
||||
annotationProcessor(libs.pluginannotations)
|
||||
}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* Copyright (c) 2025 lax1dude. All Rights Reserved.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.lax1dude.eaglercraft.backend.eaglermotd.bungee;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import net.lax1dude.eaglercraft.backend.server.api.bungee.event.EaglercraftMOTDEvent;
|
||||
import net.lax1dude.eaglercraft.backend.server.api.event.IEaglercraftMOTDEvent;
|
||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||
import net.md_5.bungee.api.plugin.Listener;
|
||||
import net.md_5.bungee.event.EventHandler;
|
||||
|
||||
public class BungeeListener implements Listener {
|
||||
|
||||
private final PlatformPluginBungee plugin;
|
||||
|
||||
BungeeListener(PlatformPluginBungee plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onEaglercraftMOTDEvent(EaglercraftMOTDEvent event) {
|
||||
Consumer<IEaglercraftMOTDEvent<ProxiedPlayer>> consumer = plugin.onMOTDHandler;
|
||||
if (consumer != null) {
|
||||
consumer.accept(event);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* Copyright (c) 2026 lax1dude. All Rights Reserved.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.lax1dude.eaglercraft.backend.eaglermotd.bungee;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import com.google.gson.JsonParseException;
|
||||
|
||||
import net.lax1dude.eaglercraft.backend.eaglermotd.adapter.IEaglerMOTDPlatform;
|
||||
import net.md_5.bungee.api.ChatColor;
|
||||
import net.md_5.bungee.api.CommandSender;
|
||||
import net.md_5.bungee.api.chat.BaseComponent;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import net.md_5.bungee.api.plugin.Command;
|
||||
|
||||
class CommandEaglerMOTD extends Command {
|
||||
|
||||
private final PlatformPluginBungee plugin;
|
||||
|
||||
CommandEaglerMOTD(PlatformPluginBungee plugin) {
|
||||
super("eaglermotd", "eaglercraft.eaglermotd.reload");
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if (args.length == 1 && "reload".equalsIgnoreCase(args[0])) {
|
||||
IEaglerMOTDPlatform.IHandleReload handler = plugin.handleReload;
|
||||
if (handler == null) {
|
||||
BaseComponent comp = new TextComponent("Plugin is not enabled!");
|
||||
comp.setColor(ChatColor.RED);
|
||||
sender.sendMessage(comp);
|
||||
return;
|
||||
}
|
||||
TextComponent comp;
|
||||
try {
|
||||
handler.reload();
|
||||
} catch (IOException | JsonParseException ex) {
|
||||
plugin.logger().error("Failed to reload config files!", ex);
|
||||
comp = new TextComponent("Failed to reload config files! (Check Server Log)");
|
||||
comp.setColor(ChatColor.RED);
|
||||
sender.sendMessage(comp);
|
||||
comp = new TextComponent(ex.toString());
|
||||
comp.setColor(ChatColor.RED);
|
||||
sender.sendMessage(comp);
|
||||
return;
|
||||
}
|
||||
comp = new TextComponent("Configuration reloaded.");
|
||||
comp.setColor(ChatColor.AQUA);
|
||||
sender.sendMessage(comp);
|
||||
} else {
|
||||
BaseComponent comp = new TextComponent("Usage: /eaglermotd reload");
|
||||
comp.setColor(ChatColor.RED);
|
||||
sender.sendMessage(comp);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+93
@@ -0,0 +1,93 @@
|
||||
/*
|
||||
* Copyright (c) 2025 lax1dude. All Rights Reserved.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.lax1dude.eaglercraft.backend.eaglermotd.bungee;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import eu.hexagonmc.spigot.annotation.meta.DependencyType;
|
||||
import eu.hexagonmc.spigot.annotation.plugin.Dependency;
|
||||
import eu.hexagonmc.spigot.annotation.plugin.Plugin.Bungee;
|
||||
import net.lax1dude.eaglercraft.backend.eaglermotd.adapter.IEaglerMOTDImpl;
|
||||
import net.lax1dude.eaglercraft.backend.eaglermotd.adapter.IEaglerMOTDLogger;
|
||||
import net.lax1dude.eaglercraft.backend.eaglermotd.adapter.IEaglerMOTDPlatform;
|
||||
import net.lax1dude.eaglercraft.backend.eaglermotd.adapter.JavaLogger;
|
||||
import net.lax1dude.eaglercraft.backend.eaglermotd.base.EaglerMOTD;
|
||||
import net.lax1dude.eaglercraft.backend.eaglermotd.base.EaglerMOTDVersion;
|
||||
import net.lax1dude.eaglercraft.backend.server.api.bungee.EaglerXServerAPI;
|
||||
import net.lax1dude.eaglercraft.backend.server.api.event.IEaglercraftMOTDEvent;
|
||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||
import net.md_5.bungee.api.plugin.Plugin;
|
||||
import net.md_5.bungee.api.plugin.PluginManager;
|
||||
|
||||
@eu.hexagonmc.spigot.annotation.plugin.Plugin(
|
||||
name = PlatformPluginBungee.PLUGIN_NAME,
|
||||
version = PlatformPluginBungee.PLUGIN_VERSION,
|
||||
description = "Official EaglerMOTD plugin for EaglercraftXServer",
|
||||
bungee = @Bungee(author = PlatformPluginBungee.PLUGIN_AUTHOR),
|
||||
dependencies = {
|
||||
@Dependency(name = EaglerXServerAPI.PLUGIN_NAME, type = DependencyType.DEPEND)
|
||||
}
|
||||
)
|
||||
public class PlatformPluginBungee extends Plugin implements IEaglerMOTDPlatform<ProxiedPlayer> {
|
||||
|
||||
public static final String PLUGIN_NAME = "EaglerMOTD-Reborn";
|
||||
public static final String PLUGIN_AUTHOR = EaglerMOTDVersion.PLUGIN_AUTHOR;
|
||||
public static final String PLUGIN_VERSION = EaglerMOTDVersion.PLUGIN_VERSION;
|
||||
|
||||
private JavaLogger logger;
|
||||
private IEaglerMOTDImpl<ProxiedPlayer> eaglermotd;
|
||||
Consumer<IEaglercraftMOTDEvent<ProxiedPlayer>> onMOTDHandler;
|
||||
IHandleReload handleReload;
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
logger = new JavaLogger(getLogger());
|
||||
eaglermotd = new EaglerMOTD<>(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
PluginManager mgr = getProxy().getPluginManager();
|
||||
mgr.registerListener(this, new BungeeListener(this));
|
||||
mgr.registerCommand(this, new CommandEaglerMOTD(this));
|
||||
eaglermotd.onEnable(EaglerXServerAPI.instance());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisable() {
|
||||
PluginManager mgr = getProxy().getPluginManager();
|
||||
mgr.unregisterListeners(this);
|
||||
mgr.unregisterCommands(this);
|
||||
eaglermotd.onDisable(EaglerXServerAPI.instance());
|
||||
}
|
||||
|
||||
@Override
|
||||
public IEaglerMOTDLogger logger() {
|
||||
return logger;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setOnMOTD(Consumer<IEaglercraftMOTDEvent<ProxiedPlayer>> handler) {
|
||||
this.onMOTDHandler = handler;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setOnReload(IHandleReload handleReload) {
|
||||
this.handleReload = handleReload;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user