mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2026-01-04 15:41:38 +00:00
优化兼容性加载逻辑
This commit is contained in:
@@ -45,9 +45,11 @@ public class Config {
|
||||
protected boolean firstTime = true;
|
||||
protected boolean checkUpdate;
|
||||
protected boolean metrics;
|
||||
protected boolean filterConfigurationPhaseDisconnect;
|
||||
protected Locale forcedLocale;
|
||||
protected boolean delayConfigurationLoad;
|
||||
|
||||
protected boolean misc$filterConfigurationPhaseDisconnect;
|
||||
protected boolean misc$delayConfigurationLoad;
|
||||
protected boolean misc$inject_packet_vents;
|
||||
|
||||
protected boolean debug$common;
|
||||
protected boolean debug$packet;
|
||||
@@ -311,13 +313,14 @@ public class Config {
|
||||
public void loadFullSettings() {
|
||||
YamlDocument config = settings();
|
||||
forcedLocale = TranslationManager.parseLocale(config.getString("forced-locale", ""));
|
||||
delayConfigurationLoad = config.getBoolean("delay-configuration-load", false);
|
||||
misc$delayConfigurationLoad = config.getBoolean("misc.delay-configuration-load", false);
|
||||
misc$inject_packet_vents = config.getBoolean("misc.inject-packetevents", false);
|
||||
|
||||
// basics
|
||||
metrics = config.getBoolean("metrics", false);
|
||||
checkUpdate = config.getBoolean("update-checker", false);
|
||||
filterConfigurationPhaseDisconnect = config.getBoolean("filter-configuration-phase-disconnect", false);
|
||||
DisconnectLogFilter.instance().setEnable(filterConfigurationPhaseDisconnect);
|
||||
misc$filterConfigurationPhaseDisconnect = config.getBoolean("misc.filter-configuration-phase-disconnect", false);
|
||||
DisconnectLogFilter.instance().setEnable(misc$filterConfigurationPhaseDisconnect);
|
||||
|
||||
// debug
|
||||
debug$common = config.getBoolean("debug.common", false);
|
||||
@@ -630,7 +633,11 @@ public class Config {
|
||||
}
|
||||
|
||||
public static boolean delayConfigurationLoad() {
|
||||
return instance.delayConfigurationLoad;
|
||||
return instance.misc$delayConfigurationLoad;
|
||||
}
|
||||
|
||||
public static boolean injectPacketEvents() {
|
||||
return instance.misc$inject_packet_vents;
|
||||
}
|
||||
|
||||
public static boolean debugCommon() {
|
||||
@@ -678,7 +685,7 @@ public class Config {
|
||||
}
|
||||
|
||||
public static boolean filterConfigurationPhaseDisconnect() {
|
||||
return instance.filterConfigurationPhaseDisconnect;
|
||||
return instance.misc$filterConfigurationPhaseDisconnect;
|
||||
}
|
||||
|
||||
public static boolean resourcePack$overrideUniform() {
|
||||
|
||||
@@ -98,7 +98,6 @@ public class StringKeyConstructor extends SafeConstructor {
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
// 处理版本化块合并
|
||||
private void processVersionedBlock(Map<Object, Object> targetMap, String key, Node valueNode) {
|
||||
String versionSpec = key.substring(VERSION_PREFIX.length());
|
||||
@@ -155,7 +154,6 @@ public class StringKeyConstructor extends SafeConstructor {
|
||||
setValueWithDuplicationCheck(targetMap, key, newValue, key, keyNode);
|
||||
}
|
||||
|
||||
|
||||
// 设置值并检查重复键
|
||||
@SuppressWarnings("unchecked")
|
||||
private void setValueWithDuplicationCheck(Map<Object, Object> targetMap, String key, Object newValue, String fullKeyPath, Node keyNode) {
|
||||
@@ -174,7 +172,6 @@ public class StringKeyConstructor extends SafeConstructor {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 合并两个Map并检查重复键
|
||||
@SuppressWarnings("unchecked")
|
||||
private void mergeMap(Map<Object, Object> target, Map<Object, Object> source, String parentPath, Node sourceNode) {
|
||||
@@ -197,7 +194,6 @@ public class StringKeyConstructor extends SafeConstructor {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 检查一个MappingNode是否是“值选择器”(即所有键都以 '$$' 开头)。
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user