crazyjackel Posted June 20, 2016 Share Posted June 20, 2016 okay choonstar in the last post you attempt to explain how to do modelloader, trust me i got lost, but anyway this is a new post about the white box and how to fix first attempt to bind a texture: -failed public class RenderEssenceSplash extends RenderSnowball { public RenderEssenceSplash(RenderManager renderManagerIn) { super(renderManagerIn, Main.EssenceSplash, Minecraft.getMinecraft().getRenderItem()); this.bindTexture(new ResourceLocation("essence:EssenceSplash")); } } second attempt: -failrf public class RenderEssenceSplash extends RenderSnowball { public RenderEssenceSplash(RenderManager renderManagerIn) { super(renderManagerIn, Main.EssenceSplash, Minecraft.getMinecraft().getRenderItem()); } @Override public void doRender(Entity entity, double x, double y, double z, float entityYaw, float partialTicks){ this.bindTexture(new ResourceLocation("essence:EssenceSplash")); } } third attempt: -failed public class RenderEssenceSplash extends RenderSnowball { public RenderEssenceSplash(RenderManager renderManagerIn) { super(renderManagerIn, Main.EssenceSplash, Minecraft.getMinecraft().getRenderItem()); } public void doRender(){ this.bindTexture(new ResourceLocation("essence:EssenceSplash")); } } at least 15 other attempts - failed so yeah i am rendering and also attempting to bind texture, but the texture isnt being bound, dont really understand why it isnt working as the ResourceLocation worked when i was binding it for Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register i still dont understand ModelLoader and ModelBakery Quote Link to comment Share on other sites More sharing options...
Choonster Posted June 20, 2016 Share Posted June 20, 2016 If you want to change the texture used to render an entity, override Render#getEntityTexture . That's not what you want to do here though. RenderSnowball already handles the model and texture for you, you just need to pass it the right Item in the constructor (and override RenderSnowball#getStackToRender if you want to use custom metadata/NBT/capabilities). If an entity is rendering as a white box, it hasn't had a Render registered for it. You must do this by calling RenderingRegistry#registerEntityRenderingHandler(Class<T>, IRenderFactory<? super T>) in preInit. The ModelResourceLocation passed to ItemModelMesher#register or ModelLoader.setCustomModelResourceLocation points to a model (the clue is in the name). Render#bindTexture expects the ResourceLocation to point to a texture. Textures and models are not the same thing. Quote Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future. Link to comment Share on other sites More sharing options...
crazyjackel Posted June 20, 2016 Author Share Posted June 20, 2016 okay i attempted changing a few things, but i cant find the issue, probably because i am a newb, but hopefully if i give you the code you can point me in the right direction. honestly, i need to find a mentor for this kind of things. http://pastebin.com/4b8H1J7b http://pastebin.com/BNEzadeu http://pastebin.com/ciqGM0Ar Quote Link to comment Share on other sites More sharing options...
Choonster Posted June 20, 2016 Share Posted June 20, 2016 diesieben07 answered before I could (and noticed that you were handling the wrong event), but here are some other things that I noticed: Entity isn't a singleton class like Block , Item or Potion ; don't store an instance of it (or a subclass) in a static field. Don't bother having a PreInitializationEvent parameter in Common#preInit if you're just going to pass null . Either pass a real value or remove the parameter. Your package name should include your name and your mod name (e.g. com.<yourname>.<modname> ). Don't use src in the package name. You should follow Java naming conventions: PascalCase for class, interface and enum names; camelCase for field, method, parameter and local variable names and UPPER_CASE for constants. You should also follow MCP naming conventions by prefixing your class names with the supertype, e.g. ItemMormonBook rather than MormonBookItem . Your proxy classes should have "proxy" somewhere in the class or package name. Quote Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future. Link to comment Share on other sites More sharing options...
crazyjackel Posted June 20, 2016 Author Share Posted June 20, 2016 hey choonstar (or someone else) can you send me the list of mcp naming conventions, just so in the future it will be easier to understand my buggy code Quote Link to comment Share on other sites More sharing options...
Choonster Posted June 20, 2016 Share Posted June 20, 2016 hey choonstar (or someone else) can you send me the list of mcp naming conventions, just so in the future it will be easier to understand my buggy code There is no list, it's mainly just the one convention (prefix your class names with the super type). For examples, simply look at the vanilla class names; these are all assigned by MCP. This section of Forge's official documentation briefly outlines the recommended way to structure your mod, including how to name your classes. Quote Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future. Link to comment Share on other sites More sharing options...
Choonster Posted June 20, 2016 Share Posted June 20, 2016 Your package name should include your name and your mod name (e.g. com.<yourname>.<modname> ). Since I see you mention this again, I have to say this: If you don't own "xyz.com", do not use "com.xyz" as your package name. Package names are tied to domain names. Many people use "me.<name>", but I would prefer "mod.<modID>", since "mod" is not a real TLD. That's a good point. I should probably repackage my code at some point. Quote Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future. Link to comment Share on other sites More sharing options...
crazyjackel Posted June 20, 2016 Author Share Posted June 20, 2016 i am very thankful for all the help you both have given me, and i really hope that you guys find at least a 20$ bill and a essence potion someone on the street also i changed my package name to mod.essence.essence Quote Link to comment Share on other sites More sharing options...
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.