Jump to content

Recommended Posts

Posted

Hello Modders!

 

Im new to forge, just recently made my huge plans for next mods, but I got stuck on such simple thing..., adding textures, I get error in Forge console, it says texture file couldn't be found and therefore it uses just a weird checkers texture..., please don't think that there is mistake in my code, I double and triple checked it, but I here it is anyways:

 

I have a java package called assets.testmod.src and I have two files there, TestMod.java, which is basically the main class, and ModInfo.java - where all the @Mod data is. I also have another package inside this package called assets.testmod.src.block, where I was adding my blocks. I have one file called TestBlock.java there.

 

 

So, TestMod.java:

 

 

package assets.testmod.src;

 

 

import assets.testmod.src.blocks.TestBlock;

import net.minecraft.block.Block;

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.FMLPostInitializationEvent;

import cpw.mods.fml.common.event.FMLPreInitializationEvent;

import cpw.mods.fml.common.event.FMLServerStartingEvent;

import cpw.mods.fml.common.registry.GameRegistry;

import cpw.mods.fml.common.registry.LanguageRegistry;

 

 

@Mod (modid = ModInfo.MODID, name = ModInfo.NAME, version = ModInfo.VERSION)

 

 

public class TestMod {

 

public static final Block testBlock = new TestBlock(3000).setUnlocalizedName("testBlock");

 

@Mod.Instance(ModInfo.MODID)

public static TestMod mod;

 

@EventHandler

public void Init (FMLInitializationEvent event)

{

GameRegistry.registerBlock(testBlock);

LanguageRegistry.addName(testBlock, "Test Block");

}

}

 

 

 

TestBlock.java:

 

 

package assets.testmod.src.blocks;

 

 

import net.minecraft.block.Block;

import net.minecraft.block.material.Material;

import net.minecraft.client.renderer.texture.IconRegister;

import net.minecraft.creativetab.CreativeTabs;

import assets.testmod.src.ModInfo;

import cpw.mods.fml.relauncher.Side;

import cpw.mods.fml.relauncher.SideOnly;

 

 

public class TestBlock extends Block {

 

 

public TestBlock(int par1) {

super (par1, Material.iron);

this.setHardness(3.0F);

this.setResistance(-1);

this.setCreativeTab(CreativeTabs.tabBlock);

}

 

@SideOnly(Side.CLIENT)

public void registerIcons(IconRegister tex) {

this.blockIcon = tex.registerIcon(ModInfo.MODID + ":testBlock");

}

 

 

}

 

 

 

To be more precise I put my block texture file in /forge/mcp/src/minecraft/assets/testmod/src/textures/blocks, the file called testBlock.png.

 

 

Hopefully I will solve this problem, I literally have tried everything, googled everywhere, but nothing worked for me... By the way I am using Eclipse, got JDK installed, Java 7 installed (obviously), system is MacOS X 10.8.4

 

 

Thanks for your help!

Yours faithfully,

AlenEviLL.

Posted

wrong:

/forge/mcp/src/minecraft/assets/testmod/src/textures/blocks

 

nope

 

right:

/forge/mcp/src/minecraft/assets/testmod/textures/blocks

 

 

please refer to "hydroflame guide to textures" on the wiki for further information :)

 

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Posted

guide says block texture goes:

 

mcp/src/minecraft/*modid*/textures/blocks/

 

 

if the mod is called "src" then remove "testmod"

:)

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Posted

hydroflame, omg thank you so much it worked!!! So I basically have to put all files in modid folder, not the mod folder itself. Thank you very much, I should have asked this question before, I stuck on this issue for two days  :)

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.