Jump to content

Recommended Posts

Posted

So, I am starting to create a practice mod before starting on the real one and I can't for the life of me figure out what to do. Any help would be appreciated.

Here's my code so far.

 

iegUY9y.jpg

BlockLiveOre.java

package com.omar.tutorial;

import com.omar.tutorial.help.Reference;

import net.minecraft.block.*;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.*;

public class BlockLiveOre extends Block
{
public BlockLiveOre()
{
	super (Material.rock);
	setBlockName("liveOre");
	setTextureName(assets:"liveOre");
	setBlockTextureName(Reference.MODID +";" + getUnlocalizedName().substring(5));
	setCreativeTab(CreativeTabs.tabBlock);
}

}

 

Tutorial.java

package com.omar.tutorial;

import net.minecraft.block.Block;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.event.*;

import com.omar.tutorial.help.*;

@Mod(modid = Reference.MODID, version = Reference.VERSION)
public class Tutorial
{
    public static Block liveOre;

    @EventHandler
    public void preInit(FMLPreInitializationEvent event)
    {

    	liveOre = new BlockLiveOre();
    	
    	RegisterHelper.registerBlock(liveOre);
    }
}

 

Reference.java

package com.omar.tutorial.help;

public class Reference
{
public static final String MODID = "omar_tutorialmod";
    public static final String VERSION = "1.0";
}

 

RegisterHelper.java

package com.omar.tutorial.help;

import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.block.Block;

public class RegisterHelper 
{
public static void registerBlock (Block block)
{
	GameRegistry.registerBlock(block, Reference.MODID + "_" + block.getUnlocalizedName().substring(5));
}
}

 

en_US.lang

tile.liveOre.name=Live Ore

 

The texture I'm using is a 16x16 png file.

 

The name and the texture of the block are not showing in minecraft. Any help is appreciated.

Posted

Everything from the console

 

  Reveal hidden contents

 

 

Minecraft runs perfectly fine but the block has the pink and black texture and is called "tile.liveOre.png.name"

Posted

Hi

 

The clue is here...

[19:16:02] [Client thread/ERROR]: Using missing texture, unable to load minecraft:textures/blocks/omar_tutorialmod;liveOre.png.png

java.io.FileNotFoundException: minecraft:textures/blocks/omar_tutorialmod;liveOre.png.png

 

That filename looks pretty mangled up :-)

 

-TGG

Posted

I got it fixed by renaming the file and changing the omar_tutorialmod folder name to minecraft. Hopefully having the folder called minecraft does not screw everything up

Posted

[19:16:02] [Client thread/ERROR]: Using missing texture, unable to load minecraft:textures/blocks/omar_tutorialmod;liveOre.png.png

java.io.FileNotFoundException: minecraft:textures/blocks/omar_tutorialmod;liveOre.png.png

 

It's saying that it is looking for the minecraft folder. Is there anyway to make it look in the omar_tutorialmod folder? Because I followed Wuppy's tutorial step by step and the texture is not working

Posted
  On 4/29/2014 at 12:57 PM, 218omar said:

I got it fixed by renaming the file and changing the omar_tutorialmod folder name to minecraft. Hopefully having the folder called minecraft does not screw everything up

 

No, just no.

Since I'm nice, this is the proper way to do it:

In your block class:

setBlockTextureName("myAssetsFolder:myTexture");

 

where myAssetsFolder is the name of your folder within the assets folder (which you renamed to minecraft)

and myTexture is the name of the texture file (w/o extension) within myAssetsFolder/textures/blocks/

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

  Quote

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

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.