Jump to content

Textures Not Being Found [Please Help]


Cookie160

Recommended Posts

Hello

I'm currently working on a mod, but for the life of me, I can't get the textures to work! I've watched tons of tutorials, but none of them seem to solve my problem. If someone could just correct my code (or whatever), that would be fantastic.

 

Error:

2014-02-13 16:26:15 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: minecraft:textures/blocks/MISSING_ICON_TILE_1001_nuke_side.png
2014-02-13 16:26:15 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: minecraft:textures/blocks/MISSING_ICON_TILE_1001_nuke_top.png
2014-02-13 16:26:15 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: minecraft:textures/blocks/MISSING_ICON_TILE_1001_nuke_bottom.png

 

Current Code:

package Nukes;

import java.util.Random;

import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.util.Icon;
import net.minecraft.world.Explosion;
import net.minecraft.world.World;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityTNTPrimed;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityArrow;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

public class Blocknuke extends Block
{
    private Icon field_94393_a;
private Icon field_94392_b;

public Blocknuke()
    {
        super(1001,Material.circuits);
        this.setCreativeTab(CreativeTabs.tabRedstone);
        this.setStepSound(Block.soundStoneFootstep);
	this.setUnlocalizedName("nuke");
	this.setResistance(0.0F);
	this.setHardness(1.0F);
	this.setLightValue(0.0F);
    }
    @SideOnly(Side.CLIENT)

    /**
     * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
     */
    public Icon getIcon(int par1, int par2)
    {
        return par1 == 0 ? this.field_94392_b : (par1 == 1 ? this.field_94393_a : this.blockIcon);
    }

    /**
     * Called whenever the block is added into the world. Args: world, x, y, z
     */
    public void onBlockAdded(World par1World, int par2, int par3, int par4)
    {
        super.onBlockAdded(par1World, par2, par3, par4);

        if (par1World.isBlockIndirectlyGettingPowered(par2, par3, par4))
        {
            this.onBlockDestroyedByPlayer(par1World, par2, par3, par4, 1);
            par1World.setBlockToAir(par2, par3, par4);
        }
    }

    /**
     * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are
     * their own) Args: x, y, z, neighbor blockID
     */
    public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5)
    {
        if (par1World.isBlockIndirectlyGettingPowered(par2, par3, par4))
        {
            this.onBlockDestroyedByPlayer(par1World, par2, par3, par4, 1);
            par1World.setBlockToAir(par2, par3, par4);
        }
    }

    /**
     * Returns the quantity of items to drop on block destruction.
     */
    public int quantityDropped(Random par1Random)
    {
        return 1;
    }

    /**
     * Called upon the block being destroyed by an explosion
     */
    public void onBlockDestroyedByExplosion(World par1World, int par2, int par3, int par4, Explosion par5Explosion)
    {
        if (!par1World.isRemote)
        {
            EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(par1World, (double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), par5Explosion.getExplosivePlacedBy());
            entitytntprimed.fuse = par1World.rand.nextInt(entitytntprimed.fuse / 4) + entitytntprimed.fuse / 8;
            par1World.spawnEntityInWorld(entitytntprimed);
        }
    }

    /**
     * Called right before the block is destroyed by a player.  Args: world, x, y, z, metaData
     */
    public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5)
    {
        this.primeTnt(par1World, par2, par3, par4, par5, (EntityLivingBase)null);
    }

    /**
     * spawns the primed tnt and plays the fuse sound.
     */
    public void primeTnt(World par1World, int par2, int par3, int par4, int par5, EntityLivingBase par6EntityLivingBase)
    {
        if (!par1World.isRemote)
        {
            if ((par5 & 1) == 1)
            {
                EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(par1World, (double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), par6EntityLivingBase);
                par1World.spawnEntityInWorld(entitytntprimed);
                par1World.playSoundAtEntity(entitytntprimed, "random.fuse", 1.0F, 1.0F);
            }
        }
    }

    /**
     * Called upon block activation (right click on the block.)
     */
    public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
    {
        if (par5EntityPlayer.getCurrentEquippedItem() != null && par5EntityPlayer.getCurrentEquippedItem().itemID == Item.flintAndSteel.itemID)
        {
            this.primeTnt(par1World, par2, par3, par4, 1, par5EntityPlayer);
            par1World.setBlockToAir(par2, par3, par4);
            par5EntityPlayer.getCurrentEquippedItem().damageItem(1, par5EntityPlayer);
            return true;
        }
        else
        {
            return super.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, par6, par7, par8, par9);
        }
    }

    /**
     * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity
     */
    public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity)
    {
        if (par5Entity instanceof EntityArrow && !par1World.isRemote)
        {
            EntityArrow entityarrow = (EntityArrow)par5Entity;

            if (entityarrow.isBurning())
            {
                this.primeTnt(par1World, par2, par3, par4, 1, entityarrow.shootingEntity instanceof EntityLivingBase ? (EntityLivingBase)entityarrow.shootingEntity : null);
                par1World.setBlockToAir(par2, par3, par4);
            }
        }
    }

    /**
     * Return whether this block can drop from an explosion.
     */
    public boolean canDropFromExplosion(Explosion par1Explosion)
    {
        return false;
    }

    @SideOnly(Side.CLIENT)

    /**
     * When this method is called, your block should register all the icons it needs with the given IconRegister. This
     * is the only chance you get to register icons.
     */
    public void registerIcons(IconRegister par1IconRegister)
    {
        this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_side");
        this.field_94393_a = par1IconRegister.registerIcon(this.getTextureName() + "_top");
        this.field_94392_b = par1IconRegister.registerIcon(this.getTextureName() + "_bottom");
    }
}

 

Any help is appreciated!

 

PS:  The mod doesn't crash, and the block carries out all of it's other functions. Also, I'm fairly sure I've put the textures in the assets/... etc

Link to comment
Share on other sites

You need to setTextureName() to getTextureName(). That's why it says you have a missing tile name in the error log. Simply add setTextureName("modid:blocktexturename") to the constructor.

If you really want help, give that modder a thank you.

 

Modders LOVE thank yous.

Link to comment
Share on other sites

Sorry for taking so long to reply!

 

So what your saying is (Sorry, I'm very haven't learnt all the terminology):

Change

this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_side");
        this.field_94393_a = par1IconRegister.registerIcon(this.getTextureName() + "_top");
        this.field_94392_b = par1IconRegister.registerIcon(this.getTextureName() + "_bottom");

to

this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_side");
        this.field_94393_a = par1IconRegister.registerIcon(this.getTextureName() + "_top");
        this.field_94392_b = par1IconRegister.registerIcon(this.getTextureName() + "_bottom");
this.blockIcon = par1IconRegister.registerIcon(this.setTextureName("modid:nuke"));
        this.field_94393_a = par1IconRegister.registerIcon(this.setTextureName("modid:nuke"));
        this.field_94392_b = par1IconRegister.registerIcon(this.setTextureName("modid:nuke"));

?

Link to comment
Share on other sites

No what he's saying is you only need to change the constructor:

 

public Blocknuke()
    {
        super(1001,Material.circuits);
        this.setCreativeTab(CreativeTabs.tabRedstone);
        this.setStepSound(Block.soundStoneFootstep);
	this.setUnlocalizedName("nuke");
	this.setResistance(0.0F);
	this.setHardness(1.0F);
	this.setLightValue(0.0F);
                setTextureName("modid:nuke")
    }

 

And also you need to change modid to your actual modid

Link to comment
Share on other sites

No what he's saying is you only need to change the constructor:

 

public Blocknuke()
    {
        super(1001,Material.circuits);
        this.setCreativeTab(CreativeTabs.tabRedstone);
        this.setStepSound(Block.soundStoneFootstep);
	this.setUnlocalizedName("nuke");
	this.setResistance(0.0F);
	this.setHardness(1.0F);
	this.setLightValue(0.0F);
                setTextureName("modid:nuke")
    }

 

And also you need to change modid to your actual modid

Ok,

So part of the problem has been fixed (Thank you), but the problem persists.

 

Error:

2014-02-14 17:49:19 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: nukes:textures/blocks/nuke_bottom.png
2014-02-14 17:49:19 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: nukes:textures/blocks/nuke_side.png
2014-02-14 17:49:19 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: nukes:textures/blocks/nuke_top.png

Link to comment
Share on other sites

Correct(?) assets are in the "bin/miecraft" folder.

Also remember to use all lowercase (for compatibility with Linux/Unix/etc.).

So if your modid is "nukes" stuff goes into "bin/miecraft/assets/nukes" (f.e. textures for block with setTextureName("nukes:nuke") go into "bin/miecraft/assets/nukes/textures/blocks/nuke.png").

Link to comment
Share on other sites

Correct(?) assets are in the "bin/miecraft" folder.

Also remember to use all lowercase (for compatibility with Linux/Unix/etc.).

So if your modid is "nukes" stuff goes into "bin/miecraft/assets/nukes" (f.e. textures for block with setTextureName("nukes:nuke") go into "bin/miecraft/assets/nukes/textures/blocks/nuke.png").

Thank you so much! It works now!!!

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I am migrating a mod from 1.16.5 to 1.20.2 The version for 1.16.5 can be found here https://github.com/beothorn/automataCraft For the block called automata_start, it uses TileEntities and has blockstates, model/block and textures on json files. This is currently working fine on 1.16.5 https://github.com/beothorn/automataCraft/tree/master/src/main/resources/assets/automata For 1.20.2 I migrated the logic from TileEntities to BlockEntity. The mod is working fine. All blocks and Items are working with the correct textures except for the textures for each state of the automata_start block. No changes where made to the json files. This is the branch I am working on (there were some refactorings, but all is basically the same): https://github.com/beothorn/automataCraft/tree/1_20/src/main/resources/assets/automata The only difference I can think that may be related is that i had to implement createBlockStateDefinition on the BaseEntityBlock: https://github.com/beothorn/automataCraft/blob/1_20/src/main/java/br/com/isageek/automata/automata/AutomataStartBlock.java#L43 This is driving me crazy. I know the jsons are being loaded as I put a breakpoint at `net.minecraft.client.resources.model.ModelBakery#loadModel` and I can see BlockModelDefinition.fromJsonElement being called with automata_start. I also printed the state from the arguments of the tick function call and they look correct (https://github.com/beothorn/automataCraft/blob/1_20/src/main/java/br/com/isageek/automata/automata/Ticker.java#L32 ): blockState Block{automata:automata_start}[state=loadreplaceables] In game, all I see is the no textures. I think it is weird it is not the "missing texture" texture so I think it may be related to the material, but I had no success tweaking it (https://github.com/beothorn/automataCraft/blob/1_20/src/main/java/br/com/isageek/automata/automata/AutomataStartBlock.java#L37).   public static final Property<AutomataStartState> state = EnumProperty.create("state", AutomataStartState.class); private final AtomicReference<RegistryObject<BlockEntityType<?>>> blockEntityType; private final Map<String, RegistryObject<Block>> registeredBlocks; public AutomataStartBlock( final AtomicReference<RegistryObject<BlockEntityType<?>>> blockEntityType, final Map<String, RegistryObject<Block>> registeredBlocks ) { super(BlockBehaviour.Properties.of().mapColor(MapColor.STONE).strength(1.5F, 6.0F)); this.blockEntityType = blockEntityType; this.registeredBlocks = registeredBlocks; this.registerDefaultState(this.getStateDefinition().any().setValue(state, AutomataStartState.LOAD_REPLACEABLES)); } @Override protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> stateBuilder) { stateBuilder.add(state); }     So my cry for help is, anyone has any ideas? Is there a way to easily debug this, for example somewhere where I can list the textures for a given state, or make sure this is loaded?   Thanks in advance for the hints
    • FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring root project 'forge-1.8.9-11.15.1.2318-1.8.9-mdk'. > Could not resolve all dependencies for configuration ':classpath'. > Could not resolve net.minecraftforge.gradle:ForgeGradle:2.1-SNAPSHOT. Required by: :forge-1.8.9-11.15.1.2318-1.8.9-mdk:unspecified > Could not resolve net.minecraftforge.gradle:ForgeGradle:2.1-SNAPSHOT. > Unable to load Maven meta-data from https://jcenter.bintray.com/net/minecraftforge/gradle/ForgeGradle/2.1-SNAPSHOT/maven-metadata.xml. > Could not GET 'https://jcenter.bintray.com/net/minecraftforge/gradle/ForgeGradle/2.1-SNAPSHOT/maven-metadata.xml'. > peer not authenticated > Could not resolve net.minecraftforge.gradle:ForgeGradle:2.1-SNAPSHOT. > Unable to load Maven meta-data from http://files.minecraftforge.net/maven/net/minecraftforge/gradle/ForgeGradle/2.1-SNAPSHOT/maven-metadata.xml. > Could not GET 'http://files.minecraftforge.net/maven/net/minecraftforge/gradle/ForgeGradle/2.1-SNAPSHOT/maven-metadata.xml'. > peer not authenticated * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. BUILD FAILED Total time: 2.78 secs This is the error I got. Any help would be appreciated!
    • Greetings, ladies and gentlemen. I know firsthand how distressing it can be to lose Bitcoin (BTC) to a phony online trading site. Thank God, when I became a victim of internet scammers, I came across genuine reviews of Captain WebGenesis. The Experts reviews on google were generally positive and reliable. Captain WebGenesis, a licensed cryptocurrency expert, helps persons who have fallen prey to investment scams recover their stolen funds. Captain WebGenesis miraculously recovered my wallet and all of my Bitcoins in roughly 48 hours. Captain WebGenesis is tried, trusted, and accessible to all victims of Bitcoin fraud. The service charge was pricey, but it was well worth it. If you need his help, get in touch with the Expert. SMS / Call; +1 (701)314-2729 Email; (captainwebgenesis(@)hackermail.com) Homepage; captainwebgenesis.com Salutations, Captain WebGenesis.
    • The mod causing the problem was (supplementaries-1.20-2.8.10). The solution I found is deleting it.
    • So I downloaded forge 1.20.6 today on my pc and it said that I was on beta but I had forge on my laptop (same version) and it didnt day anything about beta Anyone know what it is and how to fix it?  
  • Topics

×
×
  • Create New...

Important Information

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