9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2025-12-19 15:09:15 +00:00

添加深度合并map的选项

This commit is contained in:
XiaoMoMi
2025-06-10 21:15:17 +08:00
parent 3a06814a68
commit 5e56ad3db1
3 changed files with 22 additions and 18 deletions

View File

@@ -52,7 +52,7 @@ The code you contribute will be open-sourced under the GPLv3 license. If you pre
### 🌍 Translations
1. Clone this repository.
2. Create a new language file in: `/common-files/src/main/resources/translations`
3. Once done, submit a **pull request** for review. We appreciate your contributions!
3. Once done, submit a **pull request** to **dev** branch for review. We appreciate your contributions!
## Differences Between Versions
| Version | Official Support | Max Players | Dev Builds |
@@ -76,7 +76,7 @@ repositories {
```
```kotlin
dependencies {
compileOnly("net.momirealms:craft-engine-core:0.0.56")
compileOnly("net.momirealms:craft-engine-bukkit:0.0.56")
compileOnly("net.momirealms:craft-engine-core:0.0.57")
compileOnly("net.momirealms:craft-engine-bukkit:0.0.57")
}
```

View File

@@ -52,8 +52,7 @@ resource-pack:
- "@vanilla_textures"
bypass-models:
- "@vanilla_models"
bypass-sounds:
- "@vanilla_sounds"
bypass-sounds: []
bypass-equipments: []
# Validate if there are any errors in the resource pack, such as missing textures or models
validate:

View File

@@ -104,6 +104,10 @@ public class MiscUtils {
public static void deepMergeMaps(Map<String, Object> baseMap, Map<String, Object> mapToMerge) {
for (Map.Entry<String, Object> entry : mapToMerge.entrySet()) {
String key = entry.getKey();
if (!key.isEmpty() && key.charAt(0) == '$') {
Object value = entry.getValue();
baseMap.put(key.substring(1), value);
} else {
Object value = entry.getValue();
if (baseMap.containsKey(key)) {
Object existingValue = baseMap.get(key);
@@ -124,3 +128,4 @@ public class MiscUtils {
}
}
}
}