1
I really need help with a texture render problem
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
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
Create an account or sign in to comment.
14
1
Just a few questions. First have you fixed this, and second what version are you coding this in?
1
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
And second, I'm coding in Minecraft 1.8 and FML 1.8-11.14.1.1334
1
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
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
This is the Concrete.java in it's current state. http://pastebin.com/W0YHgWYw
1
K_the_proOkay so I think it might work if you remove the lines of code in bold from your block class:Click to revealprivate 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
Okay so I think it might work if you remove the lines of code in bold from your block class:
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.
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.
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;
}
}
@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
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
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
Hopefully it'll help
1
I think you can fix this problem by rendering the block in a different way to what your using. If you delete this
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:
The first method loads the texture for the blocks icon, and the second method applies this texture to the block. Hope this works
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"));
}
{
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);
}
@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;
}
@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
Thank you, I'm gonna try it first thing tomorrow, and hopefully it'll work
1
Could you also paste the texture code in your block class please
1
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
And this is the Mod's block class http://pastebin.com/WYC3QGJR
Hope it helps
1
Use something like imgur to give us the pictures.
1
I added some Imgur URLs instead of trying to get the image thingy to work