ThePhysician2000 Posted August 25, 2014 Posted August 25, 2014 So I have my modeled block, and I was wondering how do I load a texture-mapped skin for a modeled block? Here is the screenshot of the block: http://imgur.com/GlTG20D It doesn't use Tessellators, and I was hoping that I could load textures similar to chests, but couldn't find a single tutorial that worked. Any idea how to do this? Quote Check out my furniture mod! http://www.minecraftforge.net/forum/index.php/topic,23785.0.html
Black Posted August 25, 2014 Posted August 25, 2014 Is that techne or wavefront? Seems Techne-like. Wavefront is a simple matter of creating a new resourcelocation and binding the texture before rendering the model. You can find an tutorial here: http://www.minecraftforge.net/wiki/Using_wavefront_model If it is techne: In techne: http://www.minecraftforge.net/wiki/Modelling_in_Techne http://pixelmon.wikia.com/wiki/Using_Texture_Maps_In_Techne And code: http://www.minecraftforge.net/wiki/Using_Your_Techne_Model Quote
ThePhysician2000 Posted August 26, 2014 Author Posted August 26, 2014 Is that techne or wavefront? Seems Techne-like. Wavefront is a simple matter of creating a new resourcelocation and binding the texture before rendering the model. You can find an tutorial here: http://www.minecraftforge.net/wiki/Using_wavefront_model If it is techne: In techne: http://www.minecraftforge.net/wiki/Modelling_in_Techne http://pixelmon.wikia.com/wiki/Using_Texture_Maps_In_Techne And code: http://www.minecraftforge.net/wiki/Using_Your_Techne_Model Yes it is Techne, but so far neither of those methods worked. Quote Check out my furniture mod! http://www.minecraftforge.net/forum/index.php/topic,23785.0.html
Eternaldoom Posted August 26, 2014 Posted August 26, 2014 Post your code. Quote Check out my mod, Realms of Chaos, here. If I helped you, be sure to press the "Thank You" button!
ThePhysician2000 Posted August 26, 2014 Author Posted August 26, 2014 Post your code. Here is (or at least, what I am lead to believe is) the code you want. TileEntity(block): package net.thephysician2000sfurniture; import java.util.Set; import org.lwjgl.opengl.GL11; import net.minecraft.entity.Entity; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; public class TileEntityTableOne extends TileEntity{ public final ResourceLocation table_oak = new ResourceLocation(MainClass.MODID, "textures/model/table_oak.png"); { this.bindTexture(table_oak); } private void bindTexture(ResourceLocation table_oak) { table_oak = new ResourceLocation(MainClass.MODID, "textures/model/table_oak.png"); } } TileEntityRenderer(block): package net.thephysician2000sfurniture; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.entity.Entity; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; import org.lwjgl.opengl.GL11; public class TileEntityTableOneRender extends TileEntitySpecialRenderer { private final Table model; private int textureWidth = 64; private int textureHight = 32; public TileEntityTableOneRender() { this.model = new Table(); } private void adjustRotatePivotViaMeta(World world, int x, int y, int z) { int meta = world.getBlockMetadata(x, y, z); GL11.glPushMatrix(); GL11.glRotatef(meta * (-90), 0.0F, 0.0F, 1.0F); GL11.glPopMatrix(); } @Override public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) { GL11.glPushMatrix(); GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); this.model.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); GL11.glPopMatrix(); } } Quote Check out my furniture mod! http://www.minecraftforge.net/forum/index.php/topic,23785.0.html
Eternaldoom Posted August 26, 2014 Posted August 26, 2014 Below the glTranslatef, add the following: ResourceLocation table_oak = new ResourceLocation(MainClass.MODID, "textures/model/table_oak.png"); Minecraft.getMinecraft().renderEngine.bindTexture(table_oak); You do not need any code in the actual TileEntity. Quote Check out my mod, Realms of Chaos, here. If I helped you, be sure to press the "Thank You" button!
ThePhysician2000 Posted August 26, 2014 Author Posted August 26, 2014 Below the glTranslatef, add the following: ResourceLocation table_oak = new ResourceLocation(MainClass.MODID, "textures/model/table_oak.png"); Minecraft.getMinecraft().renderEngine.bindTexture(table_oak); You do not need any code in the actual TileEntity. Thanks, but it didn't work. Quote Check out my furniture mod! http://www.minecraftforge.net/forum/index.php/topic,23785.0.html
Eternaldoom Posted August 26, 2014 Posted August 26, 2014 What is the MODID? Quote Check out my mod, Realms of Chaos, here. If I helped you, be sure to press the "Thank You" button!
ThePhysician2000 Posted August 26, 2014 Author Posted August 26, 2014 What is the MODID? MODID: thephysician2000sfurnituremod File location: assets\thephysician2000sfurnituremod\textures\model\table_oak.png Quote Check out my furniture mod! http://www.minecraftforge.net/forum/index.php/topic,23785.0.html
Eternaldoom Posted August 26, 2014 Posted August 26, 2014 Make sure the modid is all lowercase and try changing the resource location to new ResourceLocation(MainClass.MODID + ":textures/model/table_oak.png") Quote Check out my mod, Realms of Chaos, here. If I helped you, be sure to press the "Thank You" button!
ThePhysician2000 Posted August 26, 2014 Author Posted August 26, 2014 Make sure the modid is all lowercase and try changing the resource location to new ResourceLocation(MainClass.MODID + ":textures/model/table_oak.png") Still didn't work. Quote Check out my furniture mod! http://www.minecraftforge.net/forum/index.php/topic,23785.0.html
TheGreyGhost Posted August 26, 2014 Posted August 26, 2014 hi post your error log? (Look for "using missing texture, unable to load") -TGG Quote
ThePhysician2000 Posted August 27, 2014 Author Posted August 27, 2014 hi post your error log? (Look for "using missing texture, unable to load") -TGG Took a look, and this is what you get when you place the block in the world: [20:11:32] [server thread/INFO]: ForgeDevName joined the game [20:11:34] [server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 2013ms behind, skipping 40 tick(s) [20:11:37] [Client thread/WARN]: Failed to load texture: thephysician2000sfurnituremod:textures/model/table_oak.png java.io.FileNotFoundException: thephysician2000sfurnituremod:textures/model/table_oak.png at net.minecraft.client.resources.SimpleReloadableResourceManager.getResource(SimpleReloadableResourceManager.java:71) ~[simpleReloadableResourceManager.class:?] at net.minecraft.client.renderer.texture.SimpleTexture.loadTexture(SimpleTexture.java:35) ~[simpleTexture.class:?] at net.minecraft.client.renderer.texture.TextureManager.loadTexture(TextureManager.java:89) [TextureManager.class:?] at net.minecraft.client.renderer.texture.TextureManager.bindTexture(TextureManager.java:45) [TextureManager.class:?] at thephysician2000sfurniture.TileEntityTableOneRender.renderTileEntityAt(TileEntityTableOneRender.java:39) [TileEntityTableOneRender.class:?] at net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher.renderTileEntityAt(TileEntityRendererDispatcher.java:141) [TileEntityRendererDispatcher.class:?] at net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher.renderTileEntity(TileEntityRendererDispatcher.java:126) [TileEntityRendererDispatcher.class:?] at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:545) [RenderGlobal.class:?] at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1308) [EntityRenderer.class:?] at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1099) [EntityRenderer.class:?] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1066) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:961) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:164) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_11] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_11] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_11] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_11] at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) [launchwrapper-1.9.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_11] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_11] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_11] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_11] at GradleStart.bounce(GradleStart.java:107) [start/:?] at GradleStart.startClient(GradleStart.java:100) [start/:?] at GradleStart.main(GradleStart.java:55) [start/:?] I've highlighted what I think is the problem. And, yes, the file is there. Quote Check out my furniture mod! http://www.minecraftforge.net/forum/index.php/topic,23785.0.html
Eternaldoom Posted August 27, 2014 Posted August 27, 2014 It can't find the texture file. Post a screenshot of your file hierarchy. Quote Check out my mod, Realms of Chaos, here. If I helped you, be sure to press the "Thank You" button!
TheGreyGhost Posted August 27, 2014 Posted August 27, 2014 Hi Some of the tips in this link might be helpful. http://www.minecraftforge.net/forum/index.php/topic,18371.msg92948.html#msg92948 If you know how to use a debugger, this could help too http://www.minecraftforge.net/forum/index.php/topic,11963.0.html -TGG Quote
ThePhysician2000 Posted August 27, 2014 Author Posted August 27, 2014 It can't find the texture file. Post a screenshot of your file hierarchy. Here: http://imgur.com/1u8kEt7 Quote Check out my furniture mod! http://www.minecraftforge.net/forum/index.php/topic,23785.0.html
Eternaldoom Posted August 27, 2014 Posted August 27, 2014 Do your other textures work? Quote Check out my mod, Realms of Chaos, here. If I helped you, be sure to press the "Thank You" button!
Eternaldoom Posted August 27, 2014 Posted August 27, 2014 Found the problem. Your modid is thephysician2000sfurnituremod, but your assets directory is thephysician2000sfurniture. Rename the directory to thephysician2000sfurnituremod, or change your modid to thephysician2000sfurniture. Quote Check out my mod, Realms of Chaos, here. If I helped you, be sure to press the "Thank You" button!
ThePhysician2000 Posted August 27, 2014 Author Posted August 27, 2014 Found the problem. Your modid is thephysician2000sfurnituremod, but your assets directory is thephysician2000sfurniture. Rename the directory to thephysician2000sfurnituremod, or change your modid to thephysician2000sfurniture. Changed the MODID, and it worked! Thank you very much! Quote Check out my furniture mod! http://www.minecraftforge.net/forum/index.php/topic,23785.0.html
Recommended Posts
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.