Jump to content

[SOLVED](1.6.2) Textures


MINERGUY67880

Recommended Posts

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:

Link to comment
Share on other sites

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)));
}

Link to comment
Share on other sites

 

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);
	}
}

 

Link to comment
Share on other sites

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 xD.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.