Skip to content

Commit

Permalink
Merge branch 'architectury-1.19.2' into architectury-1.19.3
Browse files Browse the repository at this point in the history
# Conflicts:
#	common/src/main/java/com/unlikepaladin/pfm/client/PathPackRPWrapper.java
  • Loading branch information
UnlikePaladin committed Nov 12, 2023
2 parents 7cd8b20 + c8fbd79 commit 51b4022
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,10 @@ public Optional<Text> 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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -57,10 +59,12 @@ public Set<String> getNamespaces(ResourceType type) {

@Nullable
@Override
public <T> T parseMetadata(ResourceMetadataReader<T> metaReader) {
public <T> T parseMetadata(ResourceMetadataReader<T> metaReader) throws IOException {
if (metaReader.getKey().equals("pack")) {
return (T) packResourceMetadata;
}
if (PFMRuntimeResources.ready)
return delegate.get().parseMetadata(metaReader);
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

@Mixin(LanguageManager.class)
public interface PFMLanguageManagerAccessor {
@Accessor
@Accessor("currentLanguageCode")
String getCurrentLanguageCode();

@Accessor("ENGLISH_US")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@ private void createReload(CallbackInfoReturnable<ImmutableList<ResourcePack>> ci
List<ResourcePack> resourcePacks = new ArrayList<>(cir.getReturnValue());
resourcePacks.removeIf(pack -> pack instanceof PathPackRPWrapper);
PFMRuntimeResources.RESOURCE_PACK_LIST = resourcePacks;
PFMRuntimeResources.ready = true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ private List<ResourcePack> createReload(List<ResourcePack> packs) {
List<ResourcePack> resourcePacks = new ArrayList<>(packs);
resourcePacks.removeIf(pack -> pack instanceof PathPackRPWrapper);
PFMRuntimeResources.RESOURCE_PACK_LIST = resourcePacks;
PFMRuntimeResources.ready = true;
return packs;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ private List<ResourcePack> createReload(List<ResourcePack> packs) {
List<ResourcePack> resourcePacks = new ArrayList<>(packs);
resourcePacks.removeIf(pack -> pack instanceof PathPackRPWrapper);
PFMRuntimeResources.RESOURCE_PACK_LIST = resourcePacks;
PFMRuntimeResources.ready = true;
return packs;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
Expand Down

0 comments on commit 51b4022

Please sign in to comment.