diff --git a/content/news/20.3capability-rework.md b/content/news/20.3capability-rework.md index c99a842..8a17f54 100644 --- a/content/news/20.3capability-rework.md +++ b/content/news/20.3capability-rework.md @@ -225,7 +225,7 @@ if (handler != null) { ``` ### Block capability caching -For efficient queries and automatic caching, use `BlockCapabilityCache`. +For efficient queries and automatic caching, use `BlockCapabilityCache` instead of directly calling `level.getCapability`. This is a more powerful replacement for the old `LazyOptional` invalidation system. When a capability is looked up, the system will perform the following steps under the hood: @@ -238,7 +238,8 @@ The implementation is rather efficient, but for queries that are performed frequ for example every game tick, these steps can take a significant amount of server time. The `BlockCapabilityCache` system provides a dramatic speedup for capabilities that are frequently queried at a given position. -Generally, a `BlockCapabilityCache` will be created once and then stored in a field. +Generally, a `BlockCapabilityCache` will be created once and then stored in a field of the object performing frequent capability queries. +When exactly you store the cache is up to you. The cache must be provided with the capability to query, the level, the position, and the query context. ```java