mirror of
https://github.com/colbster937/originblacklist.git
synced 2026-02-04 11:07:41 +00:00
Compare commits
5 Commits
v2.0.2+50e
...
ffdbcfa3b4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ffdbcfa3b4 | ||
|
|
58123dddd7 | ||
|
|
91adbd5526 | ||
|
|
2b1ccd018d | ||
|
|
8f1fd3f1f4 |
13
.github/workflows/gradle.yml
vendored
13
.github/workflows/gradle.yml
vendored
@@ -58,22 +58,23 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo "TAG_NAME=${{ format('v{0}{1}', steps.vars.outputs.VERS, steps.ghck.outputs.EXISTS == 'true' && format('+{0}', steps.vars.outputs.COMMIT_HASH) || '') }}" >> "$GITHUB_OUTPUT"
|
echo "TAG_NAME=${{ format('v{0}{1}', steps.vars.outputs.VERS, steps.ghck.outputs.EXISTS == 'true' && format('+{0}', steps.vars.outputs.COMMIT_HASH) || '') }}" >> "$GITHUB_OUTPUT"
|
||||||
echo "REL_NAME=${{ format('{0}{1}', steps.ghck.outputs.EXISTS == 'true' && 'Snapshot ' || 'v', steps.ghck.outputs.EXISTS == 'true' && steps.vars.outputs.COMMIT_HASH || steps.vars.outputs.VERS) }}" >> "$GITHUB_OUTPUT"
|
echo "REL_NAME=${{ format('{0}{1}', steps.ghck.outputs.EXISTS == 'true' && 'Snapshot ' || 'v', steps.ghck.outputs.EXISTS == 'true' && steps.vars.outputs.COMMIT_HASH || steps.vars.outputs.VERS) }}" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "ART_NAME=${{ format('{0}{1}.jar', steps.vars.outputs.AFCT, steps.ghck.outputs.EXISTS == 'true' && format('+{0}', steps.vars.outputs.COMMIT_HASH) || '') }}" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
- run: |
|
- run: |
|
||||||
mkdir -p dist
|
mkdir -p dist
|
||||||
cp "./build/libs/${{ steps.vars.outputs.AFCT }}" ./dist
|
cp "./build/libs/${{ steps.vars.outputs.AFCT }}.jar" ./dist/${{ steps.dist.outputs.ART_NAME }}
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
path: dist/${{ steps.vars.outputs.AFCT }}
|
path: dist/${{ steps.dist.outputs.ART_NAME }}
|
||||||
name: ${{ steps.vars.outputs.AFCT }}
|
name: ${{ steps.dist.outputs.ART_NAME }}
|
||||||
|
|
||||||
- if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
- if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
tag_name: ${{ steps.dist.outputs.TAG_NAME }}
|
tag_name: ${{ steps.dist.outputs.TAG_NAME }}
|
||||||
name: ${{ steps.dist.outputs.REL_NAME }}
|
name: ${{ steps.dist.outputs.REL_NAME }}
|
||||||
files: dist/${{ steps.vars.outputs.AFCT }}
|
files: dist/${{ steps.dist.outputs.ART_NAME }}
|
||||||
prerelease: ${{ steps.ghck.outputs.EXISTS == 'true' }}
|
prerelease: ${{ steps.ghck.outputs.EXISTS == 'true' }}
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
@@ -86,8 +87,8 @@ jobs:
|
|||||||
version: ${{ steps.dist.outputs.TAG_NAME }}
|
version: ${{ steps.dist.outputs.TAG_NAME }}
|
||||||
loaders: '["bukkit", "bungeecord", "paper", "purpur", "spigot", "velocity", "waterfall"]'
|
loaders: '["bukkit", "bungeecord", "paper", "purpur", "spigot", "velocity", "waterfall"]'
|
||||||
game-versions: '["1.8.x", "1.9.x", "1.10.x", "1.11.x", "1.12.x", "1.13.x", "1.14.x", "1.15.x", "1.16.x", "1.17.x", "1.18.x", "1.19.x", "1.20.x", "1.21.x"]'
|
game-versions: '["1.8.x", "1.9.x", "1.10.x", "1.11.x", "1.12.x", "1.13.x", "1.14.x", "1.15.x", "1.16.x", "1.17.x", "1.18.x", "1.19.x", "1.20.x", "1.21.x"]'
|
||||||
files: dist/${{ steps.vars.outputs.AFCT }}
|
files: dist/${{ steps.dist.outputs.ART_NAME }}
|
||||||
primary-file: ${{ steps.vars.outputs.AFCT }}
|
primary-file: ${{ steps.dist.outputs.ART_NAME }}
|
||||||
name: ${{ steps.dist.outputs.REL_NAME }}
|
name: ${{ steps.dist.outputs.REL_NAME }}
|
||||||
channel: ${{ steps.ghck.outputs.EXISTS == 'true' && 'beta' || 'release' }}
|
channel: ${{ steps.ghck.outputs.EXISTS == 'true' && 'beta' || 'release' }}
|
||||||
dependencies: |-
|
dependencies: |-
|
||||||
|
|||||||
@@ -9,8 +9,6 @@
|
|||||||
- [x] Client brand based blacklisting
|
- [x] Client brand based blacklisting
|
||||||
- [x] Username based blacklisting
|
- [x] Username based blacklisting
|
||||||
- [x] IP based blacklisting
|
- [x] IP based blacklisting
|
||||||
- [x] Modular multi-platform support
|
|
||||||
- [x] JSON5 based configuration
|
|
||||||
- [x] Kick message customization
|
- [x] Kick message customization
|
||||||
- [x] Blacklist MOTD customization
|
- [x] Blacklist MOTD customization
|
||||||
- [x] MiniMessage and legacy formattings supported
|
- [x] MiniMessage and legacy formattings supported
|
||||||
@@ -20,6 +18,11 @@
|
|||||||
- [ ] Subscribe to an auto-updating blacklist
|
- [ ] Subscribe to an auto-updating blacklist
|
||||||
- [ ] Reverse blacklist (whitelist)
|
- [ ] Reverse blacklist (whitelist)
|
||||||
|
|
||||||
|
<h2>Changes from v1</h2>
|
||||||
|
|
||||||
|
- [x] Modular multi-platform support
|
||||||
|
- [x] JSON5 based configuration
|
||||||
|
|
||||||
<h2>Download</h2>
|
<h2>Download</h2>
|
||||||
The latest release can be found at <b><a href="https://github.com/WebMCDevelopment/originblacklist/releases/latest/">https://github.com/WebMCDevelopment/originblacklist/releases/latest/</a></b>
|
The latest release can be found at <b><a href="https://github.com/WebMCDevelopment/originblacklist/releases/latest/">https://github.com/WebMCDevelopment/originblacklist/releases/latest/</a></b>
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import groovy.lang.Closure
|
||||||
|
import com.palantir.gradle.gitversion.VersionDetails
|
||||||
import org.gradle.api.tasks.compile.JavaCompile
|
import org.gradle.api.tasks.compile.JavaCompile
|
||||||
import org.gradle.language.jvm.tasks.ProcessResources
|
import org.gradle.language.jvm.tasks.ProcessResources
|
||||||
import xyz.jpenilla.runpaper.task.RunServer
|
import xyz.jpenilla.runpaper.task.RunServer
|
||||||
@@ -11,7 +13,7 @@ val PLUGIN_NAME = "OriginBlacklist"
|
|||||||
val PLUGIN_IDEN = "originblacklist"
|
val PLUGIN_IDEN = "originblacklist"
|
||||||
val PLUGIN_DOMN = "xyz.webmc"
|
val PLUGIN_DOMN = "xyz.webmc"
|
||||||
val PLUGIN_DESC = "An eaglercraft client blacklist plugin."
|
val PLUGIN_DESC = "An eaglercraft client blacklist plugin."
|
||||||
val PLUGIN_VERS = "2.0.2"
|
val PLUGIN_VERS = "2.0.4"
|
||||||
val PLUGIN_SITE = "https://github.com/WebMCDevelopment/$PLUGIN_IDEN"
|
val PLUGIN_SITE = "https://github.com/WebMCDevelopment/$PLUGIN_IDEN"
|
||||||
val PLUGIN_DEPA = listOf("EaglercraftXServer")
|
val PLUGIN_DEPA = listOf("EaglercraftXServer")
|
||||||
val PLUGIN_DEPB = listOf("EaglercraftXServer")
|
val PLUGIN_DEPB = listOf("EaglercraftXServer")
|
||||||
@@ -26,23 +28,27 @@ val PLUGIN_CTBR = emptyList<String>()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
val PLUGIN_DEPA_J = getJSONObj(PLUGIN_DEPA)
|
val PLUGIN_DEPA_J = getBukkitBungeeDeps(PLUGIN_DEPA)
|
||||||
val PLUGIN_DEPB_J = getJSONObj(PLUGIN_DEPB)
|
val PLUGIN_DEPB_J = getBukkitBungeeDeps(PLUGIN_DEPB)
|
||||||
val PLUGIN_DEPC_J = getJSONObjMerge(PLUGIN_DEPC, PLUGIN_SDPC)
|
val PLUGIN_DEPC_J = getVelocityDeps(PLUGIN_DEPC, PLUGIN_SDPC)
|
||||||
val PLUGIN_SDPA_J = getJSONObj(PLUGIN_SDPA)
|
val PLUGIN_SDPA_J = getBukkitBungeeDeps(PLUGIN_SDPA)
|
||||||
val PLUGIN_SDPB_J = getJSONObj(PLUGIN_SDPB)
|
val PLUGIN_SDPB_J = getBukkitBungeeDeps(PLUGIN_SDPB)
|
||||||
val PLUGIN_PROV_J = getJSONObj(PLUGIN_PROV)
|
val PLUGIN_PROV_J = getBukkitBungeeDeps(PLUGIN_PROV)
|
||||||
val PLUGIN_ATHR_J = getJSONObj(PLUGIN_ATHR)
|
val PLUGIN_ATHR_J = getBukkitBungeeDeps(PLUGIN_ATHR)
|
||||||
val PLUGIN_CTBR_J = getJSONObj(PLUGIN_CTBR)
|
val PLUGIN_CTBR_J = getBukkitBungeeDeps(PLUGIN_CTBR)
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("java")
|
id("java")
|
||||||
id("com.gradleup.shadow") version "9.3.0"
|
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-paper") version "3.0.2"
|
||||||
id("xyz.jpenilla.run-waterfall") version "3.0.2"
|
id("xyz.jpenilla.run-waterfall") version "3.0.2"
|
||||||
id("xyz.jpenilla.run-velocity") version "3.0.2"
|
id("xyz.jpenilla.run-velocity") version "3.0.2"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Suppress("UNCHECKED_CAST")
|
||||||
|
val GIT_INFO = (extra["versionDetails"] as Closure<VersionDetails>)()
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
maven("https://repo.papermc.io/repository/maven-public/")
|
maven("https://repo.papermc.io/repository/maven-public/")
|
||||||
@@ -85,17 +91,7 @@ java {
|
|||||||
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
|
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType<JavaCompile>().configureEach {
|
val BUILD_PROPS = mapOf(
|
||||||
options.encoding = "UTF-8"
|
|
||||||
options.release.set(17)
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.withType<ProcessResources>() {
|
|
||||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
|
||||||
outputs.upToDateWhen { false }
|
|
||||||
doFirst {
|
|
||||||
filesMatching(listOf("plugin.yml", "bungee.yml", "velocity-plugin.json")) {
|
|
||||||
expand(mapOf(
|
|
||||||
"plugin_name" to PLUGIN_NAME,
|
"plugin_name" to PLUGIN_NAME,
|
||||||
"plugin_iden" to PLUGIN_IDEN,
|
"plugin_iden" to PLUGIN_IDEN,
|
||||||
"plugin_desc" to PLUGIN_DESC,
|
"plugin_desc" to PLUGIN_DESC,
|
||||||
@@ -109,8 +105,33 @@ tasks.withType<ProcessResources>() {
|
|||||||
"plugin_prov" to PLUGIN_PROV_J,
|
"plugin_prov" to PLUGIN_PROV_J,
|
||||||
"plugin_athr" to PLUGIN_ATHR_J,
|
"plugin_athr" to PLUGIN_ATHR_J,
|
||||||
"plugin_ctbr" to PLUGIN_CTBR_J,
|
"plugin_ctbr" to PLUGIN_CTBR_J,
|
||||||
))
|
"git_cm_hash" to GIT_INFO.gitHashFull,
|
||||||
|
)
|
||||||
|
|
||||||
|
tasks.withType<JavaCompile>().configureEach {
|
||||||
|
options.encoding = "UTF-8"
|
||||||
|
options.release.set(17)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tasks.withType<ProcessResources>() {
|
||||||
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||||
|
outputs.upToDateWhen { false }
|
||||||
|
|
||||||
|
doFirst {
|
||||||
|
filesMatching(listOf("plugin.yml", "bungee.yml", "velocity-plugin.json")) {
|
||||||
|
expand(BUILD_PROPS)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
doLast {
|
||||||
|
val file = destinationDir.resolve("build.properties")
|
||||||
|
file.parentFile.mkdirs()
|
||||||
|
|
||||||
|
file.writeText(
|
||||||
|
BUILD_PROPS.entries.joinToString("\n") { (k, v) ->
|
||||||
|
"$k = $v"
|
||||||
|
}
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
inputs.files(tasks.named<JavaCompile>("compileJava").map { it.outputs.files })
|
inputs.files(tasks.named<JavaCompile>("compileJava").map { it.outputs.files })
|
||||||
@@ -158,24 +179,19 @@ tasks.register("printVars") {
|
|||||||
group = "help"
|
group = "help"
|
||||||
doLast {
|
doLast {
|
||||||
println("VERS = " + PLUGIN_VERS)
|
println("VERS = " + PLUGIN_VERS)
|
||||||
println("AFCT = " + tasks.named("shadowJar").get().outputs.files.singleFile.name)
|
println("AFCT = " + tasks.named("shadowJar").get().outputs.files.singleFile.name.removeSuffix(".jar"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getJSONObj(list: List<String>): String {
|
fun getBukkitBungeeDeps(list: List<String>): String {
|
||||||
return if (list.isNotEmpty()) {
|
return list.joinToString(
|
||||||
list.joinToString(
|
prefix = "[",
|
||||||
separator = "\", \"",
|
postfix = "]"
|
||||||
prefix = "\"",
|
) { "\"$it\"" }
|
||||||
postfix = "\""
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
""
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getJSONObjMerge(a: List<String>, b: List<String>): String {
|
fun getVelocityDeps(a: List<String>, b: List<String>): String {
|
||||||
val c = a.joinToString(", ") { "{\"id\":\"$it\",\"optional\":false}" }
|
val c = a.joinToString(", ") { "{\"id\":\"$it\",\"optional\":false}" }
|
||||||
val d = b.joinToString(", ") { "{\"id\":\"$it\",\"optional\":true}" }
|
val d = b.joinToString(", ") { "{\"id\":\"$it\",\"optional\":true}" }
|
||||||
return listOf(c, d).filter { it.isNotEmpty() }.joinToString(",")
|
return "[" + listOf(c, d).filter { it.isNotEmpty() }.joinToString(",") + "]"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,13 +6,21 @@ import xyz.webmc.originblacklist.base.enums.EnumConnectionType;
|
|||||||
import xyz.webmc.originblacklist.base.enums.EnumLogLevel;
|
import xyz.webmc.originblacklist.base.enums.EnumLogLevel;
|
||||||
import xyz.webmc.originblacklist.base.events.OriginBlacklistLoginEvent;
|
import xyz.webmc.originblacklist.base.events.OriginBlacklistLoginEvent;
|
||||||
import xyz.webmc.originblacklist.base.events.OriginBlacklistMOTDEvent;
|
import xyz.webmc.originblacklist.base.events.OriginBlacklistMOTDEvent;
|
||||||
|
import xyz.webmc.originblacklist.base.util.BuildInfo;
|
||||||
import xyz.webmc.originblacklist.base.util.IOriginBlacklistPlugin;
|
import xyz.webmc.originblacklist.base.util.IOriginBlacklistPlugin;
|
||||||
import xyz.webmc.originblacklist.base.util.OPlayer;
|
import xyz.webmc.originblacklist.base.util.OPlayer;
|
||||||
import xyz.webmc.originblacklist.base.util.UpdateChecker;
|
import xyz.webmc.originblacklist.base.util.UpdateChecker;
|
||||||
|
|
||||||
|
import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.net.HttpURLConnection;
|
import java.net.HttpURLConnection;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
import java.net.URLDecoder;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Path;
|
||||||
|
import java.nio.file.Paths;
|
||||||
|
import java.nio.file.StandardCopyOption;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Base64;
|
import java.util.Base64;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -40,17 +48,21 @@ public final class OriginBlacklist {
|
|||||||
|
|
||||||
private final IOriginBlacklistPlugin plugin;
|
private final IOriginBlacklistPlugin plugin;
|
||||||
private final OriginBlacklistConfig config;
|
private final OriginBlacklistConfig config;
|
||||||
private boolean updateAvailable;
|
private String updateURL;
|
||||||
|
|
||||||
public OriginBlacklist(final IOriginBlacklistPlugin plugin) {
|
public OriginBlacklist(final IOriginBlacklistPlugin plugin) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
this.config = new OriginBlacklistConfig(plugin);
|
this.config = new OriginBlacklistConfig(plugin);
|
||||||
this.checkForUpdate();
|
|
||||||
plugin.scheduleRepeat(() -> {
|
plugin.scheduleRepeat(() -> {
|
||||||
this.checkForUpdate();
|
this.checkForUpdate();
|
||||||
}, 60, TimeUnit.MINUTES);
|
}, 60, TimeUnit.MINUTES);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final void init() {
|
||||||
|
this.plugin.log(EnumLogLevel.INFO, "Initialized Plugin");
|
||||||
|
this.plugin.log(EnumLogLevel.DEBUG, "Commit " + BuildInfo.get("git_cm_hash"));
|
||||||
|
}
|
||||||
|
|
||||||
public final void handleLogin(final OriginBlacklistLoginEvent event) {
|
public final void handleLogin(final OriginBlacklistLoginEvent event) {
|
||||||
final OPlayer player = event.getPlayer();
|
final OPlayer player = event.getPlayer();
|
||||||
final EnumBlacklistType blacklisted = this.testBlacklist(player);
|
final EnumBlacklistType blacklisted = this.testBlacklist(player);
|
||||||
@@ -162,7 +174,7 @@ public final class OriginBlacklist {
|
|||||||
return EnumBlacklistType.ADDR;
|
return EnumBlacklistType.ADDR;
|
||||||
}
|
}
|
||||||
} catch (final AddressStringException exception) {
|
} catch (final AddressStringException exception) {
|
||||||
exception.printStackTrace();
|
// exception.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -240,7 +252,7 @@ public final class OriginBlacklist {
|
|||||||
player.getName().replaceAll("_", "\\_"),
|
player.getName().replaceAll("_", "\\_"),
|
||||||
player.getOrigin(),
|
player.getOrigin(),
|
||||||
player.getBrand(),
|
player.getBrand(),
|
||||||
player.getAddr(),
|
this.config.get("discord.send_ips").getAsBoolean() ? player.getAddr() : "*\\*CENSORED\\**",
|
||||||
player.getPVN(),
|
player.getPVN(),
|
||||||
userAgent,
|
userAgent,
|
||||||
player.isRewind() ? "YES" : "NO",
|
player.isRewind() ? "YES" : "NO",
|
||||||
@@ -272,7 +284,7 @@ public final class OriginBlacklist {
|
|||||||
}
|
}
|
||||||
|
|
||||||
conn.disconnect();
|
conn.disconnect();
|
||||||
} catch (Throwable t) {
|
} catch (final Throwable t) {
|
||||||
t.printStackTrace();
|
t.printStackTrace();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -282,14 +294,56 @@ public final class OriginBlacklist {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private final void checkForUpdate() {
|
private final void checkForUpdate() {
|
||||||
|
if (this.config.get("update_checker.enabled").getAsBoolean()) {
|
||||||
CompletableFuture.runAsync(() -> {
|
CompletableFuture.runAsync(() -> {
|
||||||
this.updateAvailable = UpdateChecker.checkForUpdate(PLUGIN_REPO, this.plugin.getPluginVersion(),
|
this.updateURL = UpdateChecker.checkForUpdate(PLUGIN_REPO, this.plugin.getPluginVersion(),
|
||||||
this.config.get("update_checker.allow_snapshots").getAsBoolean());
|
this.config.get("update_checker.allow_snapshots").getAsBoolean());
|
||||||
if (this.updateAvailable) {
|
if (isNonNull((this.updateURL))) {
|
||||||
this.plugin.log(EnumLogLevel.INFO, "An update is available! Download it at https://github.com/" + PLUGIN_REPO + ".git");
|
if (!this.config.get("update_checker.auto_update").getAsBoolean()) {
|
||||||
|
this.plugin.log(EnumLogLevel.INFO, "An update is available! Download it at " + this.updateURL);
|
||||||
|
} else {
|
||||||
|
this.updatePlugin();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private final void updatePlugin() {
|
||||||
|
try {
|
||||||
|
final URL url = new URL(this.updateURL);
|
||||||
|
final Path jar = this.plugin.getPluginJarPath();
|
||||||
|
final Path bak = jar.resolveSibling(jar.getFileName().toString() + ".bak");
|
||||||
|
final Path upd = jar.resolveSibling(Paths.get(URLDecoder.decode(url.getPath(), StandardCharsets.UTF_8)).getFileName());
|
||||||
|
|
||||||
|
try {
|
||||||
|
Files.copy(jar, bak, StandardCopyOption.REPLACE_EXISTING);
|
||||||
|
} catch (final Throwable t) {
|
||||||
|
t.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
final HttpURLConnection conn = (HttpURLConnection) url.openConnection();
|
||||||
|
conn.setRequestMethod("GET");
|
||||||
|
conn.setConnectTimeout(15000);
|
||||||
|
conn.setReadTimeout(15000);
|
||||||
|
conn.setRequestProperty("User-Agent", OriginBlacklist.getUserAgent());
|
||||||
|
conn.connect();
|
||||||
|
try (final InputStream in = conn.getInputStream()) {
|
||||||
|
Files.copy(in, upd, StandardCopyOption.REPLACE_EXISTING);
|
||||||
|
} finally {
|
||||||
|
conn.disconnect();
|
||||||
|
}
|
||||||
|
Files.delete(jar);
|
||||||
|
Files.delete(bak);
|
||||||
|
} catch (final Throwable t) {
|
||||||
|
t.printStackTrace();
|
||||||
|
Files.move(bak, jar, StandardCopyOption.REPLACE_EXISTING);
|
||||||
|
}
|
||||||
|
} catch (final Throwable t) {
|
||||||
|
t.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static final String getComponentString(final Component comp) {
|
public static final String getComponentString(final Component comp) {
|
||||||
return LegacyComponentSerializer.legacySection().serialize(comp);
|
return LegacyComponentSerializer.legacySection().serialize(comp);
|
||||||
@@ -303,6 +357,10 @@ public final class OriginBlacklist {
|
|||||||
return "data:image/png;base64," + Base64.getEncoder().encodeToString(bytes);
|
return "data:image/png;base64," + Base64.getEncoder().encodeToString(bytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static final String getUserAgent() {
|
||||||
|
return BuildInfo.get("plugin_name") + "/" + BuildInfo.get("plugin_vers") + "+" + BuildInfo.get("git_cm_hash");
|
||||||
|
}
|
||||||
|
|
||||||
public static final boolean isNonNull(final String str) {
|
public static final boolean isNonNull(final String str) {
|
||||||
return str != null && !str.isEmpty() && !str.isBlank() && !str.equals("null");
|
return str != null && !str.isEmpty() && !str.isBlank() && !str.equals("null");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package xyz.webmc.originblacklist.base.command;
|
package xyz.webmc.originblacklist.base.command;
|
||||||
|
|
||||||
public interface CommandContext {
|
public interface CommandContext {
|
||||||
String getPlayerName();
|
public String getPlayerName();
|
||||||
void reply(final String message);
|
public void reply(final String message);
|
||||||
boolean hasPermission(final String permission);
|
public boolean hasPermission(final String permission);
|
||||||
String[] getArgs();
|
public String[] getArgs();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ package xyz.webmc.originblacklist.base.command;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface ICommand {
|
public interface ICommand {
|
||||||
static final String NO_PERMISSION = "<red>You don't have permission to use this command.</red>";
|
public static final String NO_PERMISSION = "<red>You don't have permission to use this command.</red>";
|
||||||
boolean execute(final CommandContext ctx);
|
public boolean execute(final CommandContext ctx);
|
||||||
List<String> suggest(final CommandContext ctx);
|
public List<String> suggest(final CommandContext ctx);
|
||||||
void usage(final CommandContext ctx);
|
public void usage(final CommandContext ctx);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -216,11 +216,12 @@ public final class OriginBlacklistConfig {
|
|||||||
final Json5Object dobj = new Json5Object();
|
final Json5Object dobj = new Json5Object();
|
||||||
addJSONObj(dobj, "enabled", Json5Primitive.fromBoolean(false), null);
|
addJSONObj(dobj, "enabled", Json5Primitive.fromBoolean(false), null);
|
||||||
addJSONObj(dobj, "webhook_urls", new Json5Array(), null);
|
addJSONObj(dobj, "webhook_urls", new Json5Array(), null);
|
||||||
|
addJSONObj(dobj, "send_ips", Json5Primitive.fromBoolean(true), null);
|
||||||
addJSONObj(obj, "discord", dobj, null);
|
addJSONObj(obj, "discord", dobj, null);
|
||||||
final Json5Object uobj = new Json5Object();
|
final Json5Object uobj = new Json5Object();
|
||||||
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, "auto_update", Json5Primitive.fromBoolean(false), null);
|
addJSONObj(uobj, "auto_update", Json5Primitive.fromBoolean(true), null);
|
||||||
addJSONObj(obj, "update_checker", uobj, null);
|
addJSONObj(obj, "update_checker", uobj, null);
|
||||||
addJSONObj(obj, "bStats", Json5Primitive.fromBoolean(true), null);
|
addJSONObj(obj, "bStats", Json5Primitive.fromBoolean(true), null);
|
||||||
return obj;
|
return obj;
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package xyz.webmc.originblacklist.base.util;
|
||||||
|
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.util.Properties;
|
||||||
|
|
||||||
|
public class BuildInfo {
|
||||||
|
private static final Properties properties;
|
||||||
|
|
||||||
|
public static final String get(final String key) {
|
||||||
|
return properties.getProperty(key).trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
static {
|
||||||
|
properties = new Properties();
|
||||||
|
try (final InputStream in = BuildInfo.class.getClassLoader().getResourceAsStream("build.properties")) {
|
||||||
|
properties.load(in);
|
||||||
|
} catch (final Throwable t) {}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,6 +4,7 @@ import xyz.webmc.originblacklist.base.enums.EnumLogLevel;
|
|||||||
import xyz.webmc.originblacklist.base.events.OriginBlacklistLoginEvent;
|
import xyz.webmc.originblacklist.base.events.OriginBlacklistLoginEvent;
|
||||||
import xyz.webmc.originblacklist.base.events.OriginBlacklistMOTDEvent;
|
import xyz.webmc.originblacklist.base.events.OriginBlacklistMOTDEvent;
|
||||||
|
|
||||||
|
import java.nio.file.Path;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import net.kyori.adventure.text.Component;
|
import net.kyori.adventure.text.Component;
|
||||||
@@ -12,6 +13,7 @@ import org.semver4j.Semver;
|
|||||||
public interface IOriginBlacklistPlugin {
|
public interface IOriginBlacklistPlugin {
|
||||||
public String getPluginId();
|
public String getPluginId();
|
||||||
public Semver getPluginVersion();
|
public Semver getPluginVersion();
|
||||||
|
public Path getPluginJarPath();
|
||||||
public void log(final EnumLogLevel level, final String txt);
|
public void log(final EnumLogLevel level, final String txt);
|
||||||
public void kickPlayer(final Component txt, final OriginBlacklistLoginEvent event);
|
public void kickPlayer(final Component txt, final OriginBlacklistLoginEvent event);
|
||||||
public void setMOTD(final Component txt, final OriginBlacklistMOTDEvent event);
|
public void setMOTD(final Component txt, final OriginBlacklistMOTDEvent event);
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package xyz.webmc.originblacklist.base.util;
|
package xyz.webmc.originblacklist.base.util;
|
||||||
|
|
||||||
|
import xyz.webmc.originblacklist.base.OriginBlacklist;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.net.HttpURLConnection;
|
import java.net.HttpURLConnection;
|
||||||
@@ -15,35 +17,81 @@ import org.semver4j.Semver.VersionDiff;
|
|||||||
public class UpdateChecker {
|
public class UpdateChecker {
|
||||||
private static final Json5 json5 = Json5.builder(builder -> builder.build());
|
private static final Json5 json5 = Json5.builder(builder -> builder.build());
|
||||||
|
|
||||||
public static final boolean checkForUpdate(final String repo, final Semver currentVersion, final boolean allowPreRelease) {
|
public static final String checkForUpdate(final String repo, final Semver currentVersion, final boolean allowSnapshots) {
|
||||||
try {
|
try {
|
||||||
final URL url = new URL("https://api.github.com/repos/" + repo + "/releases");
|
final URL url = new URL("https://api.github.com/repos/" + repo + "/releases");
|
||||||
final HttpURLConnection conn = (HttpURLConnection) url.openConnection();
|
final HttpURLConnection conn = (HttpURLConnection) url.openConnection();
|
||||||
conn.setRequestMethod("GET");
|
conn.setRequestMethod("GET");
|
||||||
conn.setConnectTimeout(5000);
|
conn.setConnectTimeout(5000);
|
||||||
conn.setReadTimeout(5000);
|
conn.setReadTimeout(5000);
|
||||||
|
conn.setRequestProperty("User-Agent", OriginBlacklist.getUserAgent());
|
||||||
|
conn.setRequestProperty("Accept", "application/vnd.github+json");
|
||||||
conn.connect();
|
conn.connect();
|
||||||
final BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
|
final BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
|
||||||
|
String ret = null;
|
||||||
Json5Element element = json5.parse(reader);
|
Json5Element element = json5.parse(reader);
|
||||||
|
reader.close();
|
||||||
|
|
||||||
|
Json5Object rel = null;
|
||||||
|
Json5Object snap = null;
|
||||||
|
|
||||||
if (element instanceof Json5Array) {
|
if (element instanceof Json5Array) {
|
||||||
final Json5Array arr = element.getAsJson5Array();
|
final Json5Array arr = element.getAsJson5Array();
|
||||||
if (arr.size() > 0) {
|
for (int i = 0; i < arr.size(); i++) {
|
||||||
element = arr.get(0);
|
element = arr.get(i);
|
||||||
if (element instanceof Json5Object) {
|
if (element instanceof Json5Object) {
|
||||||
final Json5Object obj = element.getAsJson5Object();
|
final Json5Object obj = element.getAsJson5Object();
|
||||||
|
if (!obj.has("published_at")) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
final boolean pre = obj.get("prerelease").getAsBoolean();
|
||||||
|
if (!pre) {
|
||||||
|
if (rel == null || obj.get("published_at").getAsString().compareTo(rel.get("published_at").getAsString()) > 0) {
|
||||||
|
rel = obj;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (snap == null || obj.get("published_at").getAsString().compareTo(snap.get("published_at").getAsString()) > 0) {
|
||||||
|
snap = obj;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < 2; i++) {
|
||||||
|
final Json5Object obj = i == 0 ? rel : snap;
|
||||||
|
if (obj == null || (i == 1 && !allowSnapshots)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
final String tag = obj.get("tag_name").getAsString();
|
final String tag = obj.get("tag_name").getAsString();
|
||||||
final Semver ver = new Semver(tag.substring(1));
|
final Semver ver = new Semver(tag.startsWith("v") ? tag.substring(1) : tag);
|
||||||
if (ver.isGreaterThan(currentVersion) && (allowPreRelease || currentVersion.diff(ver) != VersionDiff.BUILD)) {
|
String comm;
|
||||||
return true;
|
try {
|
||||||
|
comm = ver.getBuild().get(0).trim();
|
||||||
|
} catch (Throwable t) {
|
||||||
|
comm = "";
|
||||||
|
}
|
||||||
|
if (ver.isGreaterThan(currentVersion) || (allowSnapshots && currentVersion.diff(ver) == VersionDiff.BUILD && OriginBlacklist.isNonNull(comm) && !BuildInfo.get("git_cm_hash").startsWith(comm))) {
|
||||||
|
element = obj.get("assets");
|
||||||
|
if (element instanceof Json5Array) {
|
||||||
|
final Json5Array aArr = element.getAsJson5Array();
|
||||||
|
if (aArr.size() > 0) {
|
||||||
|
element = aArr.get(0);
|
||||||
|
if (element instanceof Json5Object) {
|
||||||
|
ret = element.getAsJson5Object().get("browser_download_url").getAsString();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
conn.disconnect();
|
conn.disconnect();
|
||||||
return false;
|
return ret;
|
||||||
} catch (final Throwable t) {
|
} catch (final Throwable t) {
|
||||||
t.printStackTrace();
|
t.printStackTrace();
|
||||||
return false;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ import xyz.webmc.originblacklist.bukkit.command.OriginBlacklistCommandBukkit;
|
|||||||
|
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
|
import java.nio.file.Path;
|
||||||
|
import java.nio.file.Paths;
|
||||||
import java.util.Base64;
|
import java.util.Base64;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -74,7 +76,7 @@ public final class OriginBlacklistBukkit extends JavaPlugin implements Listener,
|
|||||||
this.eaglerAPI = EaglerXServerAPI.instance();
|
this.eaglerAPI = EaglerXServerAPI.instance();
|
||||||
this.getCommand("originblacklist").setExecutor(new OriginBlacklistCommandBukkit(this.blacklist));
|
this.getCommand("originblacklist").setExecutor(new OriginBlacklistCommandBukkit(this.blacklist));
|
||||||
this.getServer().getPluginManager().registerEvents(this, this);
|
this.getServer().getPluginManager().registerEvents(this, this);
|
||||||
this.log(EnumLogLevel.INFO, "Initialized Plugin");
|
this.blacklist.init();
|
||||||
if (this.blacklist.isMetricsEnabled()) {
|
if (this.blacklist.isMetricsEnabled()) {
|
||||||
this.metrics = new Metrics(this, OriginBlacklist.BSTATS_ID);
|
this.metrics = new Metrics(this, OriginBlacklist.BSTATS_ID);
|
||||||
this.metrics.addCustomChart(new AdvancedPie("player_types", () -> {
|
this.metrics.addCustomChart(new AdvancedPie("player_types", () -> {
|
||||||
@@ -127,6 +129,11 @@ public final class OriginBlacklistBukkit extends JavaPlugin implements Listener,
|
|||||||
return new Semver(this.getDescription().getVersion());
|
return new Semver(this.getDescription().getVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public final Path getPluginJarPath() {
|
||||||
|
return Paths.get(this.getFile().getAbsolutePath());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final void log(final EnumLogLevel level, final String txt) {
|
public final void log(final EnumLogLevel level, final String txt) {
|
||||||
if (level == EnumLogLevel.WARN) {
|
if (level == EnumLogLevel.WARN) {
|
||||||
@@ -224,7 +231,7 @@ public final class OriginBlacklistBukkit extends JavaPlugin implements Listener,
|
|||||||
public final void scheduleRepeat(final Runnable task, final int period, final TimeUnit unit) {
|
public final void scheduleRepeat(final Runnable task, final int period, final TimeUnit unit) {
|
||||||
long ms = unit.toMillis((long) period);
|
long ms = unit.toMillis((long) period);
|
||||||
long ticks = Math.max(1L, ms / 50L);
|
long ticks = Math.max(1L, ms / 50L);
|
||||||
Bukkit.getScheduler().runTaskTimer(this, task, ticks, ticks);
|
Bukkit.getScheduler().runTaskTimer(this, task, 0, ticks);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ import xyz.webmc.originblacklist.base.util.IncompatibleDependencyException;
|
|||||||
import xyz.webmc.originblacklist.base.util.OPlayer;
|
import xyz.webmc.originblacklist.base.util.OPlayer;
|
||||||
import xyz.webmc.originblacklist.bungee.command.OriginBlacklistCommandBungee;
|
import xyz.webmc.originblacklist.bungee.command.OriginBlacklistCommandBungee;
|
||||||
|
|
||||||
|
import java.nio.file.Path;
|
||||||
|
import java.nio.file.Paths;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
@@ -70,7 +72,7 @@ public final class OriginBlacklistBungee extends Plugin implements Listener, IOr
|
|||||||
this.eaglerAPI = EaglerXServerAPI.instance();
|
this.eaglerAPI = EaglerXServerAPI.instance();
|
||||||
this.getProxy().getPluginManager().registerCommand(this, new OriginBlacklistCommandBungee(this, this.blacklist, "originblacklist"));
|
this.getProxy().getPluginManager().registerCommand(this, new OriginBlacklistCommandBungee(this, this.blacklist, "originblacklist"));
|
||||||
this.getProxy().getPluginManager().registerListener(this, this);
|
this.getProxy().getPluginManager().registerListener(this, this);
|
||||||
this.log(EnumLogLevel.INFO, "Initialized Plugin");
|
this.blacklist.init();
|
||||||
if (this.blacklist.isMetricsEnabled()) {
|
if (this.blacklist.isMetricsEnabled()) {
|
||||||
this.metrics = new Metrics(this, OriginBlacklist.BSTATS_ID);
|
this.metrics = new Metrics(this, OriginBlacklist.BSTATS_ID);
|
||||||
this.metrics.addCustomChart(new AdvancedPie("player_types", () -> {
|
this.metrics.addCustomChart(new AdvancedPie("player_types", () -> {
|
||||||
@@ -129,6 +131,11 @@ public final class OriginBlacklistBungee extends Plugin implements Listener, IOr
|
|||||||
return new Semver(this.getDescription().getVersion());
|
return new Semver(this.getDescription().getVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public final Path getPluginJarPath() {
|
||||||
|
return Paths.get(this.getFile().getAbsolutePath());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final void log(final EnumLogLevel level, final String txt) {
|
public final void log(final EnumLogLevel level, final String txt) {
|
||||||
if (level == EnumLogLevel.WARN) {
|
if (level == EnumLogLevel.WARN) {
|
||||||
@@ -188,7 +195,7 @@ public final class OriginBlacklistBungee extends Plugin implements Listener, IOr
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final void scheduleRepeat(final Runnable task, final int period, final TimeUnit unit) {
|
public final void scheduleRepeat(final Runnable task, final int period, final TimeUnit unit) {
|
||||||
this.proxy.getScheduler().schedule(this, task, period, period, unit);
|
this.proxy.getScheduler().schedule(this, task, 0, period, unit);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ import xyz.webmc.originblacklist.base.util.IncompatibleDependencyException;
|
|||||||
import xyz.webmc.originblacklist.base.util.OPlayer;
|
import xyz.webmc.originblacklist.base.util.OPlayer;
|
||||||
import xyz.webmc.originblacklist.velocity.command.OriginBlacklistCommandVelocity;
|
import xyz.webmc.originblacklist.velocity.command.OriginBlacklistCommandVelocity;
|
||||||
|
|
||||||
|
import java.nio.file.Path;
|
||||||
|
import java.nio.file.Paths;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -86,7 +88,7 @@ public final class OriginBlacklistVelocity implements IOriginBlacklistPlugin {
|
|||||||
this.blacklist = new OriginBlacklist(this);
|
this.blacklist = new OriginBlacklist(this);
|
||||||
this.eaglerAPI = EaglerXServerAPI.instance();
|
this.eaglerAPI = EaglerXServerAPI.instance();
|
||||||
this.proxy.getCommandManager().register("originblacklist", new OriginBlacklistCommandVelocity(this.blacklist));
|
this.proxy.getCommandManager().register("originblacklist", new OriginBlacklistCommandVelocity(this.blacklist));
|
||||||
this.log(EnumLogLevel.INFO, "Initialized Plugin");
|
this.blacklist.init();
|
||||||
if (this.blacklist.isMetricsEnabled()) {
|
if (this.blacklist.isMetricsEnabled()) {
|
||||||
this.metrics = this.metricsFactory.make(this, OriginBlacklist.BSTATS_ID);
|
this.metrics = this.metricsFactory.make(this, OriginBlacklist.BSTATS_ID);
|
||||||
this.metrics.addCustomChart(new AdvancedPie("player_types", () -> {
|
this.metrics.addCustomChart(new AdvancedPie("player_types", () -> {
|
||||||
@@ -147,6 +149,15 @@ public final class OriginBlacklistVelocity implements IOriginBlacklistPlugin {
|
|||||||
return new Semver(this.plugin.getDescription().getVersion().get());
|
return new Semver(this.plugin.getDescription().getVersion().get());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public final Path getPluginJarPath() {
|
||||||
|
try {
|
||||||
|
return Paths.get(this.getClass().getProtectionDomain().getCodeSource().getLocation().toURI()).toAbsolutePath();
|
||||||
|
} catch (final Throwable t) {
|
||||||
|
throw new RuntimeException("Unable to determine plugin JAR path");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final void log(final EnumLogLevel level, final String txt) {
|
public final void log(final EnumLogLevel level, final String txt) {
|
||||||
if (level == EnumLogLevel.WARN) {
|
if (level == EnumLogLevel.WARN) {
|
||||||
@@ -155,7 +166,7 @@ public final class OriginBlacklistVelocity implements IOriginBlacklistPlugin {
|
|||||||
this.logger.error(txt);
|
this.logger.error(txt);
|
||||||
} else if (level == EnumLogLevel.DEBUG) {
|
} else if (level == EnumLogLevel.DEBUG) {
|
||||||
if (this.blacklist.isDebugEnabled()) {
|
if (this.blacklist.isDebugEnabled()) {
|
||||||
this.logger.debug(txt);
|
this.logger.info(txt);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.logger.info(txt);
|
this.logger.info(txt);
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ version: ${plugin_vers}
|
|||||||
main: xyz.webmc.${plugin_iden}.bungee.${plugin_name}Bungee
|
main: xyz.webmc.${plugin_iden}.bungee.${plugin_name}Bungee
|
||||||
description: ${plugin_desc}
|
description: ${plugin_desc}
|
||||||
website: ${plugin_site}
|
website: ${plugin_site}
|
||||||
author: [${plugin_athr}]
|
author: ${plugin_athr}
|
||||||
contributors: [${plugin_ctbr}]
|
contributors: ${plugin_ctbr}
|
||||||
depends: [${plugin_depb}]
|
depends: ${plugin_depb}
|
||||||
provides: [${plugin_prov}]
|
provides: ${plugin_prov}
|
||||||
softdepend: [${plugin_sdpb}]
|
softdepend: ${plugin_sdpb}
|
||||||
@@ -3,10 +3,10 @@ version: ${plugin_vers}
|
|||||||
main: xyz.webmc.${plugin_iden}.bukkit.${plugin_name}Bukkit
|
main: xyz.webmc.${plugin_iden}.bukkit.${plugin_name}Bukkit
|
||||||
description: ${plugin_desc}
|
description: ${plugin_desc}
|
||||||
website: ${plugin_site}
|
website: ${plugin_site}
|
||||||
authors: [${plugin_athr}]
|
authors: ${plugin_athr}
|
||||||
contributors: [${plugin_ctbr}]
|
contributors: ${plugin_ctbr}
|
||||||
depend: [${plugin_depa}]
|
depend: ${plugin_depa}
|
||||||
provides: [${plugin_prov}]
|
provides: ${plugin_prov}
|
||||||
softdepend: [${plugin_sdpa}]
|
softdepend: ${plugin_sdpa}
|
||||||
commands:
|
commands:
|
||||||
originblacklist:
|
${plugin_iden}:
|
||||||
@@ -5,6 +5,6 @@
|
|||||||
"description": "${plugin_desc}",
|
"description": "${plugin_desc}",
|
||||||
"website": "${plugin_site}",
|
"website": "${plugin_site}",
|
||||||
"main": "xyz.webmc.${plugin_iden}.velocity.${plugin_name}Velocity",
|
"main": "xyz.webmc.${plugin_iden}.velocity.${plugin_name}Velocity",
|
||||||
"authors": [${plugin_athr}],
|
"authors": ${plugin_athr},
|
||||||
"dependencies": [${plugin_depc}]
|
"dependencies": ${plugin_depc}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user