Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Releasing mod- where do I put my textures? [1.6.4]


Athire
 Share

Recommended Posts

Hello all! I'm about ready to release a super early alpha version of my mod, just something my friends and I can play around with to test it out. I recompiled and reobfuscated it all, I turned it into a .zip file (I'm using forge for 1.6.4), and I tried applying it to my forge minecraft profile. The mod loads and all of the items and ores work like  they should, but none of my textures load. I tried adding my textures directly to the .jar file (sorted correctly for blocks/items/gui), I even tried putting it in my zip file as just the .png's, in a textures folder, and even in a textures folder under a mod name folder (like in my mcp folder). All of my textures worked in the eclipse work space. To add my textures to an item I'm using the method .setTextureName("innerpower: InnerPower_itemname") where innerpower is the name of the folder under mcp>>src>>assets which houses the textures, and "InnerPower_itemname" is the .png. For example one line of my code is:

 

public static final Item STFireball= new SpellTomeFireball(5000).setTextureName("innerpower:InnerPower_SpellTome_Fireball");

 

So is this an issue with with the function I'm using, or am i just not putting my textures in the right place? Every tutorial I've seen so far has a different place to put them (such as directly into the .jar or in the zipped folder) so it's a bit difficult to figure out D: As always thank you guys for all your help! I'm definitely adding some names to my credits section once an official release comes out! :) And thanks again to everyone who has helped me with my other questions so far! This mod is far from over but you guys have been a huge help in getting me this far!

Link to comment
Share on other sites

Thank you so much! That just about fixed my issue! There is still one stubborn texture that refuses to load though. It's weird because it's an item texture in the same folder as my other item textures which are loading fine. I can't see anything different between the textures which are loading and this one item texture which will not :( Any suggestions?

 

Here is the bit of code that initializes the item:

public static final Item InrPwrWispEssence = new Item(5001).setCreativeTab(CreativeTabs.tabMisc).setUnlocalizedName("essenceWisp").setTextureName("innerpower:InnerPower_Essence_WispyEssence");

 

Thank you again!

Link to comment
Share on other sites

Hi

 

Keen, sounds like you've nearly cracked it.

 

At a guess - since your other Items work ok - your InnerPower_Essence_WispyEssence doesn't match the filename.  Try renaming them both to something very simple, like

setTextureName("innerpower:fred");

and

fred.png

 

If that doesn't fix the problem, post your code and the error log showing the "using missing texture" error message?

 

-TGG

 

 

Link to comment
Share on other sites

You were right! Turns out i capitalized the E in "_Essence" in the code but not in the png! I thought i triple checked that but for some reason i just didn't catch it. It's strange that it would work in eclipse though, I wonder why that is?

 

anyway thank you so much! I'll add your name to the list of people to put in the credits :)

Link to comment
Share on other sites

You were right! Turns out i capitalized the E in "_Essence" in the code but not in the png! I thought i triple checked that but for some reason i just didn't catch it.

yeah that's a real trap.  Been there several times myself

 

 

It's strange that it would work in eclipse though, I wonder why that is?

That's because the windows file system isn't case sensitive, so essence and Essence still match.  But zip files are case-sensitive, so when you package up your mod it suddenly doesn't work any more.

 

anyway thank you so much! I'll add your name to the list of people to put in the credits :)

you're welcome, thanks :-)

 

Link to comment
Share on other sites

Hello,

 

Basically, I need help with the same thing. I can load my texture fine when I run minecraft off eclipse (when you press the "play" button on eclipse when you are testing the mod) but when I recompile my mod and add it to my mods folder in the .minecraft folder the textures won't load. I think it's because I don't know where to put my textures.

 

If you need any more information about my problem, just ask :D.

 

Main class

 

package ASHninja1997.CrystalOrb; //Package directory

 

import net.minecraft.block.Block;

import net.minecraft.item.EnumToolMaterial;

import net.minecraft.item.Item;

import net.minecraft.item.ItemFood;

import net.minecraft.item.ItemStack;

import net.minecraft.item.ItemHoe;

import net.minecraftforge.common.EnumHelper;

import net.minecraftforge.common.MinecraftForge;

import cpw.mods.fml.common.Mod;

import cpw.mods.fml.common.Mod.Init;

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

import cpw.mods.fml.common.network.NetworkMod;

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

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

 

 

/*

* Basic needed forge stuff

*/

@Mod(modid="CrystalOrbMod",name="Crystal Orb Mod",version="v1.3")

@NetworkMod(clientSideRequired=true,serverSideRequired=false)

 

public class Main {

 

/*

* ToolMaterial

*/

 

//Telling forge that we are creating these

 

public static final String modid = "ASHninja1997_CrystalOrb";

 

//static EnumToolMaterial WOOD = EnumHelper.addToolMaterial(name, harvestLevel, maxUses, efficiency, damage, enchantability)

static EnumToolMaterial Crystalbasic= EnumHelper.addToolMaterial("Cystal", 3, 3561, 15F, 3, 30);

static EnumToolMaterial Crystalbasic2= EnumHelper.addToolMaterial("Cystal", 3, 3561, 18F, 3, 30);

static EnumToolMaterial CrystalSword= EnumHelper.addToolMaterial("Cystal", 3, 3561, 15F, 6, 30);

 

//items

public static Item orb_blue;

public static Item orb_red;

public static Item orb_crystal;

 

public static Item OrbAxe;

public static Item OrbShovel;

public static Item OrbSword;

public static Item OrbPickaxe;

public static Item OrbHoe;

 

//block

public static Block orb_blue_ore;

public static Block orb_red_ore;

public static Block orb_crystal_block;

 

//Declaring Init

@Init

public void load(FMLInitializationEvent event){

// define items/blocks

 

orb_blue_ore = new OrbBlockBlue(2079, "orb_blue_ore").setUnlocalizedName("orb_blue_ore").setHardness(8.0F).setStepSound(Block.soundStoneFootstep).setResistance(10.0F);

GameRegistry.registerBlock(orb_blue_ore, "orb_blue_ore");

LanguageRegistry.addName(orb_blue_ore, "BlueOrb Ore");

 

orb_red_ore = new OrbBlockRed(2080, "orb_red_ore").setUnlocalizedName("orb_red_ore").setHardness(8.0F).setStepSound(Block.soundStoneFootstep).setResistance(10.0F);

GameRegistry.registerBlock(orb_red_ore, "orb_red_ore");

LanguageRegistry.addName(orb_red_ore, "RedOrb Ore");

 

orb_crystal_block = new OrbBlockRed(2088, "orb_crystal_block").setUnlocalizedName("orb_crystal_block").setHardness(8.0F).setStepSound(Block.soundMetalFootstep).setResistance(14.0F);

GameRegistry.registerBlock(orb_crystal_block, "orb_crystal_block");

orb_blue_ore.func_82506_l();

LanguageRegistry.addName(orb_crystal_block, "CrystalOrb Block");

 

 

orb_red = new OrbItems(2081).setUnlocalizedName("orb_red");

orb_blue = new OrbItems(2078).setUnlocalizedName("orb_blue");

orb_crystal = new OrbItems(2082).setUnlocalizedName("orb_crystal");

 

OrbAxe = new OrbAxe(2083, Crystalbasic).setUnlocalizedName("orb_crystal_axe");

OrbShovel = new OrbShovel(2084, Crystalbasic2).setUnlocalizedName("orb_crystal_shovel");

OrbPickaxe = new OrbPickaxe(2085, Crystalbasic).setUnlocalizedName("orb_crystal_pickaxe");

OrbHoe = new OrbHoe(2086, Crystalbasic).setUnlocalizedName("orb_crystal_hoe");

OrbSword = new OrbSword(2087, CrystalSword).setUnlocalizedName("orb_crystal_sword");

 

MinecraftForge.setToolClass(OrbPickaxe, "pickaxe", 3);

MinecraftForge.setToolClass(OrbShovel, "shovel", 3);

MinecraftForge.setToolClass(OrbAxe, "axe", 3);

 

MinecraftForge.setBlockHarvestLevel(orb_blue_ore, "pickaxe", 2);

MinecraftForge.setBlockHarvestLevel(orb_red_ore, "pickaxe", 2);

 

//adding names

 

 

LanguageRegistry.addName(orb_blue, "Blue Orb");

LanguageRegistry.addName(orb_red, "Red Orb");

LanguageRegistry.addName(orb_crystal, "Crystal Orb");

LanguageRegistry.addName(OrbAxe, "Crystal Axe");

LanguageRegistry.addName(OrbShovel, "Crystal Shovel");

LanguageRegistry.addName(OrbPickaxe, "Crystal Pickaxe");

LanguageRegistry.addName(OrbSword, "Crystal Sword");

LanguageRegistry.addName(OrbHoe, "Crystal Hoe");

 

//crafting

 

GameRegistry.addRecipe(new ItemStack(orb_crystal,1), new Object[]{

"BRB","RBR","BRB",'B', orb_blue, 'R', orb_red

});

 

GameRegistry.addRecipe(new ItemStack(OrbSword,1), new Object[]{

" C "," C "," S ",'C', orb_crystal, 'S', Item.stick

});

 

GameRegistry.addRecipe(new ItemStack(OrbAxe,1), new Object[]{

" CC"," SC"," S ",'C', orb_crystal, 'S', Item.stick

});

 

GameRegistry.addRecipe(new ItemStack(OrbShovel,1), new Object[]{

" C "," S "," S ",'C', orb_crystal, 'S', Item.stick

});

 

GameRegistry.addRecipe(new ItemStack(OrbPickaxe,1), new Object[]{

"CCC"," S "," S ",'C', orb_crystal, 'S', Item.stick

});

 

GameRegistry.addRecipe(new ItemStack(OrbHoe,1), new Object[]{

" CC"," S "," S ",'C', orb_crystal, 'S', Item.stick

});

 

GameRegistry.addRecipe(new ItemStack(orb_crystal_block,1), new Object[]{

"CCC","CCC","CCC",'C', orb_crystal,

});

 

//reverse

 

 

//world Generator

GameRegistry.registerWorldGenerator(new WorldGeneratorORB());

 

 

 

 

}

 

}

 

 

 

Block Class

 

package ASHninja1997.CrystalOrb;

 

import java.io.File;

import java.util.Random;

 

import cpw.mods.fml.common.Mod.Init;

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

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

import cpw.mods.fml.relauncher.Side;

import cpw.mods.fml.relauncher.SideOnly;

import net.minecraft.block.Block;

import net.minecraft.block.material.Material;

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

import net.minecraft.creativetab.CreativeTabs;

 

public class OrbBlockBlue extends Block {

 

 

public OrbBlockBlue(int par1, String texture) {

super(par1, Material.rock);

setCreativeTab(CreativeTabs.tabBlock); //place in creative tabs

 

}

 

//drops when broken with pickaxe

public int idDropped(int par1, Random par2Random, int par3)

{

return Main.orb_blue.itemID;

}

public int quantityDropped(Random random)

{

return 1;

}

 

@SideOnly(Side.CLIENT)

public void registerIcons(IconRegister iconRegister)

{

blockIcon = iconRegister.registerIcon("CrystalOrb:orb_blue_ore");

}

 

}

 

Every day is a new day to learn.

I acknowledge the hard work of original content.

I will always improve in many ways.

 

Java > c

Link to comment
Share on other sites

You were right! Turns out i capitalized the E in "_Essence" in the code but not in the png!

 

And now you know why I use lower case for everything asset related and tell new modders to always use all lower case for their assets, double and triple check.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

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

 Share



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Got the rotation working. I had to look at LivingEntityRenderer#render and setupRotations a little more closely, and I realized that I needed to change the custom entity's yBodyRot and yBodyRotO.  private static boolean renderingCustomEntity = false; private static CustomEntity customEntity; private static void refreshCustomEntity(LocalPlayer localPlayer, LivingEntity livingEntity) { if (customEntity == null || customEntity.isRemoved()) { customEntity = ModEntities.CUSTOM_ENTITY.get().create(localPlayer.clientLevel); } if (!customEntity.level.dimension().equals(livingEntity.level.dimension())) { customEntity.discard(); } } @SubscribeEvent public static void replaceMobModel(RenderLivingEvent.Pre<LivingEntity, EntityModel<LivingEntity>> event) { LocalPlayer localPlayer = Minecraft.getInstance().player; if (localPlayer != null && event.getEntity() instanceof Mob mob) { if (/* put your own condition here */) { if (!renderingCustomEntity) { try { renderingCustomEntity = true; event.setCanceled(true); refreshCustomEntity(localPlayer, mob); // (truth be told, my custom entity does not have a "head", so these lines aren't needed) // customEntity.setYHeadRot(mob.getYHeadRot()); // customEntity.yHeadRotO = mob.yHeadRotO; customEntity.setYBodyRot(mob.yBodyRot); customEntity.yBodyRotO = mob.yBodyRotO; customEntity.setPose(mob.getPose()); Minecraft.getInstance().getEntityRenderDispatcher().getRenderer(customEntity).render( customEntity, customEntity.yBodyRot, event.getPartialTick(), event.getPoseStack(), event.getMultiBufferSource(), event.getPackedLight() ); } finally { renderingCustomEntity = false; } } } } }   As shown in my code, if the mob whose model is replaced moves to a different dimension, I unload the custom entity with Entity#discard and then reinitialize it on the next tick. I wonder if I also have to unload the custom entity when the mob it is "replacing" dies.
    • Thank you for the video, but I found the issue. I had to update the Gradle from 7.2 to 7.3 in gradle/wrapper/gradle-wrapper.properties.
    • Some zip managers like to take control of the .jar file extension away from Java. Make sure you have Java installed and try running Jarfix once, then try the installer again.
    • Whenever i try and download forge specifically 1.18.2 it will download as a JAR file as a note page and theirs no way to install it i have watched a few videos but none show how to fix this problem
    • Hello, I dont really understand why the nbt tag in the code below is not attached to the item. @Override public InteractionResult interactLivingEntity(ItemStack pStack, Player pPlayer, LivingEntity pInteractionTarget, InteractionHand pUsedHand) { if (pPlayer.getLevel().isClientSide()) { if (pInteractionTarget instanceof Mob mob) { System.out.println("ITEMSTACK " + pStack); CompoundTag nbtTag = null; System.out.println("nbt tag " + nbtTag); if (!(pStack.hasTag())) { nbtTag = new CompoundTag(); CompoundTag nbtMobTag = new CompoundTag(); mob.save(nbtMobTag); nbtTag.put("mob", nbtMobTag); System.out.println("IN NBT NULL " + nbtTag); pStack.setTag(nbtTag); System.out.println("AFTER TAG SET " + pStack.hasTag()); pPlayer.sendMessage(new TextComponent("Shard used on " + mob.getDisplayName().getString()), pPlayer.getUUID()); } else { nbtTag = pStack.getTag(); System.out.println("item has tag"); System.out.println(nbtTag.contains("mob")); } } } return InteractionResult.PASS; } @Override public void appendHoverText(ItemStack pStack, @Nullable Level pLevel, List<Component> pTooltipComponents, TooltipFlag pIsAdvanced) { CompoundTag nbtTag = pStack.getTag(); if (nbtTag != null) { if (nbtTag.contains("mob")) { Mob targetMob = null; targetMob.deserializeNBT(nbtTag.getCompound("mob")); pTooltipComponents.add(new TextComponent("Mob : " + targetMob.getDisplayName().getString())); } } } Everytime I right click with the Item on a LivingEntity, It goes on the if(!pStack.hasTag()), but It shouldn't because we set the tag on the first right click on an Entity   Do you have a solution ?
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.