aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/moe/nea/firmament/mixins/AppendRepoAsResourcePack.java
blob: 22ce991c95636512caa27c6c7cfb332bf10a3ac5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package moe.nea.firmament.mixins;

import moe.nea.firmament.repo.RepoModResourcePack;
import net.fabricmc.fabric.api.resource.ModResourcePack;
import net.fabricmc.fabric.impl.resource.loader.ModResourcePackUtil;
import net.minecraft.resource.ResourceType;
import org.jetbrains.annotations.Nullable;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import java.util.List;

@Mixin(ModResourcePackUtil.class)
public class AppendRepoAsResourcePack {
    @Inject(method = "appendModResourcePacks", at = @At("TAIL"))
    private static void onAppendModResourcePack(
        List<ModResourcePack> packs,
        ResourceType type,
        @Nullable String subPath,
        CallbackInfo ci
    ) {
        RepoModResourcePack.Companion.append(packs);
    }

}