9
0
mirror of https://github.com/BX-Team/DivineMC.git synced 2025-12-22 16:29:23 +00:00

Updated Upstream (Purpur)

Upstream has released updates that appear to apply and compile correctly

Purpur Changes:
PurpurMC/Purpur@9d1d9fd [ci skip] inline import
PurpurMC/Purpur@1b5ab0c Updated Upstream (Paper)
PurpurMC/Purpur@4b74604 [ci skip] enable caching (#1634)
This commit is contained in:
NONPLAYT
2025-01-19 18:02:56 +03:00
parent 8cb67d404f
commit 32b80ea775
8 changed files with 83 additions and 18 deletions

View File

@@ -162,11 +162,13 @@ public class DivineConfig {
public static boolean removeVanillaUsernameCheck = false;
public static boolean disableMovedWronglyThreshold = false;
public static boolean enableSecureSeed = false;
public static boolean asyncPlayerDataSaveEnabled = false;
private static void miscSettings() {
disableNonEditableSignWarning = getBoolean("settings.misc.disable-non-editable-sign-warning", disableNonEditableSignWarning);
removeVanillaUsernameCheck = getBoolean("settings.misc.remove-vanilla-username-check", removeVanillaUsernameCheck);
disableMovedWronglyThreshold = getBoolean("settings.misc.disable-moved-wrongly-threshold", disableMovedWronglyThreshold);
enableSecureSeed = getBoolean("settings.misc.enable-secure-seed", enableSecureSeed);
asyncPlayerDataSaveEnabled = getBoolean("settings.misc.experimental.async-player-data-save-enabled", asyncPlayerDataSaveEnabled);
}
public static int linearFlushFrequency = 5;

View File

@@ -0,0 +1,22 @@
package space.bxteam.divinemc.util;
import net.minecraft.Util;
import space.bxteam.divinemc.configuration.DivineConfig;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutorService;
public class AsyncDataSaving {
private AsyncDataSaving() {
throw new IllegalStateException("This class cannot be instantiated");
}
public static void saveAsync(Runnable runnable) {
if (!DivineConfig.asyncPlayerDataSaveEnabled) {
runnable.run();
return;
}
ExecutorService ioExecutor = Util.backgroundExecutor().service();
CompletableFuture.runAsync(runnable, ioExecutor);
}
}