Posted August 4, 201312 yr I have been trying to give my ore textures but they just a pink and black checkerboard, Here's the code in my block file: package MOnM; import java.util.Random; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; public class MineriteOre extends Block{ public static String textureName; public MineriteOre(int par1, String textureName) { super(par1, Material.rock); setCreativeTab(CreativeTabs.tabBlock); this.textureName = textureName; } public int idDropped(int par1, Random rand, int par2){ return this.blockID; } public int quantityDropped(Random rand) { return 1; } @Override public void registerIcons(IconRegister r){ this.blockIcon = r.registerIcon(MOnM.modID + ":" + textureName); } } I looked at and tried quite a few things but still, checkerboard D:
August 4, 201312 yr Search some then you can find several posts about this Minecraft forums even has a few tutorials. Antways textures must be located at assets/modid/textures/blocks/textureName.png If you guys dont get it.. then well ya.. try harder...
August 4, 201312 yr try change @Override public void registerIcons(IconRegister r){ this.blockIcon = r.registerIcon(MOnM.modID + ":" + textureName); } to @SideOnly(Side.CLIENT) public void registerIcons(IconRegister r){ this.blockIcon = r.registerIcon(MOnM.modid + ":" + (this.getUnlocalizedName().substring(5))); }
August 4, 201312 yr Author Here's my main mod file if it helps. package MOnM; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.item.Item; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.network.NetworkMod; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; @Mod(modid = MOnM.modID, version = "0.1", name = "More Ores 'n Minerals") @NetworkMod(clientSideRequired = true, serverSideRequired = false) public class MOnM { public static final String modID = "MOnM"; public static Block MineriteOre; public static Item MineriteDust; public static Item MineriteGem; @EventHandler public void load(FMLInitializationEvent event){ MineriteOre = new MineriteOre(2000,"mineriteore").setHardness(3.0F).setLightValue(1).setUnlocalizedName("mineriteore"); registerBlock(MineriteOre, "Minerite Ore", MineriteOre.getUnlocalizedName()); GameRegistry.registerWorldGenerator(new WorldGeneratorMOnM()); } public static void registerBlock(Block block, String name, String unlocalizedName){ GameRegistry.registerBlock(block, MOnM.modID + unlocalizedName); LanguageRegistry.addName(block, name); } }
August 4, 201312 yr Your first code is right! I do it the same way! But he can not find the textures. Just create these folders inside of your eclipse: assets/yourmodnameinsmall/textures/blocks/yourTexture.png. Then he should find your texture. And that way you did it is perfect! But it could be easier .
August 4, 201312 yr modid must be lowercase, and that is how it must be EVERYWHERE! Both in your code and in your folder structure, so keep it lowercase everywhere If you guys dont get it.. then well ya.. try harder...
August 4, 201312 yr nope. My mod does not need lowercase. it works too. You will encounter issues later, trust me And if you don't just search around, or wait and see you will If you guys dont get it.. then well ya.. try harder...
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.