mirror of
https://github.com/lax1dude/origin-blacklist-1.8.git
synced 2024-12-21 23:04:14 -08:00
Added EaglercraftXVelocity support to plugin
This commit is contained in:
parent
50c400c806
commit
b35c58008f
Binary file not shown.
|
@ -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);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -9,6 +9,7 @@ import java.util.TimerTask;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
|
import com.velocitypowered.api.command.CommandManager;
|
||||||
import com.velocitypowered.api.event.Subscribe;
|
import com.velocitypowered.api.event.Subscribe;
|
||||||
import com.velocitypowered.api.event.proxy.ProxyInitializeEvent;
|
import com.velocitypowered.api.event.proxy.ProxyInitializeEvent;
|
||||||
import com.velocitypowered.api.event.proxy.ProxyShutdownEvent;
|
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 com.velocitypowered.api.proxy.ProxyServer;
|
||||||
|
|
||||||
import net.lax1dude.eaglercraft.v1_8.plugin.gateway_velocity.EaglerXVelocityVersion;
|
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.OriginBlacklist;
|
||||||
import net.lax1dude.eaglercraft.v1_8.plugin.origin_blacklist.OriginBlacklistConfigAdapter;
|
import net.lax1dude.eaglercraft.v1_8.plugin.origin_blacklist.OriginBlacklistConfigAdapter;
|
||||||
import net.lax1dude.eaglercraft.v1_8.plugin.origin_blacklist.OriginBlacklistLoggerAdapter;
|
import net.lax1dude.eaglercraft.v1_8.plugin.origin_blacklist.OriginBlacklistLoggerAdapter;
|
||||||
|
@ -119,9 +121,14 @@ public class OriginBlacklistPluginVelocity {
|
||||||
}, 0, 6000l);
|
}, 0, 6000l);
|
||||||
}
|
}
|
||||||
proxy.getEventManager().register(this, new OriginBlacklistListenerVelocity(this));
|
proxy.getEventManager().register(this, new OriginBlacklistListenerVelocity(this));
|
||||||
CommandRegisterHelper.register(this, new CommandDomainBlock());
|
registerCommand(new CommandDomainBlock());
|
||||||
CommandRegisterHelper.register(this, new CommandDomainBlockDomain());
|
registerCommand(new CommandDomainBlockDomain());
|
||||||
CommandRegisterHelper.register(this, new CommandDomainUnblock());
|
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
|
@Subscribe
|
||||||
|
|
1
src/main/resources/velocity-plugin.json
Normal file
1
src/main/resources/velocity-plugin.json
Normal 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"}
|
Loading…
Reference in New Issue
Block a user