Compare commits

..

10 Commits

Author SHA1 Message Date
dependabot[bot]
41ce550089 Bump me.clip:placeholderapi from 2.12.1 to 2.12.2 (#18)
Bumps me.clip:placeholderapi from 2.12.1 to 2.12.2.

---
updated-dependencies:
- dependency-name: me.clip:placeholderapi
  dependency-version: 2.12.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-12 15:58:08 +00:00
Colbster937
745622fa36 update build.gradle.kts 2026-02-11 07:38:31 -06:00
Colbster937
e7343b557d Merge pull request #17 from Cirsius/main
fix NullPointerException when geyser dispatches ProxyPingEvent with a null virtual host
2026-02-11 07:34:52 -06:00
cirsius
47d451362b fix NullPointerException when geyser dispatches ProxyPingEvent with a null virtual host 2026-02-11 05:33:20 -06:00
Colbster937
f4261e0d6c update 2026-02-05 17:36:05 -06:00
Colbster937
b91b4f93e5 Merge branch 'main' of https://github.com/WebMCDevelopment/originblacklist 2026-02-05 13:36:28 -06:00
Colbster937
2e05fb6031 remove debug code 2026-02-05 13:36:23 -06:00
dependabot[bot]
a7ea336158 Bump com.github.seancfoley:ipaddress from 5.5.1 to 5.6.1 (#16)
Bumps [com.github.seancfoley:ipaddress](https://github.com/seancfoley/IPAddress) from 5.5.1 to 5.6.1.
- [Release notes](https://github.com/seancfoley/IPAddress/releases)
- [Commits](https://github.com/seancfoley/IPAddress/compare/v5.5.1...v5.6.1)

---
updated-dependencies:
- dependency-name: com.github.seancfoley:ipaddress
  dependency-version: 5.6.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-05 15:58:11 +00:00
dependabot[bot]
0a2c39fbd4 Bump me.clip:placeholderapi from 2.11.7 to 2.12.1 (#15)
Bumps me.clip:placeholderapi from 2.11.7 to 2.12.1.

---
updated-dependencies:
- dependency-name: me.clip:placeholderapi
  dependency-version: 2.12.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-05 15:57:56 +00:00
Colbster937
df17431df0 thing 2026-02-03 19:58:52 -06:00
5 changed files with 37 additions and 32 deletions

View File

@@ -71,13 +71,13 @@ dependencies {
compileOnly("net.lax1dude.eaglercraft.backend:api-velocity:1.0.0") compileOnly("net.lax1dude.eaglercraft.backend:api-velocity:1.0.0")
compileOnly("net.lax1dude.eaglercraft.backend:api-bungee:1.0.0") compileOnly("net.lax1dude.eaglercraft.backend:api-bungee:1.0.0")
compileOnly("net.lax1dude.eaglercraft.backend:api-bukkit:1.0.0") compileOnly("net.lax1dude.eaglercraft.backend:api-bukkit:1.0.0")
compileOnly("me.clip:placeholderapi:2.11.7") compileOnly("me.clip:placeholderapi:2.12.2")
compileOnly("net.william278:papiproxybridge:1.8.4") compileOnly("net.william278:papiproxybridge:1.8.4")
implementation("org.semver4j:semver4j:6.0.0") implementation("org.semver4j:semver4j:6.0.0")
implementation("de.marhali:json5-java:3.0.0") implementation("de.marhali:json5-java:3.0.0")
implementation("net.kyori:adventure-text-minimessage:4.26.1") implementation("net.kyori:adventure-text-minimessage:4.26.1")
implementation("net.kyori:adventure-text-serializer-legacy:4.26.1") implementation("net.kyori:adventure-text-serializer-legacy:4.26.1")
implementation("com.github.seancfoley:ipaddress:5.5.1") implementation("com.github.seancfoley:ipaddress:5.6.1")
implementation("org.bstats:bstats-bukkit:3.1.0") implementation("org.bstats:bstats-bukkit:3.1.0")
implementation("org.bstats:bstats-bungeecord:3.1.0") implementation("org.bstats:bstats-bungeecord:3.1.0")
implementation("org.bstats:bstats-velocity:3.1.0") implementation("org.bstats:bstats-velocity:3.1.0")
@@ -111,12 +111,12 @@ val BUILD_PROPS = mapOf(
"git_cm_hash" to GIT_INFO.gitHashFull, "git_cm_hash" to GIT_INFO.gitHashFull,
) )
tasks.withType<JavaCompile>().configureEach { tasks.named<JavaCompile>("compileJava") {
options.encoding = "UTF-8" options.encoding = "UTF-8"
options.release.set(21) options.release.set(21)
} }
tasks.withType<ProcessResources>().configureEach { tasks.named<ProcessResources>("processResources") {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE duplicatesStrategy = DuplicatesStrategy.EXCLUDE
outputs.upToDateWhen { false } outputs.upToDateWhen { false }
@@ -139,11 +139,12 @@ tasks.withType<ProcessResources>().configureEach {
inputs.files(tasks.named<JavaCompile>("compileJava").map { it.outputs.files }) inputs.files(tasks.named<JavaCompile>("compileJava").map { it.outputs.files })
} }
tasks.withType<Jar>().configureEach { tasks.named<Jar>("jar") {
if (this !is ShadowJar) enabled = false enabled = false
} }
tasks.withType<ShadowJar>().configureEach { tasks.named<ShadowJar>("shadowJar") {
enabled = true
doFirst { doFirst {
delete(layout.buildDirectory.dir("libs")) delete(layout.buildDirectory.dir("libs"))
mkdir(layout.buildDirectory.dir("libs")) mkdir(layout.buildDirectory.dir("libs"))
@@ -168,17 +169,17 @@ tasks.register("printVars") {
} }
} }
tasks.withType<RunServer>().configureEach { tasks.named<RunServer>("runServer") {
minecraftVersion("1.12.2") minecraftVersion("1.12.2")
runDirectory.set(layout.projectDirectory.dir("run/paper")) runDirectory.set(layout.projectDirectory.dir("run/paper"))
jvmArgs("-Dcom.mojang.eula.agree=true") jvmArgs("-Dcom.mojang.eula.agree=true")
downloadPlugins { downloadPlugins {
github("lax1dude", "eaglerxserver", "v" + EAGXS_VER, "EaglerXServer.jar") github("lax1dude", "eaglerxserver", "v" + EAGXS_VER, "EaglerXServer.jar")
modrinth("placeholderapi", "2.11.7") modrinth("placeholderapi", "2.12.2")
} }
} }
tasks.withType<RunWaterfall>().configureEach { tasks.named<RunWaterfall>("runWaterfall") {
waterfallVersion("1.21") waterfallVersion("1.21")
runDirectory.set(layout.projectDirectory.dir("run/waterfall")) runDirectory.set(layout.projectDirectory.dir("run/waterfall"))
downloadPlugins { downloadPlugins {
@@ -186,8 +187,8 @@ tasks.withType<RunWaterfall>().configureEach {
} }
} }
tasks.withType<RunVelocity>().configureEach { tasks.named<RunVelocity>("runVelocity") {
velocityVersion("3.4.0-SNAPSHOT") velocityVersion("3.5.0-SNAPSHOT")
runDirectory.set(layout.projectDirectory.dir("run/velocity")) runDirectory.set(layout.projectDirectory.dir("run/velocity"))
downloadPlugins { downloadPlugins {
github("lax1dude", "eaglerxserver", "v" + EAGXS_VER, "EaglerXServer.jar") github("lax1dude", "eaglerxserver", "v" + EAGXS_VER, "EaglerXServer.jar")

View File

@@ -97,9 +97,6 @@ public final class OriginBlacklist {
if (this.isMetricsEnabled()) { if (this.isMetricsEnabled()) {
this.metrics.start(); this.metrics.start();
} }
this.plugin.scheduleRepeat(() -> {
this.plugin.log(EnumLogLevel.INFO, String.valueOf(this.isMetricsEnabled()));
}, 1, TimeUnit.SECONDS);
} }
public final void shutdown() { public final void shutdown() {
@@ -271,11 +268,13 @@ public final class OriginBlacklist {
} finally { } finally {
conn.disconnect(); conn.disconnect();
} }
Files.delete(jar); if (Files.exists(upd)) {
Files.delete(bak); Files.delete(jar);
this.jarFile = upd; Files.delete(bak);
action1.run(); this.jarFile = upd;
return; action1.run();
return;
}
} catch (final Throwable t) { } catch (final Throwable t) {
Files.move(bak, jar, StandardCopyOption.REPLACE_EXISTING); Files.move(bak, jar, StandardCopyOption.REPLACE_EXISTING);
throw t; throw t;

View File

@@ -326,7 +326,7 @@ public final class OriginBlacklistConfig {
addJSONObj(uObj, "enabled", Json5Primitive.fromBoolean(true), null); addJSONObj(uObj, "enabled", Json5Primitive.fromBoolean(true), null);
addJSONObj(uObj, "allow_snapshots", Json5Primitive.fromBoolean(false), null); addJSONObj(uObj, "allow_snapshots", Json5Primitive.fromBoolean(false), null);
addJSONObj(uObj, "check_timer", Json5Primitive.fromNumber(3600), null); addJSONObj(uObj, "check_timer", Json5Primitive.fromNumber(3600), null);
addJSONObj(uObj, "auto_update", Json5Primitive.fromBoolean(true), null); addJSONObj(uObj, "auto_update", Json5Primitive.fromBoolean(false), null);
addJSONObj(obj, "update_checker", uObj, null); addJSONObj(obj, "update_checker", uObj, null);
addJSONObj(obj, "blacklist_http_api", Json5Primitive.fromBoolean(false), null); addJSONObj(obj, "blacklist_http_api", Json5Primitive.fromBoolean(false), null);
addJSONObj(obj, "blacklist_to_whitelist", Json5Primitive.fromBoolean(false), null); addJSONObj(obj, "blacklist_to_whitelist", Json5Primitive.fromBoolean(false), null);

View File

@@ -94,8 +94,9 @@ public final class OriginBlacklistBungee extends Plugin implements Listener, IOr
final PendingConnection conn = event.getPlayer().getPendingConnection(); final PendingConnection conn = event.getPlayer().getPendingConnection();
final InetSocketAddress vhost = conn.getVirtualHost(); final InetSocketAddress vhost = conn.getVirtualHost();
final ProxiedPlayer aPlayer = event.getPlayer(); final ProxiedPlayer aPlayer = event.getPlayer();
final String origin = vhost != null ? vhost.getHostString() + vhost.getPort() : OriginBlacklist.UNKNOWN_STR;
final OPlayer bPlayer = new OPlayer(null, aPlayer.getName(), aPlayer.getUniqueId(), final OPlayer bPlayer = new OPlayer(null, aPlayer.getName(), aPlayer.getUniqueId(),
aPlayer.getAddress().toString(), aPlayer.getClientBrand(), vhost.getHostString() + vhost.getPort(), aPlayer.getAddress().toString(), aPlayer.getClientBrand(), origin,
conn.getVersion()); conn.getVersion());
this.blacklist.handleLogin(new OriginBlacklistLoginEvent(null, event, EnumConnectionType.JAVA, bPlayer)); this.blacklist.handleLogin(new OriginBlacklistLoginEvent(null, event, EnumConnectionType.JAVA, bPlayer));
} }
@@ -104,8 +105,9 @@ public final class OriginBlacklistBungee extends Plugin implements Listener, IOr
public final void onJavaHandshake(final PreLoginEvent event) { public final void onJavaHandshake(final PreLoginEvent event) {
final PendingConnection conn = event.getConnection(); final PendingConnection conn = event.getConnection();
final InetSocketAddress vhost = conn.getVirtualHost(); final InetSocketAddress vhost = conn.getVirtualHost();
final String origin = vhost != null ? vhost.getHostString() + vhost.getPort() : OriginBlacklist.UNKNOWN_STR;
final OPlayer player = new OPlayer(null, null, null, conn.getAddress().toString(), OriginBlacklist.UNKNOWN_STR, final OPlayer player = new OPlayer(null, null, null, conn.getAddress().toString(), OriginBlacklist.UNKNOWN_STR,
vhost.getHostString() + vhost.getPort(), conn.getVersion()); origin, conn.getVersion());
this.blacklist.handleLogin(new OriginBlacklistLoginEvent(null, event, EnumConnectionType.JAVA, player)); this.blacklist.handleLogin(new OriginBlacklistLoginEvent(null, event, EnumConnectionType.JAVA, player));
} }
@@ -113,8 +115,9 @@ public final class OriginBlacklistBungee extends Plugin implements Listener, IOr
public final void onJavaMOTD(final ProxyPingEvent event) { public final void onJavaMOTD(final ProxyPingEvent event) {
final PendingConnection conn = event.getConnection(); final PendingConnection conn = event.getConnection();
final InetSocketAddress vhost = conn.getVirtualHost(); final InetSocketAddress vhost = conn.getVirtualHost();
final String origin = vhost != null ? vhost.getHostString() + vhost.getPort() : OriginBlacklist.UNKNOWN_STR;
final OPlayer player = new OPlayer(null, null, null, conn.getAddress().toString(), null, final OPlayer player = new OPlayer(null, null, null, conn.getAddress().toString(), null,
vhost.getHostString() + vhost.getPort(), -1); origin, -1);
this.blacklist.handleMOTD(new OriginBlacklistMOTDEvent(null, event, EnumConnectionType.JAVA, player)); this.blacklist.handleMOTD(new OriginBlacklistMOTDEvent(null, event, EnumConnectionType.JAVA, player));
} }

View File

@@ -108,19 +108,21 @@ public final class OriginBlacklistVelocity implements IOriginBlacklistPlugin {
@Subscribe(order = PostOrder.FIRST) @Subscribe(order = PostOrder.FIRST)
public final void onJavaLogin(final PreLoginEvent event) { public final void onJavaLogin(final PreLoginEvent event) {
final InboundConnection conn = event.getConnection(); final InboundConnection conn = event.getConnection();
final InetSocketAddress vhost = conn.getVirtualHost().orElseThrow(); final InetSocketAddress vhost = conn.getVirtualHost().orElse(null);
final String origin = vhost != null ? vhost.getHostString() + vhost.getPort() : OriginBlacklist.UNKNOWN_STR;
final OPlayer player = new OPlayer(null, event.getUsername(), event.getUniqueId(), final OPlayer player = new OPlayer(null, event.getUsername(), event.getUniqueId(),
conn.getRemoteAddress().toString(), OriginBlacklist.UNKNOWN_STR, vhost.getHostString() + vhost.getPort(), conn.getRemoteAddress().toString(), OriginBlacklist.UNKNOWN_STR, origin,
conn.getProtocolVersion().getProtocol()); conn.getProtocolVersion().getProtocol());
this.blacklist.handleLogin(new OriginBlacklistLoginEvent(null, event, EnumConnectionType.JAVA, player)); this.blacklist.handleLogin(new OriginBlacklistLoginEvent(null, event, EnumConnectionType.JAVA, player));
} }
@Subscribe(order = PostOrder.FIRST) @Subscribe(order = PostOrder.FIRST)
public final void onJavaHandshake(final PlayerClientBrandEvent event) { public final void onJavaHandshake(final PlayerClientBrandEvent event) {
final InetSocketAddress vhost = event.getPlayer().getVirtualHost().orElseThrow(); final InetSocketAddress vhost = event.getPlayer().getVirtualHost().orElse(null);
final String origin = vhost != null ? vhost.getHostString() + vhost.getPort() : OriginBlacklist.UNKNOWN_STR;
final Player aPlayer = event.getPlayer(); final Player aPlayer = event.getPlayer();
final OPlayer bPlayer = new OPlayer(null, aPlayer.getUsername(), aPlayer.getUniqueId(), final OPlayer bPlayer = new OPlayer(null, aPlayer.getUsername(), aPlayer.getUniqueId(),
aPlayer.getRemoteAddress().getAddress().toString(), event.getBrand(), vhost.getHostString() + vhost.getPort(), aPlayer.getRemoteAddress().getAddress().toString(), event.getBrand(), origin,
event.getPlayer().getProtocolVersion().getProtocol()); event.getPlayer().getProtocolVersion().getProtocol());
this.blacklist.handleLogin(new OriginBlacklistLoginEvent(null, event, EnumConnectionType.JAVA, bPlayer)); this.blacklist.handleLogin(new OriginBlacklistLoginEvent(null, event, EnumConnectionType.JAVA, bPlayer));
} }
@@ -128,10 +130,10 @@ public final class OriginBlacklistVelocity implements IOriginBlacklistPlugin {
@Subscribe(order = PostOrder.LAST) @Subscribe(order = PostOrder.LAST)
public final void onJavaMOTD(final ProxyPingEvent event) { public final void onJavaMOTD(final ProxyPingEvent event) {
final InboundConnection conn = event.getConnection(); final InboundConnection conn = event.getConnection();
final InetSocketAddress vhost = conn.getVirtualHost().orElseThrow(); final InetSocketAddress vhost = conn.getVirtualHost().orElse(null);
final String origin = vhost != null ? vhost.getHostString() + vhost.getPort() : OriginBlacklist.UNKNOWN_STR;
final OPlayer player = new OPlayer(null, null, null, conn.getRemoteAddress().getHostString(), final OPlayer player = new OPlayer(null, null, null, conn.getRemoteAddress().getHostString(),
vhost.getHostString() + vhost.getPort(), null, origin, -1);
null, -1);
this.blacklist.handleMOTD(new OriginBlacklistMOTDEvent(null, event, EnumConnectionType.JAVA, player)); this.blacklist.handleMOTD(new OriginBlacklistMOTDEvent(null, event, EnumConnectionType.JAVA, player));
} }
@@ -240,7 +242,7 @@ public final class OriginBlacklistVelocity implements IOriginBlacklistPlugin {
@Override @Override
public final void shutdown() { public final void shutdown() {
for (ScheduledTask task : this.proxy.getScheduler().tasksByPlugin(this.plugin)) { for (final ScheduledTask task : this.proxy.getScheduler().tasksByPlugin(this.plugin)) {
task.cancel(); task.cancel();
} }
} }