diff --git a/common/src/main/java/com/unlikepaladin/pfm/client/PathPackRPWrapper.java b/common/src/main/java/com/unlikepaladin/pfm/client/PathPackRPWrapper.java index 6082883b9..e648f84a9 100644 --- a/common/src/main/java/com/unlikepaladin/pfm/client/PathPackRPWrapper.java +++ b/common/src/main/java/com/unlikepaladin/pfm/client/PathPackRPWrapper.java @@ -10,7 +10,9 @@ import java.io.IOException; import java.io.InputStream; +import java.util.ArrayList; import java.util.Collection; +import java.util.HashSet; import java.util.Set; import java.util.function.Predicate; import java.util.function.Supplier; @@ -44,7 +46,7 @@ public InputStream open(ResourceType type, Identifier id) throws IOException { public Collection findResources(ResourceType type, String namespace, String prefix, Predicate allowedPathPredicate) { if (PFMRuntimeResources.ready) return delegate.get().findResources(type, namespace, prefix, allowedPathPredicate); - return null; + return new ArrayList<>(); } @Override @@ -56,7 +58,9 @@ public boolean contains(ResourceType type, Identifier id) { @Override public Set getNamespaces(ResourceType type) { - return delegate.get().getNamespaces(type); + if (PFMRuntimeResources.ready) + return delegate.get().getNamespaces(type); + return new HashSet<>(); } @Nullable @@ -65,6 +69,8 @@ public T parseMetadata(ResourceMetadataReader metaReader) throws IOExcept if (metaReader.getKey().equals("pack")) { return (T) packResourceMetadata; } + if (PFMRuntimeResources.ready) + return delegate.get().parseMetadata(metaReader); return null; } diff --git a/common/src/main/java/com/unlikepaladin/pfm/mixin/PFMDataCache$CachedDataMixin.java b/common/src/main/java/com/unlikepaladin/pfm/mixin/PFMDataCache$CachedDataMixin.java index 688695786..2c10af0d0 100644 --- a/common/src/main/java/com/unlikepaladin/pfm/mixin/PFMDataCache$CachedDataMixin.java +++ b/common/src/main/java/com/unlikepaladin/pfm/mixin/PFMDataCache$CachedDataMixin.java @@ -13,7 +13,7 @@ @Mixin(value = DataCache.CachedData.class) public class PFMDataCache$CachedDataMixin { @Inject(method = "write", at = @At(value = "INVOKE", target = "Lorg/slf4j/Logger;warn(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V", remap = false),cancellable = true, remap = true) - public void silenceCacheWarning(Path root, Path dataProviderPath, String description, CallbackInfo ci) { + public void stopCacheWarning(Path root, Path dataProviderPath, String description, CallbackInfo ci) { if (PFMRuntimeResources.isAnyGeneratorRunning()) ci.cancel(); } diff --git a/common/src/main/java/com/unlikepaladin/pfm/mixin/PFMMixinClientPacketListener.java b/common/src/main/java/com/unlikepaladin/pfm/mixin/PFMMixinClientPacketListener.java index ead10d876..8ca37fb2e 100644 --- a/common/src/main/java/com/unlikepaladin/pfm/mixin/PFMMixinClientPacketListener.java +++ b/common/src/main/java/com/unlikepaladin/pfm/mixin/PFMMixinClientPacketListener.java @@ -18,7 +18,7 @@ public class PFMMixinClientPacketListener { private MinecraftClient client; @Inject(method = "onGameJoin", at = @At("TAIL")) - private void pfm$showUpdateMessage(GameJoinS2CPacket par1, CallbackInfo ci) { + private void pfm$showModUpdateMessage(GameJoinS2CPacket par1, CallbackInfo ci) { if (this.client.player == null) { return; }