Class BlockHandlerCache<T>
java.lang.Object
net.ixdarklord.coolcatcore.api.handler.BlockHandlerCache<T>
One position's handler, looked up once and kept until it may have changed: when the block state there changes,
when the block entity is removed or replaced (chunk unloads included), or when
HandlerType.invalidate(Level, BlockPos) is called for the position. Made by HandlerType.createCache(Level, BlockPos, Direction).
The invalidation callback runs for removed block entities and explicit invalidations; a changed block state is
noticed by the next get().
-
Method Summary
-
Method Details
-
get
The handler, ornullif there's none (or the position isn't loaded). -
invalidate
public void invalidate()Drops the cached handler; the nextget()looks again. Runs the invalidation callback. -
type
-
level
public net.minecraft.world.level.Level level() -
pos
public net.minecraft.core.BlockPos pos() -
side
@Nullable public @Nullable net.minecraft.core.Direction side()
-