Fix merged mod resource pack not returning all resources with the same name when asked. Closes #9194

This commit is contained in:
LexManos committed 2022-12-09 12:44:40 -08:00
1 parent c1f26d544a
commit 69eb940764
3 files changed
+46

No files matched your search

@@ -5,7 +5,12 @@
package net.minecraftforge.common.extensions;
import java.util.Collection;
import org.jetbrains.annotations.Nullable;
import net.minecraft.server.packs.PackResources;
import net.minecraft.server.packs.PackType;
import net.minecraft.server.packs.resources.ResourceManager;
import net.minecraftforge.resource.DelegatingPackResources;
public interface IForgePackResources
{
@@ -20,4 +25,14 @@ public interface IForgePackResources
default void initForNamespace(final String nameSpace) {}
default void init(final PackType packType) {}
/**
* Gets a collection of {@code PackResource} instances nested inside this pack.
* Used to merge several packs into one entry in the resource pack selection UI without
* losing the ability for each pack to return a resource in
* {@link ResourceManager#getResourceStack(ResourceLocation)}
* @return Collection of nested {@code PackResource}, or null if this pack has no children
* @see DelegatingPackResources
*/
@Nullable default Collection<PackResources> getChildren() { return null; }
}