9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2026-01-06 15:52:03 +00:00

优化tags更新

This commit is contained in:
XiaoMoMi
2025-11-07 21:14:50 +08:00
parent 2e096558f7
commit e00035adf5
7 changed files with 34 additions and 65 deletions

View File

@@ -143,7 +143,7 @@ public abstract class AbstractBlockManager extends AbstractModelGenerator implem
@Override
public void delayedLoad() {
this.initSuggestions();
this.resendTags();
this.updateTags();
this.processSounds();
this.clearCache();
}
@@ -232,7 +232,7 @@ public abstract class AbstractBlockManager extends AbstractModelGenerator implem
public abstract BlockBehavior createBlockBehavior(CustomBlock customBlock, List<Map<String, Object>> behaviorConfig);
protected abstract void resendTags();
protected abstract void updateTags();
protected abstract boolean isVanillaBlock(Key id);

View File

@@ -184,6 +184,8 @@ public abstract class CraftEngine implements Plugin {
delayedLoadTasks.add(CompletableFuture.runAsync(() -> this.recipeManager.delayedLoad(), this.scheduler.async()));
}
CompletableFutures.allOf(delayedLoadTasks).join();
// 重新发送tags需要等待tags更新完成
this.networkManager.delayedLoad();
long time2 = System.currentTimeMillis();
asyncTime = time2 - time1;
} finally {

View File

@@ -0,0 +1,6 @@
package net.momirealms.craftengine.core.util;
import java.util.HashMap;
public class MarkedHashMap<K, V> extends HashMap<K, V> {
}