From 2476aa2ea8a1decee44be60086cf2d851c6afb59 Mon Sep 17 00:00:00 2001 From: violetc <58360096+s-yh-china@users.noreply.github.com> Date: Tue, 18 Jul 2023 06:55:16 +0800 Subject: [PATCH] Utilize internal cache in StructureGrowthProcess (#371) * Use whoPlacedCache * Still perform database lookup if cache is empty --------- Co-authored-by: Intelli <6790859+Intelli@users.noreply.github.com> --- .../coreprotect/consumer/process/StructureGrowthProcess.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/coreprotect/consumer/process/StructureGrowthProcess.java b/src/main/java/net/coreprotect/consumer/process/StructureGrowthProcess.java index 6c3fee5..83d38f7 100644 --- a/src/main/java/net/coreprotect/consumer/process/StructureGrowthProcess.java +++ b/src/main/java/net/coreprotect/consumer/process/StructureGrowthProcess.java @@ -21,7 +21,10 @@ class StructureGrowthProcess { Map> blockLists = Consumer.consumerBlockList.get(processId); if (blockLists.get(id) != null) { List blockStates = blockLists.get(id); - String resultData = Lookup.whoPlaced(statement, block); + String resultData = Lookup.whoPlacedCache(block); + if (resultData.isEmpty()) { + resultData = Lookup.whoPlaced(statement, block); + } if (resultData.length() > 0) { user = resultData; }