fix ipv6 bug

This commit is contained in:
Colbster937
2026-01-11 00:02:23 -06:00
parent 9985223d22
commit 2699ceaeff
30 changed files with 65 additions and 16 deletions

BIN
bin/main/blacklisted.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

10
bin/main/bungee.yml Normal file
View File

@@ -0,0 +1,10 @@
name: ${plugin_name}
version: ${plugin_vers}
main: xyz.webmc.${plugin_iden}.bungee.${plugin_name}Bungee
description: ${plugin_desc}
website: ${plugin_site}
author: [${plugin_athr}]
contributors: [${plugin_ctbr}]
depends: [${plugin_depb}]
provides: [${plugin_prov}]
softdepend: [${plugin_sdpb}]

12
bin/main/plugin.yml Normal file
View File

@@ -0,0 +1,12 @@
name: ${plugin_name}
version: ${plugin_vers}
main: xyz.webmc.${plugin_iden}.bukkit.${plugin_name}Bukkit
description: ${plugin_desc}
website: ${plugin_site}
authors: [${plugin_athr}]
contributors: [${plugin_ctbr}]
depend: [${plugin_depa}]
provides: [${plugin_prov}]
softdepend: [${plugin_sdpa}]
commands:
originblacklist:

View File

@@ -0,0 +1,10 @@
{
"id": "${plugin_iden}",
"name": "${plugin_name}",
"version": "${plugin_vers}",
"description": "${plugin_desc}",
"website": "${plugin_site}",
"main": "xyz.webmc.${plugin_iden}.velocity.${plugin_name}Velocity",
"authors": [${plugin_athr}],
"dependencies": [${plugin_depc}]
}

View File

@@ -78,6 +78,9 @@ public final class OPlayer {
} }
private static final String formatIPAddress(String addr) { private static final String formatIPAddress(String addr) {
if (addr == null) {
addr = OriginBlacklist.UNKNOWN_STR;
} else {
if (addr.startsWith("/")) { if (addr.startsWith("/")) {
addr = addr.substring(1); addr = addr.substring(1);
} }
@@ -89,14 +92,28 @@ public final class OPlayer {
if (addr.startsWith("[")) { if (addr.startsWith("[")) {
i = addr.indexOf(']'); i = addr.indexOf(']');
if (i != -1) if (i != -1) {
return addr.substring(1, i); addr = addr.substring(1, i);
return addr.substring(1); } else {
addr = addr.substring(1);
} }
} else {
i = addr.lastIndexOf(':'); i = addr.lastIndexOf(':');
if (i != -1) { if (i != -1) {
addr = addr.substring(0, i); String a = addr.substring(0, i);
String p = addr.substring(i + 1);
boolean port = !p.isEmpty();
for (int j = 0; j < p.length() && port; j++) {
char c = p.charAt(j);
port = (c >= '0' && c <= '9');
}
if (port && a.indexOf('.') != -1) {
addr = a;
}
}
}
} }
return addr; return addr;