forked from FabricMC/fabric
tie Fabric resource pack location with vanilla resource location, helps #79
This commit is contained in:
parent
442d057b0d
commit
08c921267a
1 changed files with 13 additions and 1 deletions
|
@ -16,8 +16,11 @@
|
|||
|
||||
package net.fabricmc.fabric.mixin.resources;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import net.fabricmc.fabric.impl.resources.ModResourcePackUtil;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.resource.DefaultClientResourcePack;
|
||||
import net.minecraft.resource.DefaultResourcePack;
|
||||
import net.minecraft.resource.ReloadableResourceManager;
|
||||
import net.minecraft.resource.ResourcePack;
|
||||
import net.minecraft.resource.ResourceType;
|
||||
|
@ -37,6 +40,15 @@ public class MixinMinecraftGame {
|
|||
|
||||
@Inject(method = "reloadResources()V", at = @At(value = "INVOKE", target = "Lnet/minecraft/resource/ReloadableResourceManager;reload(Ljava/util/List;)V", ordinal = 0), locals = LocalCapture.CAPTURE_FAILHARD)
|
||||
public void reloadResources(CallbackInfo info, List<ResourcePack> list) {
|
||||
List<ResourcePack> oldList = Lists.newArrayList(list);
|
||||
list.clear();
|
||||
for (int i = 0; i < oldList.size(); i++) {
|
||||
ResourcePack pack = oldList.get(i);
|
||||
list.add(pack);
|
||||
|
||||
if (pack instanceof DefaultClientResourcePack) {
|
||||
ModResourcePackUtil.appendModResourcePacks(list, ResourceType.ASSETS);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue