1

I really need help with a texture render problem

tobbestark's Avatar tobbestark6/8/15 1:36 pm
6/17/2015 3:42 pm
tobbestark's Avatar tobbestark
Hello there, I am tobbestark, but go ahead and call me Tobbe.
I recently started to get involved in modding, so I'm not really good at this.
But I have created a block and an item. And I have a little problem with them. I can't get the textures to render. Well, when I place my block the textures are fine, but when I hold it and the item I created they are just block and purple error blocks. Same as when I put them in item frames.
When I said I'm new to this I actually meant I'm new to the java language and FML. But I have really good knowledge in JSON coding, because I make resourcepacks. And as you use JSON files the same way in mods as in resourcepacks I know what I'm doing there.
I have searched all day for a solution, but I can get it to work right. And I don't really want to keep going with the mod before I solve this. So if you have any thoughts about how to fix this, please tell me. I would really appreciate some help.

Here's some ingame pictures of what I mean
http://imgur.com/iPxE66A
http://imgur.com/TYi0OHP
http://imgur.com/Hl0EvXa
Posted by tobbestark's Avatar
tobbestark
Level 44 : Master Architect
60

Create an account or sign in to comment.

14

1
06/13/2015 12:19 am
Level 48 : Master Modder
Jedispencer
Jedispencer's Avatar
Just a few questions. First have you fixed this, and second what version are you coding this in?
1
06/17/2015 3:42 pm
Level 44 : Master Architect
tobbestark
tobbestark's Avatar
Nope, I kinda layed this aside for a moment, cause I don't relly java yet.
And second, I'm coding in Minecraft 1.8 and FML 1.8-11.14.1.1334
1
06/12/2015 12:01 pm
Level 24 : Expert Modder
Laurence53
Laurence53's Avatar
Could I have your current block class please?
Nice to hear you've fixed some errors - Also I don't think you will need another icon register class (I don't use one) I'm probably just forgetting some major part of code
1
06/17/2015 3:40 pm
Level 44 : Master Architect
tobbestark
tobbestark's Avatar
This is the Concrete.java in it's current state. http://pastebin.com/W0YHgWYw
1
06/09/2015 4:42 pm
Level 44 : Master Architect
tobbestark
tobbestark's Avatar
K_the_proOkay so I think it might work if you remove the lines of code in bold from your block class:
Click to reveal
private Object blockIcon;

Click to reveal
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int face, int metadata){
Icon blockIcon = concrete;
return blockIcon;
}
}

You can delete the first line of code as there is already a .blockIcon in Minecraft's block class so you can just use that one instead of making a new one.
The next line of code should be removed as you already told the .blockIcon what it is when you registered the Icon and so doing it again is pointless.

These are just some minor tweeks but they should hopefully fix your problem.
If they don't please post me your block class again - Thanks

p.s.
by Thomas999 » Today
I know that you probably code this whole Mod yourself, but there is a program called: MCCreator if you need help to code blocks and stuff (It codes it for you. You just need the textures and models)

MCreator may be useful to fix this problem, but I wouldn't use it as many mod sites (like planetminecraft) don't allow mods made by it.


It fixed some errors, I still probably have to create a different class to IconRegister. But I don't really know what to do with it. Thanks for all your help
1
06/09/2015 11:39 am
Level 24 : Expert Modder
Laurence53
Laurence53's Avatar
Okay so I think it might work if you remove the lines of code in bold from your block class:
Click to reveal
private Object blockIcon;

Click to reveal
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int face, int metadata){
Icon blockIcon = concrete;
return blockIcon;
}
}

You can delete the first line of code as there is already a .blockIcon in Minecraft's block class so you can just use that one instead of making a new one.
The next line of code should be removed as you already told the .blockIcon what it is when you registered the Icon and so doing it again is pointless.

These are just some minor tweeks but they should hopefully fix your problem.
If they don't please post me your block class again - Thanks

p.s.
by Thomas999 » Today
I know that you probably code this whole Mod yourself, but there is a program called: MCCreator if you need help to code blocks and stuff (It codes it for you. You just need the textures and models)

MCreator may be useful to fix this problem, but I wouldn't use it as many mod sites (like planetminecraft) don't allow mods made by it.
1
06/09/2015 10:20 am
Level 67 : High Grandmaster Senpai
Stubbs1
Stubbs1's Avatar
I know that you probably code this whole Mod yourself, but there is a program called: MCCreator if you need help to code blocks and stuff (It codes it for you. You just need the textures and models)
1
06/09/2015 5:01 am
Level 44 : Master Architect
tobbestark
tobbestark's Avatar
I still have the same problem, nothing really happend. Here's the new classes http://pastebin.com/FCXMvw56 http://pastebin.com/qDsC8wB1
Hopefully it'll help
1
06/08/2015 4:13 pm
Level 24 : Expert Modder
Laurence53
Laurence53's Avatar
I think you can fix this problem by rendering the block in a different way to what your using. If you delete this
Click to reveal
public static void registerRenders()
{
registerRender(concrete);
}

public static void registerRender(Block block)
{
Item item = Item.getItemFromBlock(block);
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(Reference.MOD_ID + ":" + item.getUnlocalizedName().substring(5), "inventory"));
}

and register the texture in your block class it should work. To do this go into your Block class (Concrete.java) and paste in these methods:
Click to reveal
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister icon)
{
this.blockIcon = icon.registerIcon(TEXTURE LOCATION);
}

Click to reveal
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int face, int metadata){
return blockIcon;
}


The first method loads the texture for the blocks icon, and the second method applies this texture to the block. Hope this works
1
06/08/2015 5:10 pm
Level 44 : Master Architect
tobbestark
tobbestark's Avatar
Thank you, I'm gonna try it first thing tomorrow, and hopefully it'll work
1
06/08/2015 3:18 pm
Level 24 : Expert Modder
Laurence53
Laurence53's Avatar
Could you also paste the texture code in your block class please
1
06/08/2015 3:44 pm
Level 44 : Master Architect
tobbestark
tobbestark's Avatar
Well this is the actual block class to the concrete block http://pastebin.com/A8ziTS1Q
And this is the Mod's block class http://pastebin.com/WYC3QGJR
Hope it helps
1
06/08/2015 3:01 pm
Level 33 : Artisan Engineer
RoboShadow
RoboShadow's Avatar
Use something like imgur to give us the pictures.
1
06/08/2015 3:46 pm
Level 44 : Master Architect
tobbestark
tobbestark's Avatar
I added some Imgur URLs instead of trying to get the image thingy to work
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome