Hello!
Im trying to get a texture from a block, and use a Render class to render a quad in the world with that texture on it.
I have everything except how to actually find a block in the world, and get its texture to use in the render class.
this is what ive got so far, i need the resourcelocation from the blocks model texture. And i cant for the life of me figure out how to get it..
//IBakedModel bakedModel = mc.getRenderItem().getItemModelWithOverrides(stack, entity.world, mc.player);
IBakedModel bakedModel = mc.getBlockRendererDispatcher().getModelForState(waypoint.blockType.getDefaultState());
TextureAtlasSprite sprite = bakedModel.getQuads(waypoint.blockState, EnumFacing.EAST, 0).get(0).getSprite();
this.bindTexture(new ResourceLocation(sprite.getIconName())); //This is where i need the resource location.. I already got a block and
//blockstate and everything else imaginable, except for the resource location.
So far ive tried to create a new ResourceLocation with the name of the blocks texture, but i get a FileNotFound exception, and a black and pink square as shown in the screenshot.
Im not sure if i should create a new ResourceLocation, or get one from the blocks model?
Also not that everything works exactly like i want it with text and textures that i create. Just not when i try to grab a texture from a block.