mirror of
https://github.com/colbster937/originblacklist.git
synced 2026-02-04 11:07:41 +00:00
Compare commits
2 Commits
89311ee6de
...
v2.0.6+c43
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c43de8a1c9 | ||
|
|
d8fa2b10c1 |
@@ -171,6 +171,7 @@ tasks.register("printVars") {
|
|||||||
tasks.withType<RunServer>().configureEach {
|
tasks.withType<RunServer>().configureEach {
|
||||||
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")
|
||||||
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.11.7")
|
||||||
|
|||||||
@@ -57,23 +57,25 @@ public final class OriginBlacklist {
|
|||||||
private final OriginBlacklistHTTPServer http;
|
private final OriginBlacklistHTTPServer http;
|
||||||
private final Json5 json5;
|
private final Json5 json5;
|
||||||
private String updateURL;
|
private String updateURL;
|
||||||
|
private Path jarFile;
|
||||||
|
|
||||||
public OriginBlacklist(final IOriginBlacklistPlugin plugin) {
|
public OriginBlacklist(final IOriginBlacklistPlugin plugin) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
this.config = new OriginBlacklistConfig(this);
|
this.config = new OriginBlacklistConfig(this);
|
||||||
this.http = new OriginBlacklistHTTPServer(this);
|
this.http = new OriginBlacklistHTTPServer(this);
|
||||||
this.json5 = Json5.builder(builder -> builder.prettyPrinting().indentFactor(0).build());
|
this.json5 = Json5.builder(builder -> builder.prettyPrinting().indentFactor(0).build());
|
||||||
plugin.scheduleRepeat(() -> {
|
|
||||||
this.checkForUpdates();
|
|
||||||
}, this.config.getInteger("update_checker.check_timer"), TimeUnit.SECONDS);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void init() {
|
public final void init() {
|
||||||
this.plugin.log(EnumLogLevel.INFO, "Initialized Plugin");
|
this.jarFile = this.plugin.getPluginJarPath();
|
||||||
this.plugin.log(EnumLogLevel.DEBUG, "Commit " + COMMIT_L);
|
this.plugin.scheduleRepeat(() -> {
|
||||||
|
this.checkForUpdates();
|
||||||
|
}, this.config.getInteger("update_checker.check_timer"), TimeUnit.SECONDS);
|
||||||
if (this.isHTTPServerEnabled()) {
|
if (this.isHTTPServerEnabled()) {
|
||||||
this.http.start();
|
this.http.start();
|
||||||
}
|
}
|
||||||
|
this.plugin.log(EnumLogLevel.INFO, "Initialized Plugin");
|
||||||
|
this.plugin.log(EnumLogLevel.DEBUG, "Commit " + COMMIT_L);
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void shutdown() {
|
public final void shutdown() {
|
||||||
@@ -190,7 +192,7 @@ public final class OriginBlacklist {
|
|||||||
public final void updatePlugin(final Runnable action1, final Runnable action2) {
|
public final void updatePlugin(final Runnable action1, final Runnable action2) {
|
||||||
try {
|
try {
|
||||||
final URL url = new URL(this.updateURL);
|
final URL url = new URL(this.updateURL);
|
||||||
final Path jar = this.plugin.getPluginJarPath();
|
final Path jar = this.jarFile;
|
||||||
final Path bak = jar.resolveSibling(jar.getFileName().toString() + ".bak");
|
final Path bak = jar.resolveSibling(jar.getFileName().toString() + ".bak");
|
||||||
final Path upd = jar
|
final Path upd = jar
|
||||||
.resolveSibling(Paths.get(URLDecoder.decode(url.getPath(), StandardCharsets.UTF_8)).getFileName());
|
.resolveSibling(Paths.get(URLDecoder.decode(url.getPath(), StandardCharsets.UTF_8)).getFileName());
|
||||||
@@ -215,6 +217,7 @@ public final class OriginBlacklist {
|
|||||||
}
|
}
|
||||||
Files.delete(jar);
|
Files.delete(jar);
|
||||||
Files.delete(bak);
|
Files.delete(bak);
|
||||||
|
this.jarFile = upd;
|
||||||
action1.run();
|
action1.run();
|
||||||
return;
|
return;
|
||||||
} catch (final Throwable t) {
|
} catch (final Throwable t) {
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package xyz.webmc.originblacklist.base.config;
|
package xyz.webmc.originblacklist.base.config;
|
||||||
|
|
||||||
import xyz.webmc.originblacklist.base.OriginBlacklist;
|
import xyz.webmc.originblacklist.base.OriginBlacklist;
|
||||||
import xyz.webmc.originblacklist.base.util.IOriginBlacklistPlugin;
|
|
||||||
|
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
|
|||||||
Reference in New Issue
Block a user