Update TextureStitchEvent.Pre to give access to the list of ResourceLocations that will be loaded as textures. (#5870)

This commit is contained in:
primetoxinz authored and LexManos committed 2019-07-03 12:26:51 -07:00
1 parent bc23c1ddb2
commit 765efc3c72
3 files changed
+35 -17

No files matched your search

@@ -19,9 +19,12 @@
package net.minecraftforge.client.event;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.eventbus.api.Event;
import net.minecraft.client.renderer.texture.AtlasTexture;
import java.util.Set;
public class TextureStitchEvent extends Event
{
@@ -38,17 +41,29 @@ public class TextureStitchEvent extends Event
}
/**
* Fired when the TextureMap is told to refresh it's stitched texture.
* Called after the Stitched list is cleared, but before any blocks or items
* add themselves to the list.
* Fired when the TextureMap is told to refresh it's stitched texture.
* Called before the {@link net.minecraft.client.renderer.texture.TextureAtlasSprite} are loaded.
*/
public static class Pre extends TextureStitchEvent
{
public Pre(AtlasTexture map){ super(map); }
private final Set<ResourceLocation> sprites;
public Pre(AtlasTexture map, Set<ResourceLocation> sprites)
{
super(map);
this.sprites = sprites;
}
/**
* Add a sprite to be stitched into the Texture Atlas.
*/
public boolean addSprite(ResourceLocation sprite) {
return this.sprites.add(sprite);
}
}
/**
* This event is fired once the texture map has loaded all textures and
* This event is fired once the texture map has loaded all textures and
* stitched them together. All Icons should have there locations defined
* by the time this is fired.
*/