47 lines
1.6 KiB
Java
47 lines
1.6 KiB
Java
|
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();
|
||
|
}
|
||
|
}
|