diff --git a/common/src/main/java/com/unlikepaladin/pfm/PaladinFurnitureModUpdateChecker.java b/common/src/main/java/com/unlikepaladin/pfm/PaladinFurnitureModUpdateChecker.java index c68b5f3d7..52dccd66f 100644 --- a/common/src/main/java/com/unlikepaladin/pfm/PaladinFurnitureModUpdateChecker.java +++ b/common/src/main/java/com/unlikepaladin/pfm/PaladinFurnitureModUpdateChecker.java @@ -186,10 +186,10 @@ public Optional getUpdateMessageServer() { if (textParts.length > 1) { MutableText component1 = Text.literal(textParts[0]); MutableText component2 = Text.literal(textParts[1]); - MutableText link = Text.literal((info.modHost)).styled(arg -> arg.withClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, info.modDownload)).withUnderline(true)); + MutableText link = Text.literal((info.modHost)).styled(arg -> arg.withClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, info.modDownload))); return Optional.of(component1.append(link).append(component2)); } else { - MutableText link = Text.literal((info.modHost)).styled(arg -> arg.withClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, info.modDownload)).withUnderline(true)); + MutableText link = Text.literal((info.modHost)).styled(arg -> arg.withClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, info.modDownload))); return Optional.of(Text.literal((textParts[0])).append(link)); } } else { 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 868b3401a..642d31978 100644 --- a/common/src/main/java/com/unlikepaladin/pfm/client/PathPackRPWrapper.java +++ b/common/src/main/java/com/unlikepaladin/pfm/client/PathPackRPWrapper.java @@ -12,7 +12,9 @@ import java.io.IOException; import java.io.InputStream; import java.util.Arrays; +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; @@ -57,10 +59,12 @@ public Set getNamespaces(ResourceType type) { @Nullable @Override - public T parseMetadata(ResourceMetadataReader metaReader) { + public T parseMetadata(ResourceMetadataReader metaReader) throws IOException { 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/PFMLanguageManagerAccessor.java b/common/src/main/java/com/unlikepaladin/pfm/mixin/PFMLanguageManagerAccessor.java index 169c8a631..b828c2db0 100644 --- a/common/src/main/java/com/unlikepaladin/pfm/mixin/PFMLanguageManagerAccessor.java +++ b/common/src/main/java/com/unlikepaladin/pfm/mixin/PFMLanguageManagerAccessor.java @@ -7,7 +7,7 @@ @Mixin(LanguageManager.class) public interface PFMLanguageManagerAccessor { - @Accessor + @Accessor("currentLanguageCode") String getCurrentLanguageCode(); @Accessor("ENGLISH_US") 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 559df2d95..8ca37fb2e 100644 --- a/common/src/main/java/com/unlikepaladin/pfm/mixin/PFMMixinClientPacketListener.java +++ b/common/src/main/java/com/unlikepaladin/pfm/mixin/PFMMixinClientPacketListener.java @@ -4,6 +4,7 @@ import net.minecraft.client.MinecraftClient; import net.minecraft.client.network.ClientPlayNetworkHandler; import net.minecraft.network.packet.s2c.play.GameJoinS2CPacket; +import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; @@ -12,11 +13,12 @@ @Mixin(ClientPlayNetworkHandler.class) public class PFMMixinClientPacketListener { + @Final @Shadow 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; } diff --git a/forge/src/main/java/com/unlikepaladin/pfm/mixin/forge/PFMMinecraftServerMixin.java b/forge/src/main/java/com/unlikepaladin/pfm/mixin/forge/PFMMinecraftServerMixin.java index f8379fe9b..82471019a 100644 --- a/forge/src/main/java/com/unlikepaladin/pfm/mixin/forge/PFMMinecraftServerMixin.java +++ b/forge/src/main/java/com/unlikepaladin/pfm/mixin/forge/PFMMinecraftServerMixin.java @@ -25,5 +25,6 @@ private void createReload(CallbackInfoReturnable> ci List resourcePacks = new ArrayList<>(cir.getReturnValue()); resourcePacks.removeIf(pack -> pack instanceof PathPackRPWrapper); PFMRuntimeResources.RESOURCE_PACK_LIST = resourcePacks; + PFMRuntimeResources.ready = true; } } diff --git a/forge/src/main/java/com/unlikepaladin/pfm/mixin/forge/PFMReloadableResourceManagerImplMixin.java b/forge/src/main/java/com/unlikepaladin/pfm/mixin/forge/PFMReloadableResourceManagerImplMixin.java index 445201b18..46ada685c 100644 --- a/forge/src/main/java/com/unlikepaladin/pfm/mixin/forge/PFMReloadableResourceManagerImplMixin.java +++ b/forge/src/main/java/com/unlikepaladin/pfm/mixin/forge/PFMReloadableResourceManagerImplMixin.java @@ -19,6 +19,7 @@ private List createReload(List packs) { List resourcePacks = new ArrayList<>(packs); resourcePacks.removeIf(pack -> pack instanceof PathPackRPWrapper); PFMRuntimeResources.RESOURCE_PACK_LIST = resourcePacks; + PFMRuntimeResources.ready = true; return packs; } } \ No newline at end of file diff --git a/forge/src/main/java/com/unlikepaladin/pfm/mixin/forge/PFMSaveLoaderMixin.java b/forge/src/main/java/com/unlikepaladin/pfm/mixin/forge/PFMSaveLoaderMixin.java index 6e7e2648f..4ab40106f 100644 --- a/forge/src/main/java/com/unlikepaladin/pfm/mixin/forge/PFMSaveLoaderMixin.java +++ b/forge/src/main/java/com/unlikepaladin/pfm/mixin/forge/PFMSaveLoaderMixin.java @@ -20,6 +20,7 @@ private List createReload(List packs) { List resourcePacks = new ArrayList<>(packs); resourcePacks.removeIf(pack -> pack instanceof PathPackRPWrapper); PFMRuntimeResources.RESOURCE_PACK_LIST = resourcePacks; + PFMRuntimeResources.ready = true; return packs; } } diff --git a/forge/src/main/java/com/unlikepaladin/pfm/registry/forge/RecipeRegistryForge.java b/forge/src/main/java/com/unlikepaladin/pfm/registry/forge/RecipeRegistryForge.java index 48501bcca..8e1c53bef 100644 --- a/forge/src/main/java/com/unlikepaladin/pfm/registry/forge/RecipeRegistryForge.java +++ b/forge/src/main/java/com/unlikepaladin/pfm/registry/forge/RecipeRegistryForge.java @@ -34,7 +34,6 @@ public static void registerRecipeSerializers(RegisterEvent event) { ); //Can't run resource gen until the recipe serializer has been registered or it dies because it needs the ID //PFMRuntimeResources.prepareAsyncResourceGen(); Had to disable async gen because Forge dies and I can't be bothered to figure out why, this is cursed enough as it is - PFMRuntimeResources.ready = true; if (PaladinFurnitureMod.getModList().contains("cookingforblockheads")) PFMCookingForBlockHeadsCompat.initBlockConnectors(); });