Skip to content

Commit

Permalink
Merge branch 'architectury-1.18.2' into architectury-1.19.2
Browse files Browse the repository at this point in the history
  • Loading branch information
UnlikePaladin committed Nov 5, 2023
2 parents 0d30cc3 + 8fb3fe5 commit 3b184d9
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 6 deletions.
1 change: 0 additions & 1 deletion common/src/main/resources/pfm-common.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"mixins": [
"PFMDataCache$CachedDataMixin",
"PFMPlayerInventoryMixin",
"PFMSaveLoaderMixin",
"PFMTextureKeyFactory"
],
"server": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package com.unlikepaladin.pfm.mixin;
package com.unlikepaladin.pfm.mixin.fabric;


import com.google.common.base.Suppliers;
import com.mojang.bridge.game.PackType;
Expand Down Expand Up @@ -26,7 +27,9 @@ private List<ResourcePack> createReload(List<ResourcePack> packs) {
List<ResourcePack> resourcePacks = new ArrayList<>(packs);
PackResourceMetadata packResourceMetadata = new PackResourceMetadata(Text.literal("pfm-runtime-resources"), SharedConstants.getGameVersion().getPackVersion(PackType.RESOURCE));
resourcePacks.add(new PathPackRPWrapper(Suppliers.memoize(() -> {
PFMRuntimeResources.prepareAndRunResourceGen(false); return PFMRuntimeResources.ASSETS_PACK;}), packResourceMetadata));
PFMRuntimeResources.prepareAndRunResourceGen(false);
return PFMRuntimeResources.ASSETS_PACK;
}), packResourceMetadata));
return resourcePacks;
}
}
}
3 changes: 2 additions & 1 deletion fabric/src/main/resources/pfm.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"PFMCookingPotBlockEntityMixin",
"PFMMinecraftServerMixin",
"PFMMixinPointOfInterestType",
"PFMReloadableResourceManagerImplMixin"
"PFMReloadableResourceManagerImplMixin",
"PFMSaveLoaderMixin"
],
"injectors": {
"defaultRequire": 1
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.unlikepaladin.pfm.mixin.forge;

import com.unlikepaladin.pfm.client.PathPackRPWrapper;
import com.unlikepaladin.pfm.runtime.PFMRuntimeResources;
import net.minecraft.resource.ResourcePack;
import net.minecraft.server.SaveLoader;
import net.minecraft.server.SaveLoading;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyArg;

import java.util.ArrayList;
import java.util.List;

@Mixin(SaveLoading.DataPacks.class)
public class PFMSaveLoaderMixin {

@ModifyArg(method = "load", at = @At(value = "INVOKE", target = "Lnet/minecraft/resource/LifecycledResourceManagerImpl;<init>(Lnet/minecraft/resource/ResourceType;Ljava/util/List;)V"), index = 1)
private static List<ResourcePack> createReload(List<ResourcePack> packs) {
List<ResourcePack> resourcePacks = new ArrayList<>(packs);
resourcePacks.removeIf(pack -> pack instanceof PathPackRPWrapper);
PFMRuntimeResources.RESOURCE_PACK_LIST = resourcePacks;
return packs;
}
}
3 changes: 2 additions & 1 deletion forge/src/main/resources/pfm.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
"mixins": [
"PFMAbstractTagProvider$ObjectBuilderMixin",
"PFMCookingPotBlockEntityMixin",
"PFMMinecraftServerMixin",
"PFMReloadableResourceManagerImplMixin",
"PFMMinecraftServerMixin"
"PFMSaveLoaderMixin"
],
"injectors": {
"defaultRequire": 1
Expand Down

0 comments on commit 3b184d9

Please sign in to comment.