Jump to content

Lots of texture problems


Ablaze

Recommended Posts

Hey,

    I'm having a lot of problems with textures right now, so lets get right into it.

 

I made a block called textureTestBlock. I used the registerIcon method. The missing texture appears. Here is where I put my texture:-

 

 

 

C:/Users/*****/Desktop/forge/mcp/src/minecraft/assets/ablazethebest_tutorialmod/textures/blocks/textureTestBlock.png

 

 

 

 

In the log, here is what appears pertaining to that block and its texture

 

 

 

2013-10-12 10:17:44 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: minecraft:textures/blocks/MISSING_ICON_TILE_503_textureTestBlock.png

 

 

 

 

Here is the necessary code:-

 

My main file (Tutorial.java, as I'm still learning  :) ):-

 

 

 

 

package tutorial;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.item.Item;
import tutorial.blocks.BlockChainTnt;
import tutorial.blocks.BlockFallBright;
import tutorial.blocks.BlockObsidianDoor;
import tutorial.blocks.BlockTextureTest;
import tutorial.blocks.BlockUnknownTnt;
import tutorial.crafting.TutorialCrafter;
import tutorial.items.DiamondMagicalDiamond;
import tutorial.items.WandMagicTnt;
import tutorial.weapons.WeaponDeadBow;
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.network.NetworkMod;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;

@Mod(modid = Tutorial.modid, name = "Tutorial Mod", version = "1.0")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)

public class Tutorial {

public static final String modid = "AblazeTheBest_TutorialMod";


//public static Block fallBright;
public static Block chainTnt;
public static Block unknownTnt;
public static Block textureTestBlock;
//public static Item deadBow;
public static Item magicTntWand;
public static Item magicalDiamond;



@EventHandler
public void load(FMLInitializationEvent event){

	//fallBright = new BlockFallBright(500, Material.sand).setUnlocalizedName("fallBright");
	chainTnt = new BlockChainTnt(501).setUnlocalizedName("chainTnt");
	unknownTnt = new BlockUnknownTnt(502).setUnlocalizedName("unknownTnt");
	textureTestBlock = new BlockTextureTest(503, Material.rock).setUnlocalizedName("textureTestBlock");

	//deadBow = new WeaponDeadBow(5001).setUnlocalizedName("deadBow");
	magicTntWand = new WandMagicTnt(5002).setUnlocalizedName("magicTntWand");
	magicalDiamond = new DiamondMagicalDiamond(5003).setUnlocalizedName("magicalDiamond");

	//GameRegistry.registerBlock(fallBright, "fallBright");
	GameRegistry.registerBlock(chainTnt, Tutorial.modid + (chainTnt.getUnlocalizedName().substring(5)));
	GameRegistry.registerBlock(unknownTnt, Tutorial.modid + (unknownTnt.getUnlocalizedName().substring(5)));
	GameRegistry.registerBlock(textureTestBlock, Tutorial.modid + (textureTestBlock.getUnlocalizedName().substring(5)));

	//GameRegistry.registerItem(deadBow, Tutorial.modid + (deadBow.getUnlocalizedName().substring(5)));
	GameRegistry.registerItem(magicTntWand, Tutorial.modid + (magicTntWand.getUnlocalizedName().substring(5)));
	GameRegistry.registerItem(magicalDiamond, Tutorial.modid + (magicalDiamond.getUnlocalizedName().substring(5)));


	//LanguageRegistry.addName(fallBright, "Fall Bright");
	LanguageRegistry.addName(chainTnt, "Chain TNT");
	LanguageRegistry.addName(unknownTnt, "Unknown TNT");
	LanguageRegistry.addName(textureTestBlock, "Texture Test Block");

	//LanguageRegistry.addName(deadBow, "Dead Bow");
	LanguageRegistry.addName(magicTntWand, "Magical TNT Wand");
	LanguageRegistry.addName(magicalDiamond, "Magical Diamond");

	TutorialCrafter.loadRecipies();

}
}

 

 

 

BlockTextureTest.java:-

 

 

package tutorial.blocks;

import tutorial.Tutorial;
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 BlockTextureTest extends Block{

public BlockTextureTest(int par1, Material par2Material) {
	super(par1, par2Material);
	this.setCreativeTab(CreativeTabs.tabBlock);
}


@SideOnly(Side.CLIENT)
public void registerIcon(IconRegister par1IconRegister) {
	this.blockIcon = par1IconRegister.registerIcon(Tutorial.modid + ":" + (this.getUnlocalizedName().substring(5)));
}

}

 

 

 

 

Problem 2: I don't know how to put this, but try to understand. If you saw in Tutorial.java, there is a block called chainTnt. Wait, wait don't start scrolling up. Listen. As you guys know, there are three textures required for that, because it extends BlockTNT. Now have a look at the BlockChainTnt.java code:-

 

 

 

package tutorial.blocks;

 

import cpw.mods.fml.relauncher.Side;

import cpw.mods.fml.relauncher.SideOnly;

import tutorial.Tutorial;

import net.minecraft.block.BlockTNT;

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

import net.minecraft.creativetab.CreativeTabs;

import net.minecraft.entity.player.EntityPlayer;

import net.minecraft.item.Item;

import net.minecraft.util.Icon;

import net.minecraft.world.World;

 

public class BlockChainTnt extends BlockTNT{

 

@SideOnly(Side.CLIENT)

    private Icon field_94393_a;

    @SideOnly(Side.CLIENT)

    private Icon field_94392_b;

   

//Constructor

public BlockChainTnt(int par1) {

super(par1);

this.setCreativeTab(CreativeTabs.tabBlock);

}

 

//Handles all right click events

 

public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)

    {

int nextTo1 = par1World.getBlockId(par2 + 1, par3, par4);

int nextTo2 = par1World.getBlockId(par2 + 2, par3, par4);

int nextTo3 = par1World.getBlockId(par2 - 1, par3, par4);

int nextTo4 = par1World.getBlockId(par2, par3 - 1, par4);

int nextTo5 = par1World.getBlockId(par2, par3, par4 + 1);

int nextTo6 = par1World.getBlockId(par2, par3, par4 - 1);

 

        if (par5EntityPlayer.getCurrentEquippedItem() != null && par5EntityPlayer.getCurrentEquippedItem().itemID == Item.flintAndSteel.itemID)

        {

            this.func_94391_a(par1World, par2, par3, par4, 1, par5EntityPlayer);

            par1World.setBlockToAir(par2, par3, par4);

            par5EntityPlayer.getCurrentEquippedItem().damageItem(1, par5EntityPlayer);

            return true;

        }

        else if (par5EntityPlayer.getCurrentEquippedItem() != null && par5EntityPlayer.getCurrentEquippedItem().itemID == Tutorial.magicTntWand.itemID)

        {

        this.func_94391_a(par1World, par2, par3, par4, 1, par5EntityPlayer);

        if (nextTo1 == this.blockID && nextTo2 == this.blockID && nextTo3 == this.blockID && nextTo4 == this.blockID && nextTo5 == this.blockID && nextTo6 == this.blockID){

        this.func_94391_a(par1World, par2 + 1, par3, par4, 1, par5EntityPlayer);

            this.func_94391_a(par1World, par2 + 2, par3, par4, 1, par5EntityPlayer);

            this.func_94391_a(par1World, par2 - 1, par3, par4, 1, par5EntityPlayer);

            this.func_94391_a(par1World, par2, par3 - 1, par4, 1, par5EntityPlayer);

            this.func_94391_a(par1World, par2, par3, par4 + 1, 1, par5EntityPlayer);

            this.func_94391_a(par1World, par2, par3, par4 - 1, 1, par5EntityPlayer);

        }

       

       

            par1World.setBlockToAir(par2, par3, par4);

            par1World.setBlockToAir(par2 + 1, par3, par4);

            par1World.setBlockToAir(par2 + 2, par3, par4);

            par1World.setBlockToAir(par2 - 1, par3, par4);

            par1World.setBlockToAir(par2, par3 - 1, par4);

            par1World.setBlockToAir(par2, par3, par4 + 1);

            par1World.setBlockToAir(par2, par3, par4 - 1);

           

            par5EntityPlayer.getCurrentEquippedItem().damageItem(2, par5EntityPlayer);

            return true;

        }

        //If no item in hand, do nothing

        else

        {

            return super.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, par6, par7, par8, par9);

        }

    }

 

public void registerIcons(IconRegister par1IconRegister)

    {

        this.blockIcon = par1IconRegister.registerIcon(Tutorial.modid + ":" + "chainTnt" + "_side");

        this.field_94393_a = par1IconRegister.registerIcon(Tutorial.modid + ":" + "chainTnt" + "_top");

        this.field_94392_b = par1IconRegister.registerIcon(Tutorial.modid + ":" + "chainTnt" + "_bottom");

    }

 

}

 

 

 

 

The registerIcon code is in bold. Now do you see that underlined part? It wasn't originally Tutorial.modid. It was originally

this.func_111023_E(). I changed that. Now, the side texture loads, but not the top or bottom. Here is the texture location:-

 

C:/Users/*****/Desktop/forge/mcp/src/minecraft/assets/ablazethebest_tutorialmod/textures/blocks/chainTnt_bottom(or)_side(or)top.png

 

Have a look at this pic:-

NGCOdfF.png

 

I'm not sure about which build I'm using, I think it is 9.10.0.842. It is 1.6.2 I know, I plan to move my mod to 1.6.4 soon as they are nearly the same.

 

Please help if you can.

 

Thanks,

Ablaze.

Add me on Skype: AblazeTheBest. Send a message saying "#HeyAblaze"

 

Currently: Making a mod!

Link to comment
Share on other sites

Hi

 

Your second problem appears to be because you have put private Icon field_94393_a and private Icon field_94392_b into your BlockChainTNT class.  But the rendering code for TNT will use those fields in the BlockTNT class, it will never see the ones in your BlockChainTNT class.

 

The first problem appears to be because it's looking for a file called

MISSING_ICON_TILE_503_textureTestBlock.png

instead of

textureTestBlock.png

 

-?

 

I'm not sure offhand why (perhaps you have forgotten to register something?), but with a bit of breakpoint (at your registerIcon method) and code tracing you should be able to find out.

 

-TGG

 

 

Link to comment
Share on other sites

Hi

 

Your second problem appears to be because you have put private Icon field_94393_a and private Icon field_94392_b into your BlockChainTNT class.  But the rendering code for TNT will use those fields in the BlockTNT class, it will never see the ones in your BlockChainTNT class.

 

The first problem appears to be because it's looking for a file called

MISSING_ICON_TILE_503_textureTestBlock.png

instead of

textureTestBlock.png

 

-?

 

I'm not sure offhand why (perhaps you have forgotten to register something?), but with a bit of breakpoint (at your registerIcon method) and code tracing you should be able to find out.

 

-TGG

 

Hey!

 

Okay, as for the first problem I'll do a breakpoint check. About the second problem, how do I fix it?

 

EDIT: I fixed the second problem. I did this by copying the following code from BlockTNT:-

 

public Icon getIcon(int par1, int par2)
    {
        return par1 == 0 ? this.field_94392_b : (par1 == 1 ? this.field_94393_a : this.blockIcon);
    }

 

Doing breakpoint checks now.

Thanks,

Ablaze.

Add me on Skype: AblazeTheBest. Send a message saying "#HeyAblaze"

 

Currently: Making a mod!

Link to comment
Share on other sites

Hi

 

You can fix the second problem by overriding getIcon.  I would also suggest renaming your field_94392_b and field_94393_a to something meaningful, eg

 

   @SideOnly(Side.CLIENT)
    private Icon chainTnt_top;
    @SideOnly(Side.CLIENT)
    private Icon chainTnt_bottom;

@Override
    public Icon getIcon(int side, int metaData)
    {
        return side == 0 ? this.chainTnt_bottom : (side == 1 ? this.chainTnt_top : this.blockIcon);
    }

@Override
   public void registerIcons(IconRegister par1IconRegister)
    {
        this.blockIcon = par1IconRegister.registerIcon(Tutorial.modid + ":" + "chainTnt" + "_side");
        this.chainTnt_top = par1IconRegister.registerIcon(Tutorial.modid + ":" + "chainTnt" + "_top");
        this.chainTnt_bottom = par1IconRegister.registerIcon(Tutorial.modid + ":" + "chainTnt" + "_bottom");
    }

 

-TGG

Link to comment
Share on other sites

Hi

 

You can fix the second problem by overriding getIcon.  I would also suggest renaming your field_94392_b and field_94393_a to something meaningful, eg

 

   @SideOnly(Side.CLIENT)
    private Icon chainTnt_top;
    @SideOnly(Side.CLIENT)
    private Icon chainTnt_bottom;

@Override
    public Icon getIcon(int side, int metaData)
    {
        return side == 0 ? this.chainTnt_bottom : (side == 1 ? this.chainTnt_top : this.blockIcon);
    }

@Override
   public void registerIcons(IconRegister par1IconRegister)
    {
        this.blockIcon = par1IconRegister.registerIcon(Tutorial.modid + ":" + "chainTnt" + "_side");
        this.chainTnt_top = par1IconRegister.registerIcon(Tutorial.modid + ":" + "chainTnt" + "_top");
        this.chainTnt_bottom = par1IconRegister.registerIcon(Tutorial.modid + ":" + "chainTnt" + "_bottom");
    }

 

-TGG

 

I'm sorry, but I don't know anything about debugging or breakpoints or things like that. In short, I've never debugged, not even in ordinary Java programs like JFrames and other things. Can you teach me how to do this debugging and breakpoint stuff?

 

Thanks,

Ablaze.

Add me on Skype: AblazeTheBest. Send a message saying "#HeyAblaze"

 

Currently: Making a mod!

Link to comment
Share on other sites

Hi

 

To be honest there's quite a bit to learn about debugging and I doubt I'm the best person to teach it to you.  I'd suggest looking for a decent textbook or online tutorial or youtube series to show you what's possible with an Integrated Development Environment.  It'll be well worth your investment of time- being able to stop the code, see what's doing, where it has come, watch it go step by step through each instruction, read the values of your variables and see whether they match what you expected.  Stops a lot of fumbling in the dark.

 

-TGG

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

    • LINK DAFTAR : KLIK DISINI LINK DAFTAR : KLIK DISINI   Slot SHOPEEPAY adalah situs slot deposit SHOPEEPAY Ribu paling gacor di indonesia pada tahun 2023. Situs slot SHOPEEPAY kini menyediakan layanan deposit pakai aplikasi shopee yang amat gacor sampai detik ini. MAXWINBET77 Situs slot SHOPEEPAY saat ini menggunakan layanan deposit dari e-wallet shopee adalah alat pembayaran dempet digital lewat SHOPEEPAY. Slot SHOPEEPAY saat ini menjadi situs slot ternama dengan banyak nya keunggulan di dalam situs slot SHOPEEPAY ini. Slot deposit SHOPEEPAY hadir untuk menyedia kan sarana deposit paling termurah di indonesia. Deposit slot SHOPEEPAY hanya dengan modal 5000 Ribu saja kamu sudah bisa mainkan semua jenis game yang ada di dalam situs slot SHOPEEPAY Ribu seperti gates of olympus, mahjong ways 2, Legacy of Kong Maxways dan Koi Gate yang saat ini banyak sekali di cari orang karna tingkatan kemenangan nya paling besar dan mudah jackpot. TRIK DAN TRIK BERMAIN PALING JITU / SLOT DEPOSIT SHOPEEPAY Pilih Game Slot Gacor Yang Sesuai Dengan Preferensi Dan Anggaran Anda Ada banyak tipe game slot gacor yang bisa Anda pilih, mulai dari yang bertema klasik, petualangan, mitologi, sampai film. Pilihlah game slot gacor yang menarik bagi anda dan cocok dengan volatilitas dan RTP yang anda inginkan. Volatilitas yakni tingkat risiko dan varians dalam permainan, sedangkan RTP yakni prosentase pengembalian kepada pemain. Pilihlah game slot gacor dengan volatilitas dan RTP yang pantas dengan anggaran dan tujuan anda. Manajemen Bankroll Yang Baik Bankroll ialah jumlah uang yang Anda siapkan untuk bermain slot gacor. Penting bagi anda untuk mengelola bankroll anda dengan bagus supaya tidak kehabisan uang atau terjebak dalam kecanduan judi. Tentukan jumlah maksimal yang mau anda pertaruhkan per sesi, per hari, atau per minggu, dan jangan melebihi batas tersebut. Juga, tentukan jumlah kemenangan yang mau anda capai atau jumlah kerugian yang bisa anda terima, dan stop bermain dikala mencapai salah satu dari keduanya. Manfaatkan Bonus Dan Promosi Situs slot gacor Neobank menawarkan bonus dan promosi menarik kepada para pemainnya, seperti bonus new member, bonus deposit, bonus cashback, bonus referral, bonus turnover, jackpot progresif, turnamen, freebet, dan lainnya. Manfaatkan bonus dan promosi ini untuk meningkatkan modal dan peluang kemenangan anda. Tetapi, pastikan juga untuk membaca syarat dan ketentuan yang berlaku agar tidak terjebak dalam prasyarat taruhan atau batasan penarikan yang tidak menguntungkan. Pelajari Paytable Dan Fitur Game Sebelum bermain slot gacor Neobank, pastikan Anda mempelajari paytable dan fitur game. Paytable yaitu tabel yang menonjolkan skor masing masing simbol dan kombinasi kemenangan dalam game. Fitur game yaitu fitur tambahan yang bisa meningkatkan kesempatan kemenangan Anda, seperti wild, scatter, cuma cuma spins, bonus games, multiplier, dsb. Dengan mempelajari paytable dan fitur game, Anda bisa mengenal simbol mana yang semestinya Anda targetkan ketika bermain.
    • Link Daftar : KLIK DISINI  Link Login : KLIK DISINI  Link RTP   : KLIK DISINI  Link Gacor Slot Dana   : KLIK DISINI slot deposit dana 5000 ribu via dana adalah permainan slot dana gacor dengan menyediakan slot server thailand deposit dana. dan slot deposit dana adalah slot terbesar di thailand. anda cukup daftar disini dan mainkan disini slot deposit 5000 ribu via dana sudah dipastikan dengan deposit dana akan membuat akun anda menjadi akun special. situs deposit dana adalah situs yang terpercaya dan terakurat. Slot dana merupakan situs slot deposit dana yang sangat trending dan sangat dikenal luas di masyarakat. dengan adanya MAXWINBET77 anda bisa mendapatkan keuntungan besar setiap hari tanpa adanya potongan  yang pastinya menguntungkan bagi anda. situs slot dana  maxwinbet77 adalah situs slot dana terbaik 2024 dan dijamin mudah maxwin. PERMAINAN YANG ADA DI SLOT DANA MAXWINBET77: - TOGEL 4D - SLOT ONLINE - LIVE CASINO - SPORTSBOOK - ARCADE TEMBAK IKAN - SABUNG AYAM Saat Ini Slot Dana Maxwinbet77 Menyediakan Bonus Berupa : - Bonus New Member - Bonus Deposit Harian - Bonus Cashback - Bonus 2D TERBALIK - Bonus Prize 2 & Prize 3 - Bonus Refferal DAFATR DISINI
    • LINK DAFTAR : KLIK DISINI LINK DAFTAR : KLIK DISINI   Slot seabank meruapakan salah satu situs slot paling gacor deposit seabank 100% mudah maxwin, hari ini situs slot seabank meghadirkan permainan slot dengan kemudahan bergabung hanya dengan menggunakan aplikasi Seabank langsung bisa join dengan bandar slot Seabank terbaik dan terpercaya no.1 di indonesia. Slot Seabank resmi di daftar situs slot deposit pakai Seabank 5000 Gampang Maxwin dimana aplikasi Seabank tersebut telah sanggat membantu para bosku untuk bermain slot online deposit via Seabank saat ini slot Seabank ini membantu dalam mempermudah transaksi disaat bosku ingin deposit melakukan pembayaran. kini orang orang ingin bermian judi online khusus nya games slot tidak perlu khawatir lagi apabila tidak memilikui saldo di ATM, sebab dengan adanya aplikasi Seabank sudah memberikan dampak signifikan buat perjudian di indonesia. Selain slot pakai Seabank, terdapat beberapa aplikasi e-wallet yang dapat di gunakan untuk bertansaksi antara lain, slot deposit 5000 Seabank, slot dana, slot ovo, slot pulsa tanpa potongan, dan slot shopeepay mudah menang bisa bosku pakai untuk setoran Seabank resmi terbaru. intinya slot online deposit Seabank memberikan jamianan kemudahan saat main games slot gacor uang asli terbaik di indonesia bos.
    • LINK DAFTAR : KLIK DISINI LINK DAFTAR : KLIK DISINI   Slot deposit bank bsi merupakan salah satu situs slot gacor deposit bank bsi 24 jam mudah maxwin tanpa batas. hari ini slot deposit bank bsi menawarkan bonus terbesar untuk player yang sudah bergabung di situs slot bank bsi ini, dengan ada nya slot bank bsi sanget mempermudah player untuk melakukan transaksi deposit dengan bank bsi. Sebagai Situs Slot Deposit Bank Bsi meyediakan banyak permainan seperti slot online, live casino, sabung ayam, tembak ikan, sportbook semua game tersebuat sangat aman dan terpercaya. Beramin slot bank bsi sangat mudah hanya dengan niminal deposit 5000 ribu saja anda sudah bisa bermain di semua game yang sudah di sediakan oleh situs slot bank bsi. Slot bank bsi adalah saranan untuk Pemain yang mencari pengalaman bermain slot gacor sekarang dapat menemukan metode pembayaran beragam di berbagai situs slot gacor yang tersebar luas di seluruh negeri. Munculnya situs Slot Bank BSI, kini para pemain dapat menikmati kemudahan dan kenyamanan dalam melakukan transaksi pembayaran. Bahkan memungkinkan pemain untuk fokus sepenuhnya pada permainan yang mereka nikmati sepanjang waktu. Ini adalah langkah penting dalam memperluas aksesibilitas judi slot online di Indonesia dan memberikan pengalaman bermain yang lebih baik kepada para pecinta slot gacor.    
    • Sometimes love could be the worst experience. you get to love and trust your partner only to feel regret over it. i have been married for 7 years now and i found some sudden change in my partner attitude, i tried talking about it but he complains i'm nagging a lot . i tried to ignore his attitude but it became unbearable so i was advised to hire a hacker to help me gain access to his phone so i had know if he is cheating or not so i was introduced to [ Remote spy hacker @ g m ail . c o m ] and this expert helped me gain access to his phone without his notice. i got to see his messages, photos, call recordings and many more . Now i can see his cheating and that's the reason for the attitude all along.
  • Topics

×
×
  • Create New...

Important Information

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