ForgePatch/src/main/java/net/minecraftforge/client/extensions/IForgeTextureAtlasSprite.java

47 lines
1.6 KiB
Java
Raw Normal View History

2018-12-21 22:45:35 +00:00
package net.minecraftforge.client.extensions;
import java.util.Collection;
import java.util.function.Function;
import com.google.common.collect.ImmutableList;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.resources.IResourceManager;
import net.minecraft.util.ResourceLocation;
public interface IForgeTextureAtlasSprite
{
/**
* The result of this function determines is the below 'load' function is called, and the
* default vanilla loading code is bypassed completely.
* @param manager Main resource manager
* @param location File resource location
* @return True to use your own custom load code and bypass vanilla loading.
*/
default boolean hasCustomLoader(IResourceManager manager, ResourceLocation location)
{
return false;
}
/**
* Load the specified resource as this sprite's data.
* Returning false from this function will prevent this icon from being stitched onto the master texture.
* @param manager Main resource manager
* @param location File resource location
* @param textureGetter accessor for dependencies. All of them will be loaded before this one
* @return False to prevent this Icon from being stitched
*/
default boolean load(IResourceManager manager, ResourceLocation location, Function<ResourceLocation, TextureAtlasSprite> textureGetter)
{
return true;
}
/**
* @return all textures that should be loaded before this texture.
*/
default Collection<ResourceLocation> getDependencies()
{
return ImmutableList.of();
}
}