Posted April 17, 20205 yr I'm trying to register a sprite to a Texture Atlas to draw later on. Here is my stitching code: @Mod.EventBusSubscriber(modid = MODID, value = Dist.CLIENT, bus = Mod.EventBusSubscriber.Bus.MOD) public class SymbolTextures { public static final ResourceLocation DEBUG = new ResourceLocation(MODID , "textures/symbols/symbol_x.png"); @SubscribeEvent public static void onStitchEvent(TextureStitchEvent.Pre event) { ResourceLocation stitching = event.getMap().getTextureLocation(); if(!stitching.equals(AtlasTexture.LOCATION_BLOCKS_TEXTURE)) { return; } //TODO do this programmatically from registry boolean added = event.addSprite(DEBUG); } } (added ends up as true here) And here is where I'm trying to grab it: public static void renderSymbol(DrawnSymbol symbol, MatrixStack matrix) { assert Minecraft.getInstance().world != null; IRenderTypeBuffer buffer = Minecraft.getInstance().getRenderTypeBuffers().getBufferSource(); IVertexBuilder builder = buffer.getBuffer(RenderType.getTranslucent()); TextureAtlasSprite sprite = Minecraft.getInstance().getAtlasSpriteGetter(AtlasTexture.LOCATION_BLOCKS_TEXTURE).apply(symbol.getTexture()); } in this case, symbol.getTexture() will return SymbolTextures.DEBUG. I only ever get "minecraft:missingno" returned as sprite. Does anybody have some experience with this? Am I doing something wrong?
April 18, 20205 yr Author Figured it out. ResourceLocation is expecting "symbols/symbol_x" instead of "textures/symbols/symbol_x.png". Apparently it knows where the textures are at.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.