Added EaglercraftXVelocity support to plugin

This commit is contained in:
lax1dude 2024-05-31 20:33:12 -07:00
parent 50c400c806
commit b35c58008f
4 changed files with 11 additions and 32 deletions

Binary file not shown.

View File

@ -1,29 +0,0 @@
package net.lax1dude.eaglercraft.v1_8.plugin.origin_blacklist.velocity;
import com.velocitypowered.api.command.CommandManager;
import net.lax1dude.eaglercraft.v1_8.plugin.gateway_velocity.command.EaglerCommand;
/**
* Copyright (c) 2024 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.
*
*/
public class CommandRegisterHelper {
public static void register(OriginBlacklistPluginVelocity plugin, EaglerCommand cmd) {
CommandManager cmdManager = OriginBlacklistPluginVelocity.proxy().getCommandManager();
cmdManager.register(cmdManager.metaBuilder(cmd.name).aliases(cmd.alias).plugin(plugin).build(), cmd);
}
}

View File

@ -9,6 +9,7 @@ import java.util.TimerTask;
import org.slf4j.Logger;
import com.google.inject.Inject;
import com.velocitypowered.api.command.CommandManager;
import com.velocitypowered.api.event.Subscribe;
import com.velocitypowered.api.event.proxy.ProxyInitializeEvent;
import com.velocitypowered.api.event.proxy.ProxyShutdownEvent;
@ -18,6 +19,7 @@ import com.velocitypowered.api.plugin.annotation.DataDirectory;
import com.velocitypowered.api.proxy.ProxyServer;
import net.lax1dude.eaglercraft.v1_8.plugin.gateway_velocity.EaglerXVelocityVersion;
import net.lax1dude.eaglercraft.v1_8.plugin.gateway_velocity.command.EaglerCommand;
import net.lax1dude.eaglercraft.v1_8.plugin.origin_blacklist.OriginBlacklist;
import net.lax1dude.eaglercraft.v1_8.plugin.origin_blacklist.OriginBlacklistConfigAdapter;
import net.lax1dude.eaglercraft.v1_8.plugin.origin_blacklist.OriginBlacklistLoggerAdapter;
@ -119,9 +121,14 @@ public class OriginBlacklistPluginVelocity {
}, 0, 6000l);
}
proxy.getEventManager().register(this, new OriginBlacklistListenerVelocity(this));
CommandRegisterHelper.register(this, new CommandDomainBlock());
CommandRegisterHelper.register(this, new CommandDomainBlockDomain());
CommandRegisterHelper.register(this, new CommandDomainUnblock());
registerCommand(new CommandDomainBlock());
registerCommand(new CommandDomainBlockDomain());
registerCommand(new CommandDomainUnblock());
}
private void registerCommand(EaglerCommand cmd) {
CommandManager cmdManager = proxy.getCommandManager();
cmdManager.register(cmdManager.metaBuilder(cmd.name).aliases(cmd.alias).plugin(this).build(), cmd);
}
@Subscribe

View File

@ -0,0 +1 @@
{"id":"originblacklist","name":"OriginBlacklist","version":"1.0.0","description":"Plugin for EaglercraftXVelocity servers to add the \"origin blacklist\" feature from 1.5.2","authors":["lax1dude"],"dependencies":[{"id":"eaglerxvelocity","optional":false}],"main":"net.lax1dude.eaglercraft.v1_8.plugin.origin_blacklist.velocity.OriginBlacklistPluginVelocity"}