Compare commits

..

2 Commits

Author SHA1 Message Date
Colbster937
c43de8a1c9 accept eula 2026-01-19 15:40:40 -06:00
Colbster937
d8fa2b10c1 fix auto update invalid jar err 2026-01-17 10:38:56 -06:00
3 changed files with 10 additions and 7 deletions

View File

@@ -171,6 +171,7 @@ tasks.register("printVars") {
tasks.withType<RunServer>().configureEach {
minecraftVersion("1.12.2")
runDirectory.set(layout.projectDirectory.dir("run/paper"))
jvmArgs("-Dcom.mojang.eula.agree=true")
downloadPlugins {
github("lax1dude", "eaglerxserver", "v" + EAGXS_VER, "EaglerXServer.jar")
modrinth("placeholderapi", "2.11.7")

View File

@@ -57,23 +57,25 @@ public final class OriginBlacklist {
private final OriginBlacklistHTTPServer http;
private final Json5 json5;
private String updateURL;
private Path jarFile;
public OriginBlacklist(final IOriginBlacklistPlugin plugin) {
this.plugin = plugin;
this.config = new OriginBlacklistConfig(this);
this.http = new OriginBlacklistHTTPServer(this);
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() {
this.plugin.log(EnumLogLevel.INFO, "Initialized Plugin");
this.plugin.log(EnumLogLevel.DEBUG, "Commit " + COMMIT_L);
this.jarFile = this.plugin.getPluginJarPath();
this.plugin.scheduleRepeat(() -> {
this.checkForUpdates();
}, this.config.getInteger("update_checker.check_timer"), TimeUnit.SECONDS);
if (this.isHTTPServerEnabled()) {
this.http.start();
}
this.plugin.log(EnumLogLevel.INFO, "Initialized Plugin");
this.plugin.log(EnumLogLevel.DEBUG, "Commit " + COMMIT_L);
}
public final void shutdown() {
@@ -190,7 +192,7 @@ public final class OriginBlacklist {
public final void updatePlugin(final Runnable action1, final Runnable action2) {
try {
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 upd = jar
.resolveSibling(Paths.get(URLDecoder.decode(url.getPath(), StandardCharsets.UTF_8)).getFileName());
@@ -215,6 +217,7 @@ public final class OriginBlacklist {
}
Files.delete(jar);
Files.delete(bak);
this.jarFile = upd;
action1.run();
return;
} catch (final Throwable t) {

View File

@@ -1,7 +1,6 @@
package xyz.webmc.originblacklist.base.config;
import xyz.webmc.originblacklist.base.OriginBlacklist;
import xyz.webmc.originblacklist.base.util.IOriginBlacklistPlugin;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;