Merge branch 'dev' into feat/folia

# Conflicts:
#	core/src/main/java/com/volmit/iris/Iris.java
This commit is contained in:
Julian Krings 2025-06-15 12:24:18 +02:00
commit 0957b9baf2
No known key found for this signature in database
GPG Key ID: 208C6E08C3B718D2
6 changed files with 1062 additions and 995 deletions

View File

@ -37,7 +37,7 @@ plugins {
id("io.sentry.jvm.gradle") version "5.7.0"
}
version = "3.6.10-1.20.1-1.21.5"
version = "3.6.11-1.20.1-1.21.5"
// ADD YOURSELF AS A NEW LINE IF YOU WANT YOUR OWN BUILD TASK GENERATED
// ======================== WINDOWS =============================
@ -61,6 +61,7 @@ val serverMinHeap = "2G"
val serverMaxHeap = "8G"
//Valid values are: none, truecolor, indexed256, indexed16, indexed8
val color = "truecolor"
val errorReporting = false
val nmsBindings = mapOf(
"v1_21_R4" to "1.21.5-R0.1-SNAPSHOT",
@ -104,6 +105,7 @@ nmsBindings.forEach { key, value ->
systemProperty("disable.watchdog", "")
systemProperty("net.kyori.ansi.colorLevel", color)
systemProperty("com.mojang.eula.agree", true)
systemProperty("iris.errorReporting", errorReporting)
}
tasks.register<RunServer>("runFolia-$key") {
@ -288,4 +290,4 @@ fun registerCustomOutputTaskUnix(name: String, path: String) {
into(file(path))
rename { "Iris.jar" }
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -225,6 +225,7 @@ public class IrisSettings {
@Data
public static class IrisSettingsSentry {
public boolean includeServerId = true;
public boolean disableAutoReporting = false;
public boolean debug = false;
}

View File

@ -96,8 +96,8 @@ public class IrisContext {
.qput("studio", engine.isStudio())
.qput("closed", engine.isClosed())
.qput("pack", new KMap<>()
.qput("key", dimension.getLoadKey())
.qput("version", dimension.getVersion())
.qput("key", dimension == null ? "" : dimension.getLoadKey())
.qput("version", dimension == null ? "" : dimension.getVersion())
.qput("hash", hash32 == null ? "" : Long.toHexString(hash32)))
.qput("mantle", new KMap<>()
.qput("idle", mantle.getAdjustedIdleDuration())

View File

@ -369,11 +369,10 @@ public class Mantle {
*/
public synchronized void close() {
Iris.debug("Closing The Mantle " + C.DARK_AQUA + dataFolder.getAbsolutePath());
if (closed.get()) {
if (closed.getAndSet(true)) {
return;
}
closed.set(true);
hyperLock.disable();
BurstExecutor b = ioBurst.burst(toUnload.size());
loadedRegions.forEach((i, plate) -> b.queue(() -> {
@ -383,11 +382,11 @@ public class Mantle {
oldFileForRegion(dataFolder, i).delete();
} catch (Throwable e) {
Iris.error("Failed to write Tectonic Plate " + C.DARK_GREEN + Cache.keyX(i) + " " + Cache.keyZ(i));
Iris.reportError(e);
e.printStackTrace();
}
}));
loadedRegions.clear();
IO.delete(new File(dataFolder, ".tmp"));
try {
b.complete();
@ -395,6 +394,7 @@ public class Mantle {
Iris.reportError(e);
}
IO.delete(new File(dataFolder, ".tmp"));
Iris.debug("The Mantle has Closed " + C.DARK_AQUA + dataFolder.getAbsolutePath());
}

View File

@ -0,0 +1,59 @@
package com.volmit.iris.util.sentry;
import com.volmit.iris.util.io.IO;
import io.sentry.protocol.User;
import lombok.SneakyThrows;
import org.bukkit.Bukkit;
import oshi.SystemInfo;
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
public class ServerID {
public static final String ID = calculate();
public static User asUser() {
User u = new User();
u.setId(ID);
return u;
}
@SneakyThrows
private static String calculate() {
Digest md = new Digest();
md.update(System.getProperty("java.vm.name"));
md.update(System.getProperty("java.vm.version"));
md.update(new SystemInfo().getHardware().getProcessor().toString());
md.update(Runtime.getRuntime().maxMemory());
for (var p : Bukkit.getPluginManager().getPlugins()) {
md.update(p.getName());
}
return IO.bytesToHex(md.digest());
}
private static final class Digest {
private final MessageDigest md = MessageDigest.getInstance("SHA-256");
private final byte[] buffer = new byte[8];
private final ByteBuffer wrapped = ByteBuffer.wrap(buffer);
private Digest() throws NoSuchAlgorithmException {
}
public void update(String string) {
if (string == null) return;
md.update(string.getBytes(StandardCharsets.UTF_8));
}
public void update(long Long) {
wrapped.putLong(0, Long);
md.update(buffer, 0, 8);
}
public byte[] digest() {
return md.digest();
}
}
}