From b014b8f9f9b605d5dd00cdbefc2ff677a6a6574c Mon Sep 17 00:00:00 2001 From: ImplementsLegend Date: Mon, 8 Apr 2024 11:38:12 +0200 Subject: [PATCH] fixed potentially null result in nonnull function getCachedPalette --- .../mod/vaultfaster/mixin/MixinReferenceTileProcessor.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/implementslegend/mod/vaultfaster/mixin/MixinReferenceTileProcessor.java b/src/main/java/implementslegend/mod/vaultfaster/mixin/MixinReferenceTileProcessor.java index 2cefda9..76db6fe 100644 --- a/src/main/java/implementslegend/mod/vaultfaster/mixin/MixinReferenceTileProcessor.java +++ b/src/main/java/implementslegend/mod/vaultfaster/mixin/MixinReferenceTileProcessor.java @@ -50,9 +50,9 @@ public Palette getCachedPalette(ProcessorContext context) {//this could break wh if (cachedVersion==null || cachedPalette==null || !lastVault.refersTo(context.getVault())) { lastVault = new PhantomReference<>(context.getVault(),null); Version version = context.getVault() == null ? Version.latest() : (Version)context.getVault().get(Vault.VERSION); - if(version!=cachedVersion){ + if(version!=cachedVersion || palette==null){ cachedVersion=version; - palette = VaultRegistry.PALETTE.getKey(this.id).get(version); + palette = VaultRegistry.PALETTE.getKey(this.id).get(version); cachedPalette=palette; } }