Skip to content

Commit

Permalink
fix(storage): increase the freq of uni data cache
Browse files Browse the repository at this point in the history
  • Loading branch information
StarWishsama committed Dec 22, 2024
1 parent 1318ae9 commit 9107bf8
Showing 1 changed file with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,25 +160,20 @@ public static void removeData(Location loc, String key) {

/**
* Get universal data from block
* <p>
* You **must** call this method from sync!
*
* @param block {@link Block}
* @return {@link SlimefunUniversalBlockData}
*/
@ParametersAreNonnullByDefault
@Nullable public static SlimefunUniversalBlockData getUniversalBlock(Block block) {
return TaskUtil.runSyncMethod(() -> {
var uuid = Slimefun.getBlockDataService().getUniversalDataUUID(block);

return uuid.map(id -> getUniversalBlock(id, block.getLocation())).orElse(null);
});
return Slimefun.getDatabaseManager()
.getBlockDataController()
.getUniversalBlockDataFromCache(block.getLocation())
.orElse(null);
}

/**
* Get universal menu from block
* <p>
* You **must** call this method from sync!
*
* @param block {@link Block}
* @return {@link SlimefunUniversalData}
Expand Down

0 comments on commit 9107bf8

Please sign in to comment.