Class SidedReloadableCache<T>

java.lang.Object
net.darkhax.bookshelf.common.api.function.SidedReloadableCache<T>
All Implemented Interfaces:
Function<net.minecraft.world.level.Level,T>

public class SidedReloadableCache<T> extends Object implements Function<net.minecraft.world.level.Level,T>
  • Constructor Details

  • Method Details

    • getCache

      public ReloadableCache<T> getCache(net.minecraft.world.level.Level level)
    • apply

      @Nullable public T apply(net.minecraft.world.level.Level level)
      Specified by:
      apply in interface Function<net.minecraft.world.level.Level,T>
    • invalidate

      public void invalidate(net.minecraft.world.level.Level level)
    • isCached

      public boolean isCached(net.minecraft.world.level.Level level)
    • apply

      public void apply(net.minecraft.world.level.Level level, Consumer<T> consumer)
    • ifPresent

      public void ifPresent(net.minecraft.world.level.Level level, Consumer<T> consumer)
    • map

      @Nullable public <R> R map(net.minecraft.world.level.Level level, Function<T,R> mapper)
    • of

      public static <T> SidedReloadableCache<T> of(Function<net.minecraft.world.level.Level,T> cacheFunc)
    • recipes

      public static <T extends net.minecraft.world.item.crafting.Recipe<?>> SidedReloadableCache<Map<net.minecraft.resources.ResourceLocation,net.minecraft.world.item.crafting.RecipeHolder<T>>> recipes(Supplier<net.minecraft.world.item.crafting.RecipeType<T>> type)