Jump to content

Textures?! Where to place?


BreezerTwo

Recommended Posts

Hello everybody,

 

Im so glad that Forge1.7.2 is out now and I figured out now how to start a project with it! :)

I started  updating all my mods today(as far as possible) but I  have still two problems:

 

where I have to place the textures?

Is this the right methode for it?

 

public void func_149651_a(IIconRegister p_149651_1_)
    {
        this.field_149761_L = p_149651_1_.registerIcon("me:transparent.png");
    }

 

Thanks for all of your help!

 

Andy

Link to comment
Share on other sites

There is an easier way to register textures. If you have item, in Item's method write

this.setTextureName("me:transparent");

I don't know whether it's work for block but must work too.

There is structure of assets to your mod

VUru6lb.png

[spoiler=Spoiler][spoiler=Spoiler][spoiler=Spoiler][spoiler=Spoiler][spoiler=Spoiler][spoiler=Spoiler][spoiler=Spoiler][spoiler=Spoiler][spoiler=Spoiler][spoiler=Spoiler][spoiler=Spoiler][spoiler=Spoiler][spoiler=Spoiler][spoiler=Spoiler][spoiler=Spoiler]LOL,Its nothing interesting here

[spoiler=Spoiler]And here too

[spoiler=Spoiler]But that image is pretty good

 

 

 

 

 

 

 

 

 

 

 

 

Link to comment
Share on other sites

Thanks for your help but it still doesn't work:

 

My structure is the same as yours!

 

Here is the code of the Item:

package breezertwo.tutorialmod;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.ItemFood;

public class ItemFoodTut extends ItemFood{

public ItemFoodTut(int id) {
	super(1001, 6, false);
	this.setMaxStackSize(10);
	this.setTextureName("tutorialmod:food");

}	
}

 

And this is the code of my main class:

package breezertwo.tutorialmod;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.biome.BiomeGenBase;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.SidedProxy;
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.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;

@Mod(modid="tutorialmod", name="TutorialMod", version="0.1.0")
//@NetworkMod(clientSideRequired=true, serverSideRequired=false)
public class tutorialmod {

        @Instance("tutorialmod")
        public static tutorialmod instance;
        
       // @SidedProxy(clientSide="breezertwo.tutorialmod.client.ClientProxy", serverSide="breezertwo.tutorialmod.CommonProxy")
       // public static CommonProxy proxy;
        
        public BiomeGenBase TutorialBiom;
        
        public static Block Transparent;
        public int transparentID = 202;
        
        public static Block TransparentGreen;
        public int transparentgreenID = 203;
        
        public static Item food;
        public int foodID = 1001;
        
        public static Item TutErz;
        public int tuterzID = 1000;
        
        public static Block TutBlock;
        public int tutblockID = 200;
        
        public static Block TutorialErz;
        public int tutorialerzID = 201;
        
        public static Item StrucTool;
        public int toolID = 1002;
        
        @EventHandler
        public void preInit(FMLPreInitializationEvent event) {
               
        	System.out.println("TutorialMod v0.1.0 loading in progress");
        } 
        
        @EventHandler
        public void load(FMLInitializationEvent event) {
        	
        	//TutorialBiom = new BiomTutorial(33);
        	
        	food = new ItemFoodTut(foodID).setUnlocalizedName("Food").setCreativeTab(CreativeTabs.tabMaterials);
        	TutErz = new ItemTutErz(tuterzID).setUnlocalizedName("TutErz").setCreativeTab(CreativeTabs.tabMaterials);
        	TutBlock = new BlockTutBlock(tutblockID, Material.field_151576_e).func_149663_c("TutBlock").func_149647_a(CreativeTabs.tabBlock).func_149711_c(3.0F).func_149752_b(10.0F);
        	TutorialErz = new BlockTutorialErz(tutorialerzID, Material.field_151576_e).func_149663_c("TutorialErz").func_149647_a(CreativeTabs.tabBlock).func_149711_c(3.0F).func_149752_b(10.0F);
        	Transparent = new BlockTransparent(transparentID, Material.field_151592_s).func_149663_c("Transparent").func_149647_a(CreativeTabs.tabBlock).func_149711_c(0.1F);
        	//TransparentGreen = new BlockTransparentGreen(transparentgreenID, Material.field_151592_s).setUnlocalizedName("TransparentGreen").setCreativeTab(CreativeTabs.tabBlock).setHardness(0.1F);
        	//StrucTool = new ItemStrucTool(toolID).setUnlocalizedName("Tool").setCreativeTab(CreativeTabs.tabTools);

        	
        	loadCraftingRecipes();
        	loadSmeltingRecipes();
        	register();
        	updateLanguage();
           	
        	GameRegistry.registerWorldGenerator(new WorldGeneratorTutorialMod(), 0);
        }

	@EventHandler
        public void postInit(FMLPostInitializationEvent event) {
                
        	System.out.println("TutorialMod v0.1.0 loading succeed");

        }    


	private void loadCraftingRecipes() {
		//Normale Rezepte
		GameRegistry.addRecipe(new ItemStack(Item.func_150899_d(337), 3), "XGX", "XGX", "XGX", 'G', Blocks.gravel);
		GameRegistry.addRecipe(new ItemStack(tutorialmod.TutBlock, 1), "XXX", "XXX", "XXX", 'X', tutorialmod.TutErz);


		//Shapeless Rezepte
		//GameRegistry.addShapelessRecipe(new ItemStack(Item.appleGold, 5), Item.appleRed, Item.emerald);
	}


	private void loadSmeltingRecipes() {
		GameRegistry.addSmelting(TutErz, new ItemStack(Item.func_150899_d(322)), 0.8F);

	}

	private void updateLanguage() {
		LanguageRegistry.addName(TutErz, "TutorialErz");
		LanguageRegistry.addName(TutBlock, "TutorialBlock");
		LanguageRegistry.addName(TutorialErz, "RotErz");
		LanguageRegistry.addName(food, "Food");
		LanguageRegistry.addName(Transparent, "TransparenterGlasBlock");
		//LanguageRegistry.addName(TransparentGreen, "GrünerTransparenterGlasBlock");
		//LanguageRegistry.addName(StrucTool, "StruckturenTool");


	}

	private void register() {
		GameRegistry.registerItem(TutErz, "TutErz");
		GameRegistry.registerBlock(TutBlock, "TutBlock");
		GameRegistry.registerBlock(TutorialErz, "TutorialErz");
		GameRegistry.registerItem(food, "Food");		
		GameRegistry.registerBlock(Transparent, "Transpsrent");
		//GameRegistry.registerBlock(TransparentGreen, "TransparentGreen");
		//GameRegistry.registerItem(StrucTool, "Tool");



	}

}

 

Hope you have an onther idea.... but thanks anyway! :)

 

Andy

 

Link to comment
Share on other sites

Are you sure that you full path to food.png is

\[i]forge folder[/i]\src\main\resources\assets\tutorialmod\textures\items\[b]food.png[/b]

forge folder is folder where you have gradlew.bat obviously.

[spoiler=Spoiler][spoiler=Spoiler][spoiler=Spoiler][spoiler=Spoiler][spoiler=Spoiler][spoiler=Spoiler][spoiler=Spoiler][spoiler=Spoiler][spoiler=Spoiler][spoiler=Spoiler][spoiler=Spoiler][spoiler=Spoiler][spoiler=Spoiler][spoiler=Spoiler][spoiler=Spoiler]LOL,Its nothing interesting here

[spoiler=Spoiler]And here too

[spoiler=Spoiler]But that image is pretty good

 

 

 

 

 

 

 

 

 

 

 

 

Link to comment
Share on other sites

So, it's strange. Very strange.

Try to use this code. It work for me too.

    
@Override
public void registerIcons(IIconRegister reg)
{
this.itemIcon = reg.registerIcon("tutorialmod:food);
}

[spoiler=Spoiler][spoiler=Spoiler][spoiler=Spoiler][spoiler=Spoiler][spoiler=Spoiler][spoiler=Spoiler][spoiler=Spoiler][spoiler=Spoiler][spoiler=Spoiler][spoiler=Spoiler][spoiler=Spoiler][spoiler=Spoiler][spoiler=Spoiler][spoiler=Spoiler][spoiler=Spoiler]LOL,Its nothing interesting here

[spoiler=Spoiler]And here too

[spoiler=Spoiler]But that image is pretty good

 

 

 

 

 

 

 

 

 

 

 

 

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.