Jump to content

alven

Members
  • Posts

    1
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

alven's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Hi, I have problem with loading texture for my custom block. Console keep saying : Using missing texture, unable to load... and I cant solve it. I think i have textures in right folder but they still dont work. What is strange is that my language file works. Here is BlockrockBrick.java: package com.alven4; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.*; public class BlockrockBrick extends Block { public BlockrockBrick(Material rock) { super(Material.rock); setBlockName("rockBrick"); setBlockTextureName(MOD.MODID+":"+"rockBrick"); setCreativeTab(CreativeTabs.tabBlock); // TODO Auto-generated constructor stub }} My folder system looks: src/main/ java com/alven4 MOD.java BlockrockBrick.java resources/assets/MOD lang/en_US.lang textures/blocks/rockBrick.png And here my main code: package com.alven4; import java.io.File; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; 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.event.FMLPreInitializationEvent; import cpw.mods.fml.common.registry.GameRegistry; @Mod(modid = MOD.MODID, version = MOD.VERSION) public class MOD { public static final String MODID = "MOD"; public static final String VERSION = "4.0"; public static Block rockBrick; @EventHandler public void preinit(FMLPreInitializationEvent event) { rockBrick = new BlockrockBrick(null); GameRegistry.registerBlock(rockBrick, "rockBrick"); ItemStack starStack = new ItemStack(Items.nether_star); GameRegistry.addRecipe(new ItemStack(Blocks.command_block,1), new Object[]{"121","212","121", '1',starStack,'2',new ItemStack(Blocks.bedrock)}); GameRegistry.addShapelessRecipe(new ItemStack(Items.iron_ingot,1), new Object[]{ new ItemStack(Blocks.rail),new ItemStack(Blocks.rail),new ItemStack(Blocks.rail),new ItemStack(Blocks.rail) }); GameRegistry.addSmelting(Blocks.diamond_block, new ItemStack(Blocks.lava), (float) 0.001); GameRegistry.addRecipe(new ItemStack(Blocks.bedrock), new Object[]{ "LLL","LLL","LLL",'L',new ItemStack(Blocks.lava) }); } @EventHandler public void init(FMLInitializationEvent event) { // some example code System.out.println("DIRT BLOCK >> "+Blocks.dirt.getUnlocalizedName()); } }
×
×
  • Create New...

Important Information

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