mirror of
https://github.com/colbster937/originblacklist.git
synced 2026-03-22 21:37:42 +00:00
Compare commits
3 Commits
f4261e0d6c
...
v2.0.9+745
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
745622fa36 | ||
|
|
e7343b557d | ||
|
|
47d451362b |
@@ -111,12 +111,12 @@ val BUILD_PROPS = mapOf(
|
||||
"git_cm_hash" to GIT_INFO.gitHashFull,
|
||||
)
|
||||
|
||||
tasks.withType<JavaCompile>().configureEach {
|
||||
tasks.named<JavaCompile>("compileJava") {
|
||||
options.encoding = "UTF-8"
|
||||
options.release.set(21)
|
||||
}
|
||||
|
||||
tasks.withType<ProcessResources>().configureEach {
|
||||
tasks.named<ProcessResources>("processResources") {
|
||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||
outputs.upToDateWhen { false }
|
||||
|
||||
@@ -139,11 +139,12 @@ tasks.withType<ProcessResources>().configureEach {
|
||||
inputs.files(tasks.named<JavaCompile>("compileJava").map { it.outputs.files })
|
||||
}
|
||||
|
||||
tasks.withType<Jar>().configureEach {
|
||||
if (this !is ShadowJar) enabled = false
|
||||
tasks.named<Jar>("jar") {
|
||||
enabled = false
|
||||
}
|
||||
|
||||
tasks.withType<ShadowJar>().configureEach {
|
||||
tasks.named<ShadowJar>("shadowJar") {
|
||||
enabled = true
|
||||
doFirst {
|
||||
delete(layout.buildDirectory.dir("libs"))
|
||||
mkdir(layout.buildDirectory.dir("libs"))
|
||||
@@ -168,7 +169,7 @@ tasks.register("printVars") {
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType<RunServer>().configureEach {
|
||||
tasks.named<RunServer>("runServer") {
|
||||
minecraftVersion("1.12.2")
|
||||
runDirectory.set(layout.projectDirectory.dir("run/paper"))
|
||||
jvmArgs("-Dcom.mojang.eula.agree=true")
|
||||
@@ -178,7 +179,7 @@ tasks.withType<RunServer>().configureEach {
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType<RunWaterfall>().configureEach {
|
||||
tasks.named<RunWaterfall>("runWaterfall") {
|
||||
waterfallVersion("1.21")
|
||||
runDirectory.set(layout.projectDirectory.dir("run/waterfall"))
|
||||
downloadPlugins {
|
||||
@@ -186,8 +187,8 @@ tasks.withType<RunWaterfall>().configureEach {
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType<RunVelocity>().configureEach {
|
||||
velocityVersion("3.4.0-SNAPSHOT")
|
||||
tasks.named<RunVelocity>("runVelocity") {
|
||||
velocityVersion("3.5.0-SNAPSHOT")
|
||||
runDirectory.set(layout.projectDirectory.dir("run/velocity"))
|
||||
downloadPlugins {
|
||||
github("lax1dude", "eaglerxserver", "v" + EAGXS_VER, "EaglerXServer.jar")
|
||||
|
||||
@@ -94,8 +94,9 @@ public final class OriginBlacklistBungee extends Plugin implements Listener, IOr
|
||||
final PendingConnection conn = event.getPlayer().getPendingConnection();
|
||||
final InetSocketAddress vhost = conn.getVirtualHost();
|
||||
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(),
|
||||
aPlayer.getAddress().toString(), aPlayer.getClientBrand(), vhost.getHostString() + vhost.getPort(),
|
||||
aPlayer.getAddress().toString(), aPlayer.getClientBrand(), origin,
|
||||
conn.getVersion());
|
||||
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) {
|
||||
final PendingConnection conn = event.getConnection();
|
||||
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,
|
||||
vhost.getHostString() + vhost.getPort(), conn.getVersion());
|
||||
origin, conn.getVersion());
|
||||
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) {
|
||||
final PendingConnection conn = event.getConnection();
|
||||
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,
|
||||
vhost.getHostString() + vhost.getPort(), -1);
|
||||
origin, -1);
|
||||
this.blacklist.handleMOTD(new OriginBlacklistMOTDEvent(null, event, EnumConnectionType.JAVA, player));
|
||||
}
|
||||
|
||||
|
||||
@@ -108,19 +108,21 @@ public final class OriginBlacklistVelocity implements IOriginBlacklistPlugin {
|
||||
@Subscribe(order = PostOrder.FIRST)
|
||||
public final void onJavaLogin(final PreLoginEvent event) {
|
||||
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(),
|
||||
conn.getRemoteAddress().toString(), OriginBlacklist.UNKNOWN_STR, vhost.getHostString() + vhost.getPort(),
|
||||
conn.getRemoteAddress().toString(), OriginBlacklist.UNKNOWN_STR, origin,
|
||||
conn.getProtocolVersion().getProtocol());
|
||||
this.blacklist.handleLogin(new OriginBlacklistLoginEvent(null, event, EnumConnectionType.JAVA, player));
|
||||
}
|
||||
|
||||
@Subscribe(order = PostOrder.FIRST)
|
||||
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 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());
|
||||
this.blacklist.handleLogin(new OriginBlacklistLoginEvent(null, event, EnumConnectionType.JAVA, bPlayer));
|
||||
}
|
||||
@@ -128,10 +130,10 @@ public final class OriginBlacklistVelocity implements IOriginBlacklistPlugin {
|
||||
@Subscribe(order = PostOrder.LAST)
|
||||
public final void onJavaMOTD(final ProxyPingEvent event) {
|
||||
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(),
|
||||
vhost.getHostString() + vhost.getPort(),
|
||||
null, -1);
|
||||
null, origin, -1);
|
||||
this.blacklist.handleMOTD(new OriginBlacklistMOTDEvent(null, event, EnumConnectionType.JAVA, player));
|
||||
}
|
||||
|
||||
@@ -240,7 +242,7 @@ public final class OriginBlacklistVelocity implements IOriginBlacklistPlugin {
|
||||
|
||||
@Override
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user