mirror of
https://github.com/colbster937/originblacklist.git
synced 2026-02-04 11:07:41 +00:00
Compare commits
13 Commits
v2.0.7+f02
...
c391ec3ad6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c391ec3ad6 | ||
|
|
ce7685367f | ||
|
|
bc16324342 | ||
|
|
f6cf685d1c | ||
|
|
9b955ea77d | ||
|
|
f1fe503357 | ||
|
|
e315eeab24 | ||
|
|
c4dbe81de0 | ||
|
|
2883adc928 | ||
|
|
00b1c99dc4 | ||
|
|
1cd60a4dba | ||
|
|
ebcae682aa | ||
|
|
f22e800439 |
19
.github/dependabot.yml
vendored
Normal file
19
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "gradle"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
open-pull-requests-limit: 10
|
||||
ignore:
|
||||
- dependency-name: "*"
|
||||
update-types: ["version-update:semver-major"]
|
||||
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
open-pull-requests-limit: 10
|
||||
ignore:
|
||||
- dependency-name: "*"
|
||||
update-types: ["version-update:semver-major"]
|
||||
22
.github/workflows/dependabot.yml
vendored
Normal file
22
.github/workflows/dependabot.yml
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
dependabot:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event.pull_request.user.login == 'dependabot[bot]'
|
||||
steps:
|
||||
- id: metadata
|
||||
uses: dependabot/fetch-metadata@21025c705c08248db411dc16f3619e6b5f9ea21a
|
||||
with:
|
||||
github-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
|
||||
- if: steps.metadata.outputs.update-type != 'version-update:semver-major'
|
||||
run: gh pr merge --auto --squash "$PR_URL"
|
||||
env:
|
||||
PR_URL: ${{ github.event.pull_request.html_url }}
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
2
.github/workflows/gradle.yml
vendored
2
.github/workflows/gradle.yml
vendored
@@ -1,5 +1,3 @@
|
||||
name: Build Plugin
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
|
||||
@@ -14,7 +14,7 @@ val PLUGIN_NAME = "OriginBlacklist"
|
||||
val PLUGIN_IDEN = "originblacklist"
|
||||
val PLUGIN_DOMN = "xyz.webmc.$PLUGIN_IDEN"
|
||||
val PLUGIN_DESC = "An eaglercraft client blacklist plugin."
|
||||
val PLUGIN_VERS = "2.0.7"
|
||||
val PLUGIN_VERS = "2.0.8"
|
||||
val PLUGIN_SITE = "https://github.com/WebMCDevelopment/$PLUGIN_IDEN"
|
||||
val PLUGIN_DEPA = listOf("EaglercraftXServer")
|
||||
val PLUGIN_DEPB = listOf("EaglercraftXServer")
|
||||
@@ -42,7 +42,7 @@ val EAGXS_VER = "1.0.8"
|
||||
|
||||
plugins {
|
||||
id("java")
|
||||
id("com.gradleup.shadow") version "9.3.1"
|
||||
id("com.gradleup.shadow") version "9.3.0"
|
||||
id("com.palantir.git-version") version "4.2.0"
|
||||
id("xyz.jpenilla.run-paper") version "3.0.2"
|
||||
id("xyz.jpenilla.run-waterfall") version "3.0.2"
|
||||
@@ -65,7 +65,7 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("com.velocitypowered:velocity-api:3.4.0-SNAPSHOT")
|
||||
compileOnly("com.velocitypowered:velocity-api:3.5.0-SNAPSHOT")
|
||||
compileOnly("org.bukkit:bukkit:1.8-R0.1-SNAPSHOT")
|
||||
compileOnly("net.md-5:bungeecord-api:1.21-R0.5-SNAPSHOT")
|
||||
compileOnly("net.lax1dude.eaglercraft.backend:api-velocity:1.0.0")
|
||||
|
||||
@@ -52,7 +52,6 @@ public final class OriginBlacklist {
|
||||
public static final String UNKNOWN_STR = "UNKNOWN";
|
||||
public static final String CENSORED_STR = "CENSORED";
|
||||
public static final String PLUGIN_REPO = "WebMCDevelopment/originblacklist";
|
||||
public static final int BSTATS_ID = 28776;
|
||||
|
||||
private final IOriginBlacklistPlugin plugin;
|
||||
private final OriginBlacklistConfig config;
|
||||
@@ -115,7 +114,7 @@ public final class OriginBlacklist {
|
||||
}
|
||||
this.plugin.kickPlayer(this.getBlacklistedComponent("kick", blacklisted.getArrayString(),
|
||||
blacklisted.getAltString(), blacklisted.getString(), "not allowed", "not allowed on the server",
|
||||
blacklisted_value, blacklisted.getActionString()), event);
|
||||
blacklisted_value, blacklisted.getActionString(), false), event);
|
||||
this.sendWebhooks(event, blacklisted);
|
||||
final String name = player.getName();
|
||||
if (isNonNull(name)) {
|
||||
@@ -137,9 +136,12 @@ public final class OriginBlacklist {
|
||||
} else {
|
||||
blacklisted_value = UNKNOWN_STR;
|
||||
}
|
||||
this.plugin.setMOTD(this.getBlacklistedComponent("motd", blacklisted.getArrayString(), blacklisted.getAltString(),
|
||||
if (this.isMOTDEnabled()) {
|
||||
this.plugin
|
||||
.setMOTD(this.getBlacklistedComponent("motd", blacklisted.getArrayString(), blacklisted.getAltString(),
|
||||
blacklisted.getString(), "blacklisted", "blacklisted from the server", blacklisted_value,
|
||||
blacklisted.getActionString()), event);
|
||||
blacklisted.getActionString(), true), event);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,6 +153,14 @@ public final class OriginBlacklist {
|
||||
return this.config.getBoolean("bStats");
|
||||
}
|
||||
|
||||
public final boolean isMOTDEnabled() {
|
||||
return this.config.getBoolean("motd.enabled");
|
||||
}
|
||||
|
||||
public final boolean isWebhooksEnabled() {
|
||||
return this.config.getBoolean("discord.webhook.enabled");
|
||||
}
|
||||
|
||||
public final boolean isLogFileEnabled() {
|
||||
return this.config.getBoolean("logFile");
|
||||
}
|
||||
@@ -166,13 +176,17 @@ public final class OriginBlacklist {
|
||||
public final void setEaglerMOTD(final Component comp, final OriginBlacklistMOTDEvent event) {
|
||||
final IMOTDConnection conn = event.getEaglerEvent().getMOTDConnection();
|
||||
final List<String> lst = new ArrayList<>();
|
||||
for (String ln : getComponentString(comp).split("\n")) {
|
||||
for (final String ln : getComponentString(comp).split("\n")) {
|
||||
lst.add(ln);
|
||||
}
|
||||
final List<String> pLst = new ArrayList<>();
|
||||
for (final Json5Element ln : this.config.getArray("motd.players.hover").getAsJson5Array()) {
|
||||
pLst.add(getLegacyFromMiniMessage(ln.getAsString().replaceAll("%discord_invite%", this.config.getString("discord.invite"))));
|
||||
}
|
||||
conn.setServerMOTD(lst);
|
||||
conn.setPlayerTotal(0);
|
||||
conn.setPlayerUnlimited();
|
||||
conn.setPlayerList(List.of());
|
||||
conn.setPlayerTotal(this.config.getInteger("motd.players.online"));
|
||||
conn.setPlayerMax(this.config.getInteger("motd.players.max"));
|
||||
conn.setPlayerList(pLst);
|
||||
conn.setServerIcon(this.config.getIconBytes());
|
||||
conn.sendToUser();
|
||||
conn.disconnect();
|
||||
@@ -321,6 +335,7 @@ public final class OriginBlacklist {
|
||||
try {
|
||||
final Json5Object obj = new Json5Object();
|
||||
obj.addProperty("plugin_version", this.plugin.getPluginVersion().getVersion());
|
||||
obj.addProperty("git_commit", COMMIT_L);
|
||||
obj.addProperty("blacklist_to_whitelist", this.config.getBoolean("blacklist_to_whitelist"));
|
||||
obj.addProperty("block_undefined_origin", this.config.getBoolean("block_undefined_origin"));
|
||||
final Json5Object bObj = new Json5Object();
|
||||
@@ -345,8 +360,8 @@ public final class OriginBlacklist {
|
||||
|
||||
private final Component getBlacklistedComponent(final String type, final String id, final String blockType,
|
||||
final String blockTypeAlt, final String notAllowed, final String notAllowedAlt, final String blockValue,
|
||||
final String action) {
|
||||
final Json5Array arr = this.config.getArray("messages." + type);
|
||||
final String action, final boolean isMOTD) {
|
||||
final Json5Array arr = this.config.getArray(isMOTD ? (type + ".text") : ("messages." + type));
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0; i < arr.size(); i++) {
|
||||
if (i > 0)
|
||||
@@ -359,21 +374,26 @@ public final class OriginBlacklist {
|
||||
.replaceAll("%block_type%", blockType)
|
||||
.replaceAll("%not_allowed%", notAllowed)
|
||||
.replaceAll("%not_allowed_alt%", notAllowedAlt)
|
||||
.replaceAll("%blocked_value%", blockValue);
|
||||
.replaceAll("%blocked_value%", blockValue)
|
||||
.replaceAll("%discord_invite%", this.config.getString("discord.invite"));
|
||||
return MiniMessage.miniMessage().deserialize(str);
|
||||
}
|
||||
|
||||
private final void sendWebhooks(final OriginBlacklistLoginEvent event, final EnumBlacklistType type) {
|
||||
if (this.config.getBoolean("discord.enabled")) {
|
||||
if (this.isWebhooksEnabled()) {
|
||||
final OPlayer player = event.getPlayer();
|
||||
final EnumConnectionType connType = event.getConnectionType();
|
||||
/* final String userAgent;
|
||||
if (connType == EnumConnectionType.EAGLER) {
|
||||
final IEaglerLoginConnection loginConn = event.getEaglerEvent().getLoginConnection();
|
||||
userAgent = loginConn.getWebSocketHeader(EnumWebSocketHeader.HEADER_USER_AGENT);
|
||||
} else {
|
||||
userAgent = UNKNOWN_STR;
|
||||
} */
|
||||
/*
|
||||
* final String userAgent;
|
||||
* if (connType == EnumConnectionType.EAGLER) {
|
||||
* final IEaglerLoginConnection loginConn =
|
||||
* event.getEaglerEvent().getLoginConnection();
|
||||
* userAgent =
|
||||
* loginConn.getWebSocketHeader(EnumWebSocketHeader.HEADER_USER_AGENT);
|
||||
* } else {
|
||||
* userAgent = UNKNOWN_STR;
|
||||
* }
|
||||
*/
|
||||
final byte[] payload = String.format(
|
||||
"""
|
||||
{
|
||||
@@ -466,7 +486,8 @@ public final class OriginBlacklist {
|
||||
private final void updateLogFile(final OriginBlacklistLoginEvent event, final EnumBlacklistType type) {
|
||||
if (this.isLogFileEnabled()) {
|
||||
final OPlayer player = event.getPlayer();
|
||||
final String txt = Instant.now() + " - [player=" + player.getName() + "," + "blacklist_reason=" + type.toString() + "]";
|
||||
final String txt = Instant.now() + " - [player=" + player.getName() + "," + "blacklist_reason=" + type.toString()
|
||||
+ "]";
|
||||
final Path dir = Paths.get(this.getDataDir());
|
||||
try {
|
||||
Files.createDirectories(dir);
|
||||
@@ -475,8 +496,7 @@ public final class OriginBlacklist {
|
||||
txt + "\n",
|
||||
StandardOpenOption.CREATE,
|
||||
StandardOpenOption.WRITE,
|
||||
StandardOpenOption.APPEND
|
||||
);
|
||||
StandardOpenOption.APPEND);
|
||||
} catch (final Throwable t) {
|
||||
t.printStackTrace();
|
||||
}
|
||||
@@ -502,4 +522,10 @@ public final class OriginBlacklist {
|
||||
public static final boolean isNonNull(final String str) {
|
||||
return str != null && !str.isEmpty() && !str.isBlank() && !str.equals("null");
|
||||
}
|
||||
|
||||
public static final class BSTATS {
|
||||
public static final int VELOCITY = 29033;
|
||||
public static final int BUNGEE = 29034;
|
||||
public static final int BUKKIT = 29035;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,8 @@ import de.marhali.json5.Json5Object;
|
||||
import de.marhali.json5.Json5Primitive;
|
||||
|
||||
public final class OriginBlacklistConfig {
|
||||
private static final Json5Object DEFAULT_CONFIG = getDefaultConfig();
|
||||
public static final Json5Object DEFAULT_CONFIG = getDefaultConfig();
|
||||
public static final int LATEST_CONFIG_VERSION = 2;
|
||||
|
||||
private final Json5 json5;
|
||||
private final File file;
|
||||
@@ -73,6 +74,7 @@ public final class OriginBlacklistConfig {
|
||||
Json5Element parsed = this.json5.parse(text);
|
||||
if (parsed instanceof Json5Object) {
|
||||
this.config = (Json5Object) parsed;
|
||||
this.config = OriginBlacklistConfigTransformer.transformConfig(this.config);
|
||||
merge(this.config, DEFAULT_CONFIG);
|
||||
} else {
|
||||
throw new IOException("Config must be an object!");
|
||||
@@ -262,18 +264,29 @@ public final class OriginBlacklistConfig {
|
||||
kick.add("%action%");
|
||||
kick.add("");
|
||||
kick.add("<aqua>Think this is a mistake? Join our discord:</aqua>");
|
||||
kick.add("<blue>discord.gg/changethisintheconfig</blue>");
|
||||
kick.add("<blue>%discord_invite%</blue>");
|
||||
addJSONObj(mObj, "kick", kick, null);
|
||||
final Json5Array motd = new Json5Array();
|
||||
motd.add("<red>This %block_type% is %not_allowed%!</red>");
|
||||
motd.add("<dark_gray>»</dark_gray> <gray>%blocked_value%</gray>");
|
||||
addJSONObj(mObj, "motd", motd, null);
|
||||
final Json5Object actions = new Json5Object();
|
||||
actions.add("generic", Json5Primitive.fromString("<gold>Please switch to a different %block_type%.</gold>"));
|
||||
actions.add("player_name", Json5Primitive.fromString("<gold>Please change your %block_type%.</gold>"));
|
||||
actions.add("ip_address", Json5Primitive.fromString("<gold>Please contact staff for assistance.</gold>"));
|
||||
addJSONObj(mObj, "actions", actions, null);
|
||||
addJSONObj(obj, "messages", mObj, null);
|
||||
final Json5Object nObj = new Json5Object();
|
||||
addJSONObj(nObj, "enabled", Json5Primitive.fromBoolean(true), null);
|
||||
final Json5Array mArr = new Json5Array();
|
||||
mArr.add("<red>This %block_type% is %not_allowed%!</red>");
|
||||
mArr.add("<dark_gray>»</dark_gray> <gray>%blocked_value%</gray>");
|
||||
addJSONObj(nObj, "text", mArr, null);
|
||||
final Json5Object mPlayers = new Json5Object();
|
||||
addJSONObj(mPlayers, "online", Json5Primitive.fromNumber(0), null);
|
||||
addJSONObj(mPlayers, "max", Json5Primitive.fromNumber(0), null);
|
||||
final Json5Array hArr = new Json5Array();
|
||||
hArr.add("<blue>Join our discord</blue>");
|
||||
hArr.add("<blue>%discord_invite%</blue>");
|
||||
addJSONObj(mPlayers, "hover", hArr, null);
|
||||
addJSONObj(nObj, "players", mPlayers, null);
|
||||
addJSONObj(obj, "motd", nObj, null);
|
||||
final Json5Object bObj = new Json5Object();
|
||||
final Json5Array origins = new Json5Array();
|
||||
origins.add(".*eaglerhackedclients\\.vercel\\.app.*");
|
||||
@@ -302,9 +315,12 @@ public final class OriginBlacklistConfig {
|
||||
addJSONObj(bObj, "ip_addresses", ips, null);
|
||||
addJSONObj(obj, "blacklist", bObj, null);
|
||||
final Json5Object dObj = new Json5Object();
|
||||
addJSONObj(dObj, "enabled", Json5Primitive.fromBoolean(false), null);
|
||||
addJSONObj(dObj, "webhook_urls", new Json5Array(), null);
|
||||
addJSONObj(dObj, "send_ips", Json5Primitive.fromBoolean(true), null);
|
||||
addJSONObj(dObj, "invite", Json5Primitive.fromString("discord.gg/changeme"), null);
|
||||
final Json5Object webhook = new Json5Object();
|
||||
addJSONObj(webhook, "enabled", Json5Primitive.fromBoolean(false), null);
|
||||
addJSONObj(webhook, "webhook_urls", new Json5Array(), null);
|
||||
addJSONObj(webhook, "send_ips", Json5Primitive.fromBoolean(true), null);
|
||||
addJSONObj(dObj, "webhook", webhook, null);
|
||||
addJSONObj(obj, "discord", dObj, null);
|
||||
final Json5Object uObj = new Json5Object();
|
||||
addJSONObj(uObj, "enabled", Json5Primitive.fromBoolean(true), null);
|
||||
@@ -317,7 +333,7 @@ public final class OriginBlacklistConfig {
|
||||
addJSONObj(obj, "block_undefined_origin", Json5Primitive.fromBoolean(false), null);
|
||||
addJSONObj(obj, "bStats", Json5Primitive.fromBoolean(true), null);
|
||||
addJSONObj(obj, "logFile", Json5Primitive.fromBoolean(true), null);
|
||||
addJSONObj(obj, "config_version", Json5Primitive.fromNumber(1), "DO NOT CHANGE");
|
||||
addJSONObj(obj, "config_version", Json5Primitive.fromNumber(LATEST_CONFIG_VERSION), "DO NOT CHANGE");
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
package xyz.webmc.originblacklist.base.config;
|
||||
|
||||
import de.marhali.json5.Json5Array;
|
||||
import de.marhali.json5.Json5Object;
|
||||
import de.marhali.json5.Json5Primitive;
|
||||
|
||||
public final class OriginBlacklistConfigTransformer {
|
||||
public static final Json5Object transformConfig(final Json5Object config) {
|
||||
final Json5Object obj = config.deepCopy();
|
||||
final int ver = obj.get("config_version").getAsInt();
|
||||
if (ver <= 1) {
|
||||
final Json5Object mObj = obj.get("messages").getAsJson5Object().deepCopy();
|
||||
final Json5Array motd = mObj.get("motd").getAsJson5Array().deepCopy();
|
||||
mObj.remove("motd");
|
||||
final Json5Object nObj = new Json5Object();
|
||||
nObj.add("text", motd);
|
||||
obj.remove("messages");
|
||||
obj.add("messages", mObj);
|
||||
obj.add("motd", nObj);
|
||||
final Json5Object dObj = obj.get("discord").getAsJson5Object().deepCopy();
|
||||
final Json5Primitive wEnabled = dObj.get("enabled").getAsJson5Primitive();
|
||||
final Json5Array wURLS = dObj.get("webhook_urls").getAsJson5Array().deepCopy();
|
||||
final Json5Primitive wAddrs = dObj.get("send_ips").getAsJson5Primitive();
|
||||
dObj.remove("enabled");
|
||||
dObj.remove("webhook_urls");
|
||||
dObj.remove("send_ips");
|
||||
final Json5Object oObj = new Json5Object();
|
||||
oObj.add("enabled", wEnabled);
|
||||
oObj.add("webhook_urls", wURLS);
|
||||
oObj.add("send_ips", wAddrs);
|
||||
dObj.add("webhook", oObj);
|
||||
obj.remove("discord");
|
||||
obj.add("discord", dObj);
|
||||
}
|
||||
obj.remove("config_version");
|
||||
obj.add("config_version", Json5Primitive.fromNumber(OriginBlacklistConfig.LATEST_CONFIG_VERSION));
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package xyz.webmc.originblacklist.base.util;
|
||||
|
||||
public final class EaglerEventPriority {
|
||||
public static final int EAGLER_MOTD_EVENT = 100;
|
||||
}
|
||||
@@ -76,7 +76,7 @@ public final class OriginBlacklistBukkit extends JavaPlugin implements Listener,
|
||||
this.getServer().getPluginManager().registerEvents(this, this);
|
||||
this.blacklist.init();
|
||||
if (this.blacklist.isMetricsEnabled()) {
|
||||
this.metrics = new Metrics(this, OriginBlacklist.BSTATS_ID);
|
||||
this.metrics = new Metrics(this, OriginBlacklist.BSTATS.BUKKIT);
|
||||
this.metrics.addCustomChart(new AdvancedPie("player_types", () -> {
|
||||
final Map<String, Integer> playerMap = new HashMap<>();
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import xyz.webmc.originblacklist.base.enums.EnumConnectionType;
|
||||
import xyz.webmc.originblacklist.base.enums.EnumLogLevel;
|
||||
import xyz.webmc.originblacklist.base.events.OriginBlacklistLoginEvent;
|
||||
import xyz.webmc.originblacklist.base.events.OriginBlacklistMOTDEvent;
|
||||
import xyz.webmc.originblacklist.base.util.EaglerEventPriority;
|
||||
import xyz.webmc.originblacklist.base.util.IOriginBlacklistPlugin;
|
||||
import xyz.webmc.originblacklist.base.util.IncompatibleDependencyException;
|
||||
import xyz.webmc.originblacklist.base.util.OPlayer;
|
||||
@@ -75,7 +76,7 @@ public final class OriginBlacklistBungee extends Plugin implements Listener, IOr
|
||||
this.getProxy().getPluginManager().registerListener(this, this);
|
||||
this.blacklist.init();
|
||||
if (this.blacklist.isMetricsEnabled()) {
|
||||
this.metrics = new Metrics(this, OriginBlacklist.BSTATS_ID);
|
||||
this.metrics = new Metrics(this, OriginBlacklist.BSTATS.BUNGEE);
|
||||
this.metrics.addCustomChart(new AdvancedPie("player_types", () -> {
|
||||
final Map<String, Integer> playerMap = new HashMap<>();
|
||||
|
||||
@@ -101,7 +102,7 @@ public final class OriginBlacklistBungee extends Plugin implements Listener, IOr
|
||||
this.blacklist.handleLogin(new OriginBlacklistLoginEvent(event, null, EnumConnectionType.EAGLER, player));
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
@EventHandler(priority = EaglerEventPriority.EAGLER_MOTD_EVENT)
|
||||
public final void onEaglerMOTD(final EaglercraftMOTDEvent event) {
|
||||
final OPlayer player = new OPlayer(event.getMOTDConnection(), null, null);
|
||||
this.blacklist.handleMOTD(new OriginBlacklistMOTDEvent(event, null, EnumConnectionType.EAGLER, player));
|
||||
|
||||
@@ -5,6 +5,7 @@ import xyz.webmc.originblacklist.base.enums.EnumConnectionType;
|
||||
import xyz.webmc.originblacklist.base.enums.EnumLogLevel;
|
||||
import xyz.webmc.originblacklist.base.events.OriginBlacklistLoginEvent;
|
||||
import xyz.webmc.originblacklist.base.events.OriginBlacklistMOTDEvent;
|
||||
import xyz.webmc.originblacklist.base.util.EaglerEventPriority;
|
||||
import xyz.webmc.originblacklist.base.util.IOriginBlacklistPlugin;
|
||||
import xyz.webmc.originblacklist.base.util.IncompatibleDependencyException;
|
||||
import xyz.webmc.originblacklist.base.util.OPlayer;
|
||||
@@ -91,7 +92,7 @@ public final class OriginBlacklistVelocity implements IOriginBlacklistPlugin {
|
||||
this.proxy.getCommandManager().register("originblacklist", new OriginBlacklistCommandVelocity(this.blacklist));
|
||||
this.blacklist.init();
|
||||
if (this.blacklist.isMetricsEnabled()) {
|
||||
this.metrics = this.metricsFactory.make(this, OriginBlacklist.BSTATS_ID);
|
||||
this.metrics = this.metricsFactory.make(this, OriginBlacklist.BSTATS.VELOCITY);
|
||||
this.metrics.addCustomChart(new AdvancedPie("player_types", () -> {
|
||||
final Map<String, Integer> playerMap = new HashMap<>();
|
||||
|
||||
@@ -117,7 +118,7 @@ public final class OriginBlacklistVelocity implements IOriginBlacklistPlugin {
|
||||
this.blacklist.handleLogin(new OriginBlacklistLoginEvent(event, null, EnumConnectionType.EAGLER, player));
|
||||
}
|
||||
|
||||
@Subscribe(order = PostOrder.LAST)
|
||||
@Subscribe(priority = EaglerEventPriority.EAGLER_MOTD_EVENT, order = PostOrder.LAST)
|
||||
public final void onEaglerMOTD(final EaglercraftMOTDEvent event) {
|
||||
final OPlayer player = new OPlayer(event.getMOTDConnection(), null, null);
|
||||
this.blacklist.handleMOTD(new OriginBlacklistMOTDEvent(event, null, EnumConnectionType.EAGLER, player));
|
||||
|
||||
Reference in New Issue
Block a user