Compare commits

...

5 Commits

Author SHA1 Message Date
Helvetica Volubi e0d42cb1d3 Update Luminol 2026-05-01 23:12:36 +08:00
xiaoyueyoqwq 559b2e089a Fix Syncmatica modifier cleanup (#141)
Co-authored-by: xiaoyueyoqwq <xiaoyueyoqwq@users.noreply.github.com>
2026-05-01 23:07:35 +08:00
Helvetica Volubi a07649d14d [ci skip]update code from Leaves to fix some bug 2026-05-01 23:06:47 +08:00
Helvetica Volubi 6aa709cf75 [ci skip] fixup ci 2026-04-22 18:30:09 +08:00
Helvetica Volubi 6a452799cc feat: add full blocking load option for localized language support 2026-04-22 13:26:54 +08:00
5 changed files with 28 additions and 5 deletions
+1 -1
View File
@@ -85,7 +85,7 @@ jobs:
echo "release_exists=${release_exists}" >> $GITHUB_ENV
- name: Check If Branch In Expectations
if: github.event_name != 'pull_request'
if: github.event_name != 'pull_request' && env.flag_release == 'true'
run: |
if [[ "$GITHUB_REF_NAME" == ver/* ]] || [[ "$GITHUB_REF_NAME" == exp/* ]] || [[ "$GITHUB_REF_NAME" == dev/* ]]; then
echo "Branch is in expected prefixes"
+1 -1
View File
@@ -7,7 +7,7 @@ weightVersion=2.0.7
release=2
# 0 for skip release, 1 for pre-release, 2 for release
luminolRef=e605804fc5600aa41b18863543873bff65e125e9
luminolRef=4553d0974982c54663b47c996ae5383371ff2db3
org.gradle.configuration-cache=true
org.gradle.caching=true
@@ -13,4 +13,12 @@ public class LanguageConfig implements IConfigModule {
Please use the key from https://minecraft.wiki/w/Language
Sample of format: en_us zh_cn zh_hk zh_tw""")
public static String lang = "en_us";
@ConfigInfo(name = "full_blocking_load", comments = """
Whether to allow blocking server loading when loading localized language.
If you want only use your localized language to shown in your terminal,
you need to enable it.
WARNING: This may slow down the startup speed!""")
public static boolean full_blocking_load = false;
}
@@ -64,7 +64,11 @@ public class ServerI18nUtil {
langJsonPath = "minecraft/lang/" + LanguageConfig.lang + ".json";
lophineLangPath = "/assets/lophine/lang/" + LanguageConfig.lang + ".json";
logger.info("Starting load language: {}", LanguageConfig.lang);
preloadTask.thenAcceptAsync(v -> loadI18n(LanguageConfig.lang, 2));
if (LanguageConfig.full_blocking_load) {
loadI18n(LanguageConfig.lang, 2);
} else {
preloadTask.thenAcceptAsync(v -> loadI18n(LanguageConfig.lang, 2));
}
}
public static void preInit() {
@@ -28,6 +28,7 @@ import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.level.block.Mirror;
import net.minecraft.world.level.block.Rotation;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.leavesmc.leaves.protocol.core.LeavesProtocol;
import org.leavesmc.leaves.protocol.core.ProtocolHandler;
import org.leavesmc.leaves.protocol.syncmatica.exchange.*;
@@ -40,6 +41,8 @@ import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentLinkedQueue;
import static fun.bm.lophine.LophineLogger.LOGGER;
@LeavesProtocol.Register(namespace = "syncmatica")
public class CommunicationManager implements LeavesProtocol {
@@ -178,6 +181,10 @@ public class CommunicationManager implements LeavesProtocol {
if (id.equals(PacketType.MODIFY_REQUEST.identifier)) {
final UUID placementId = packetBuf.readUUID();
final ModifyExchangeServer modifier = new ModifyExchangeServer(placementId, source);
if (modifier.getPlacement() == null) {
LOGGER.warn("Could not find placement for modify request {}", placementId);
return;
}
startExchange(modifier);
}
}
@@ -351,8 +358,12 @@ public class CommunicationManager implements LeavesProtocol {
return downloadState.getOrDefault(syncmatic.getHash(), false);
}
public static void setModifier(final @NotNull ServerPlacement syncmatic, final Exchange exchange) {
modifyState.put(syncmatic.getHash(), exchange);
public static void setModifier(final @NotNull ServerPlacement syncmatic, final @Nullable Exchange exchange) {
if (exchange == null) {
modifyState.remove(syncmatic.getHash());
} else {
modifyState.put(syncmatic.getHash(), exchange);
}
}
public static Exchange getModifier(final @NotNull ServerPlacement syncmatic) {