mirror of
https://github.com/GTNewHorizons/Angelica.git
synced 2026-11-20 04:19:40 +00:00
* Expose texture updates to API * Expose for blocks as well * Fix mistake * Fixed API
28 lines
921 B
Java
28 lines
921 B
Java
package com.gtnewhorizons.angelica.api;
|
|
|
|
import com.gtnewhorizons.angelica.mixins.interfaces.IPatchedTextureAtlasSprite;
|
|
import com.gtnewhorizons.angelica.mixins.interfaces.ITexturesCache;
|
|
import net.minecraft.client.renderer.RenderBlocks;
|
|
import net.minecraft.util.IIcon;
|
|
|
|
/**
|
|
* Exposes a method to the API that allow mods to add texture update compat
|
|
*/
|
|
@SuppressWarnings("unused")
|
|
public class TextureServices {
|
|
|
|
@SuppressWarnings("unused")
|
|
public static void updateBlockTextureAnimation(IIcon icon, RenderBlocks renderBlocks) {
|
|
if (renderBlocks instanceof ITexturesCache texturesCache) {
|
|
texturesCache.getRenderedTextures().add(icon);
|
|
}
|
|
}
|
|
|
|
@SuppressWarnings("unused")
|
|
public static void updateTextureAnimation(IIcon icon) {
|
|
if(icon instanceof IPatchedTextureAtlasSprite patchedSprite) {
|
|
patchedSprite.markNeedsAnimationUpdate();
|
|
}
|
|
}
|
|
}
|