Skip to content

Commit

Permalink
Make cape cache expire after 1 second in development environment (for…
Browse files Browse the repository at this point in the history
… testing)
  • Loading branch information
WildfireRomeo committed Dec 9, 2024
1 parent 9066535 commit aacbde9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/com/wildfire/main/cape/CapeProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import com.mojang.authlib.GameProfile;
import com.wildfire.main.WildfireGender;
import net.fabricmc.fabric.mixin.client.rendering.CapeFeatureRendererMixin;
import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.network.AbstractClientPlayerEntity;
import net.minecraft.client.render.entity.feature.CapeFeatureRenderer;
Expand Down Expand Up @@ -58,7 +59,7 @@ public class CapeProvider {
public static final Identifier NO_CAPE = Identifier.of(WildfireGender.MODID, "no_cape");

public static final LoadingCache<GameProfile, CompletableFuture<Identifier>> CACHE = CacheBuilder.newBuilder()
.expireAfterAccess(Duration.ofMinutes(30))
.expireAfterAccess(FabricLoader.getInstance().isDevelopmentEnvironment()?Duration.ofSeconds(1):Duration.ofMinutes(30)) //debug
.removalListener(CapeProvider::remove)
.build(new CacheLoader<>() {
@NotNull
Expand Down

0 comments on commit aacbde9

Please sign in to comment.