mirror of
https://github.com/colbster937/originblacklist.git
synced 2026-02-04 11:07:41 +00:00
Compare commits
7 Commits
v1.1.2
...
eab1eb27e7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eab1eb27e7 | ||
|
|
0b6e9e1b83 | ||
|
|
07fa4bc21c | ||
|
|
b10882c65f | ||
|
|
ee4b14bf30 | ||
|
|
c913d9d34e | ||
|
|
bfed49407f |
4
.github/workflows/build.yml
vendored
4
.github/workflows/build.yml
vendored
@@ -28,7 +28,7 @@ jobs:
|
|||||||
- name: Build Jar
|
- name: Build Jar
|
||||||
run: |
|
run: |
|
||||||
gradle wrapper
|
gradle wrapper
|
||||||
./gradlew shadowJar
|
./gradlew clean shadowJar
|
||||||
|
|
||||||
- name: Publish Jar
|
- name: Publish Jar
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
@@ -39,7 +39,7 @@ jobs:
|
|||||||
- name: Extract Version
|
- name: Extract Version
|
||||||
id: version
|
id: version
|
||||||
run: |
|
run: |
|
||||||
VERSION=$(grep "^version" build.gradle | head -n 1 | cut -d\' -f2)
|
VERSION="$(./gradlew -q properties | sed -n 's/^version: //p' | head -n 1)"
|
||||||
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
|
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
- name: Remove Existing Release
|
- name: Remove Existing Release
|
||||||
|
|||||||
86
build.gradle
86
build.gradle
@@ -1,86 +0,0 @@
|
|||||||
plugins {
|
|
||||||
id 'java'
|
|
||||||
id 'eclipse'
|
|
||||||
id 'org.jetbrains.gradle.plugin.idea-ext' version '1.1.8'
|
|
||||||
id 'com.github.johnrengelman.shadow' version '8.1.1'
|
|
||||||
id("xyz.jpenilla.run-velocity") version "2.3.1"
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
group = 'dev.colbster937'
|
|
||||||
version = '1.1.2'
|
|
||||||
description = 'A reimplementation of OriginBlacklist for EaglerXServer'
|
|
||||||
def targetJavaVersion = 17
|
|
||||||
|
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
maven {
|
|
||||||
name = "papermc-repo"
|
|
||||||
url = "https://repo.papermc.io/repository/maven-public/"
|
|
||||||
}
|
|
||||||
maven {
|
|
||||||
name = "sonatype"
|
|
||||||
url = "https://oss.sonatype.org/content/groups/public/"
|
|
||||||
}
|
|
||||||
maven {
|
|
||||||
name = "spigotmc-repo"
|
|
||||||
url = "https://hub.spigotmc.org/nexus/content/repositories/public/"
|
|
||||||
}
|
|
||||||
maven {
|
|
||||||
name = "md_5"
|
|
||||||
url = "https://repo.md-5.net/content/repositories/releases/"
|
|
||||||
}
|
|
||||||
maven {
|
|
||||||
name = "aikar"
|
|
||||||
url = "https://repo.aikar.co/nexus/content/groups/aikar/"
|
|
||||||
}
|
|
||||||
maven {
|
|
||||||
name = "lax1dude"
|
|
||||||
url = "https://repo.lax1dude.net/repository/releases/"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
compileOnly("com.velocitypowered:velocity-api:3.3.0-SNAPSHOT")
|
|
||||||
annotationProcessor("com.velocitypowered:velocity-api:3.3.0-SNAPSHOT")
|
|
||||||
compileOnly("org.bukkit:bukkit:1.8-R0.1-SNAPSHOT")
|
|
||||||
compileOnly("net.md-5:bungeecord-api:1.8-SNAPSHOT")
|
|
||||||
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-bukkit:1.0.0")
|
|
||||||
implementation("org.yaml:snakeyaml:2.2")
|
|
||||||
implementation("net.kyori:adventure-text-serializer-legacy:4.20.0")
|
|
||||||
implementation("net.kyori:adventure-text-minimessage:4.20.0")
|
|
||||||
implementation("com.github.seancfoley:ipaddress:5.3.4")
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks {
|
|
||||||
runVelocity {
|
|
||||||
velocityVersion("3.3.0-SNAPSHOT")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
java {
|
|
||||||
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
|
|
||||||
}
|
|
||||||
|
|
||||||
processResources {
|
|
||||||
filesMatching(['plugin.yml', 'bungee.yml', 'velocity-plugin.json', 'Base.java']) {
|
|
||||||
expand(
|
|
||||||
version: project.version,
|
|
||||||
description: project.description
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
shadowJar {
|
|
||||||
relocate 'org.yaml.snakeyaml', 'dev.colbster937.shaded.snakeyaml'
|
|
||||||
relocate 'inet.ipaddr', 'dev.colbster937.shaded.ipaddr'
|
|
||||||
archiveVersion.set('')
|
|
||||||
archiveClassifier.set('')
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.withType(JavaCompile).configureEach {
|
|
||||||
options.encoding = 'UTF-8'
|
|
||||||
options.release.set(targetJavaVersion)
|
|
||||||
}
|
|
||||||
70
build.gradle.kts
Normal file
70
build.gradle.kts
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
plugins {
|
||||||
|
id("java")
|
||||||
|
id("eclipse")
|
||||||
|
id("org.jetbrains.gradle.plugin.idea-ext") version "1.1.8"
|
||||||
|
id("com.gradleup.shadow") version "9.3.0"
|
||||||
|
id("xyz.jpenilla.run-velocity") version "2.3.1"
|
||||||
|
}
|
||||||
|
|
||||||
|
group = "dev.colbster937"
|
||||||
|
version = "1.1.3"
|
||||||
|
description = "A reimplementation of OriginBlacklist for EaglerXServer"
|
||||||
|
|
||||||
|
val targetJavaVersion = 17
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
maven("https://repo.papermc.io/repository/maven-public/")
|
||||||
|
maven("https://oss.sonatype.org/content/groups/public/")
|
||||||
|
maven("https://hub.spigotmc.org/nexus/content/repositories/public/")
|
||||||
|
maven("https://repo.md-5.net/content/repositories/releases/")
|
||||||
|
maven("https://repo.aikar.co/nexus/content/groups/aikar/")
|
||||||
|
maven("https://repo.lax1dude.net/repository/releases/")
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
compileOnly("com.velocitypowered:velocity-api:3.4.0-SNAPSHOT")
|
||||||
|
compileOnly("org.bukkit:bukkit:1.8-R0.1-SNAPSHOT")
|
||||||
|
compileOnly("net.md-5:bungeecord-api:1.8-SNAPSHOT")
|
||||||
|
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-bukkit:1.0.0")
|
||||||
|
implementation("org.yaml:snakeyaml:2.2")
|
||||||
|
implementation("net.kyori:adventure-text-serializer-legacy:4.20.0")
|
||||||
|
implementation("net.kyori:adventure-text-minimessage:4.20.0")
|
||||||
|
implementation("com.github.seancfoley:ipaddress:5.3.4")
|
||||||
|
annotationProcessor("com.velocitypowered:velocity-api:3.4.0-SNAPSHOT")
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks {
|
||||||
|
named<xyz.jpenilla.runvelocity.task.RunVelocity>("runVelocity") {
|
||||||
|
velocityVersion("3.4.0-SNAPSHOT")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
java {
|
||||||
|
toolchain.languageVersion.set(JavaLanguageVersion.of(targetJavaVersion))
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.processResources {
|
||||||
|
filesMatching(listOf("plugin.yml", "bungee.yml", "velocity-plugin.json", "Base.java")) {
|
||||||
|
expand(
|
||||||
|
mapOf(
|
||||||
|
"version" to project.version,
|
||||||
|
"description" to project.description
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.shadowJar {
|
||||||
|
relocate("org.yaml.snakeyaml", "dev.colbster937.shaded.snakeyaml")
|
||||||
|
relocate("inet.ipaddr", "dev.colbster937.shaded.ipaddr")
|
||||||
|
archiveVersion.set("")
|
||||||
|
archiveClassifier.set("")
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.withType<JavaCompile>().configureEach {
|
||||||
|
options.encoding = "UTF-8"
|
||||||
|
options.release.set(targetJavaVersion)
|
||||||
|
}
|
||||||
@@ -1 +0,0 @@
|
|||||||
rootProject.name = 'OriginBlacklist'
|
|
||||||
@@ -209,6 +209,8 @@ public class Base {
|
|||||||
getLogger().error(ex.toString());
|
getLogger().error(ex.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
conn.sendToUser();
|
||||||
|
conn.disconnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean matches(String text1, String text2) {
|
public static boolean matches(String text1, String text2) {
|
||||||
|
|||||||
@@ -22,6 +22,9 @@ public class IPBlacklist {
|
|||||||
if (addr.startsWith("/")) {
|
if (addr.startsWith("/")) {
|
||||||
addr1 = addr.substring(1);
|
addr1 = addr.substring(1);
|
||||||
}
|
}
|
||||||
|
if (addr1.startsWith("[") && addr1.endsWith("]")) {
|
||||||
|
addr1 = addr1.substring(1, addr1.length() - 1);
|
||||||
|
}
|
||||||
ip = new IPAddressString(addr1).toAddress();
|
ip = new IPAddressString(addr1).toAddress();
|
||||||
} catch (AddressStringException e) {
|
} catch (AddressStringException e) {
|
||||||
throw new RuntimeException("Invalid IP address: " + addr, e);
|
throw new RuntimeException("Invalid IP address: " + addr, e);
|
||||||
|
|||||||
@@ -5,8 +5,9 @@ import net.lax1dude.eaglercraft.backend.server.api.bukkit.EaglerXServerAPI;
|
|||||||
import net.lax1dude.eaglercraft.backend.server.api.bukkit.event.EaglercraftLoginEvent;
|
import net.lax1dude.eaglercraft.backend.server.api.bukkit.event.EaglercraftLoginEvent;
|
||||||
import net.lax1dude.eaglercraft.backend.server.api.bukkit.event.EaglercraftMOTDEvent;
|
import net.lax1dude.eaglercraft.backend.server.api.bukkit.event.EaglercraftMOTDEvent;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.player.AsyncPlayerPreLoginEvent;
|
import org.bukkit.plugin.Plugin;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
|
|
||||||
@@ -47,7 +48,7 @@ public class OriginBlacklistBukkit extends JavaPlugin implements Listener {
|
|||||||
Base.handleConnection(event);
|
Base.handleConnection(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler(priority = EventPriority.MONITOR)
|
||||||
public void onMOTD(EaglercraftMOTDEvent event) {
|
public void onMOTD(EaglercraftMOTDEvent event) {
|
||||||
Base.handleMOTD(event);
|
Base.handleMOTD(event);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import net.md_5.bungee.api.event.PreLoginEvent;
|
|||||||
import net.md_5.bungee.api.plugin.Plugin;
|
import net.md_5.bungee.api.plugin.Plugin;
|
||||||
import net.md_5.bungee.api.plugin.Listener;
|
import net.md_5.bungee.api.plugin.Listener;
|
||||||
import net.md_5.bungee.event.EventHandler;
|
import net.md_5.bungee.event.EventHandler;
|
||||||
|
import net.md_5.bungee.event.EventPriority;
|
||||||
|
|
||||||
public class OriginBlacklistBungee extends Plugin implements Listener {
|
public class OriginBlacklistBungee extends Plugin implements Listener {
|
||||||
|
|
||||||
@@ -46,7 +47,7 @@ public class OriginBlacklistBungee extends Plugin implements Listener {
|
|||||||
Base.handleConnection(event);
|
Base.handleConnection(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler(priority = EventPriority.HIGHEST)
|
||||||
public void onMOTD(EaglercraftMOTDEvent event) {
|
public void onMOTD(EaglercraftMOTDEvent event) {
|
||||||
Base.handleMOTD(event);
|
Base.handleMOTD(event);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package dev.colbster937.originblacklist.velocity;
|
package dev.colbster937.originblacklist.velocity;
|
||||||
|
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
|
import com.velocitypowered.api.event.PostOrder;
|
||||||
import com.velocitypowered.api.event.connection.PreLoginEvent;
|
import com.velocitypowered.api.event.connection.PreLoginEvent;
|
||||||
import com.velocitypowered.api.event.proxy.ProxyInitializeEvent;
|
import com.velocitypowered.api.event.proxy.ProxyInitializeEvent;
|
||||||
import com.velocitypowered.api.event.Subscribe;
|
import com.velocitypowered.api.event.Subscribe;
|
||||||
@@ -51,7 +52,7 @@ public class OriginBlacklistVelocity {
|
|||||||
Base.handleConnection(event);
|
Base.handleConnection(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe(order = PostOrder.LAST)
|
||||||
public void onMOTD(EaglercraftMOTDEvent event) {
|
public void onMOTD(EaglercraftMOTDEvent event) {
|
||||||
Base.handleMOTD(event);
|
Base.handleMOTD(event);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user