lundi 2 mars 2015

Block textures and block names not loading minecraft forge



I am making a mod for minecraft but I can't get the textures to load: enter image description here


Also the names dont show up correctly (tile.Yarrite Ore.Name instead of Yarrite Ore): enter image description here


here is the code I used to Create the block(YarriteOre.java):



package com.NoNameYetMod.common;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;

public class YarriteOre extends Block{
public YarriteOre(int id,Material mat) {
super(mat);
this.setCreativeTab(CreativeTabs.tabBlock);
}

@Override
public void registerBlockIcons(IIconRegister p_149651_1_){
this.blockIcon = p_149651_1_.registerIcon("NoNameYetMod:Yarrite Ore");
}
}


and here is the mod.java file in which I register the block in the game:



package com.NoNameYetMod.common;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Metadata;
import cpw.mods.fml.common.ModMetadata;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.registry.GameRegistry;

@Mod(modid = "NoNameYetMod", name = "The \"No Name\" Yet Mod", version = "1.0.0 (Warning: Alpha!)")

public class NoNameYetMod{

@Metadata
public static ModMetadata meta;
//Yarrite
public static Block YarriteOre;
int YarriteOreID = 1001;

@EventHandler
public void init(FMLPreInitializationEvent event){
//Yarrit
YarriteOre = new YarriteOre(YarriteOreID, Material.rock).setHardness(1.5F).setBlockName("Yarrite Ore");

}


I tried renaming the icon to Yarrite Ore, Yarrite and YarritOre but none of them work! does anybody know what I'm doing wrong?


EDIT: I also tried .Png and .JPeg files but non of them worked...


EDIT: I have the items in the src/main/resources/assets/NoNameYetMod/Textures/blocks folder.




Aucun commentaire:

Enregistrer un commentaire