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
# Conflicts:
#	forge/src/main/java/com/unlikepaladin/pfm/mixin/forge/PFMMinecraftServerMixin.java
  • Loading branch information
UnlikePaladin committed Nov 5, 2023
2 parents ef301c2 + 85a5be8 commit 0d30cc3
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import net.minecraft.resource.ResourcePack;
import net.minecraft.resource.metadata.PackResourceMetadata;
import net.minecraft.server.MinecraftServer;
import net.minecraft.text.Text;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
Expand All @@ -21,13 +20,10 @@
@Mixin(MinecraftServer.class)
public class PFMMinecraftServerMixin {

@Inject(method = "lambda$reloadResources$15", at = @At(value = "RETURN"), cancellable = true, remap = false)
@Inject(method = "lambda$reloadResources$15", at = @At(value = "RETURN"), remap = false)
private void createReload(CallbackInfoReturnable<ImmutableList<ResourcePack>> cir) {
PFMRuntimeResources.RESOURCE_PACK_LIST = new ArrayList<>(cir.getReturnValue());
List<ResourcePack> resourcePacks = new ArrayList<>(cir.getReturnValue());
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));
cir.setReturnValue(ImmutableList.copyOf(resourcePacks));
resourcePacks.removeIf(pack -> pack instanceof PathPackRPWrapper);
PFMRuntimeResources.RESOURCE_PACK_LIST = resourcePacks;
}
}

0 comments on commit 0d30cc3

Please sign in to comment.