Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

  • Author

ok thats fixed now put texture still aren't working the textures are located:"C:\Users\User\Desktop\MC MODDING\HAT\src\main\resources\assets\hat\textures\blocks" and the textures are called "Palm_Wood_Log_Side" and "Palm_Wood_Log_Top"

package hat.blocks.palmblocks;

 

import hat.HAT;

 

import java.util.Random;

 

import net.minecraft.block.Block;

import net.minecraft.block.BlockRotatedPillar;

import net.minecraft.block.material.Material;

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

import net.minecraft.creativetab.CreativeTabs;

import net.minecraft.item.Item;

import net.minecraft.util.IIcon;

import net.minecraft.world.IBlockAccess;

import net.minecraft.world.World;

import cpw.mods.fml.relauncher.Side;

import cpw.mods.fml.relauncher.SideOnly;

 

public class PalmLog extends BlockRotatedPillar

{

 

    public static final String[] TOP ={"Palm_Wood_Log_Top"};

    public static final String[] SIDE ={"Palm_Wood_Log_Side"};

    public IIcon topIcon[];

    public IIcon sideIcon[];

   

    public PalmLog()

    {

        super(Material.wood);

        this.setHardness(2.0F);

        this.setStepSound(soundTypeWood);

    }

 

    public static int func_150165_c(int p_150165_0_)

    {

        return p_150165_0_ & 3;

    }

 

    /**

    * Returns the quantity of items to drop on block destruction.

    */

    public int quantityDropped(Random p_149745_1_)

    {

        return 1;

    }

 

    public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)

    {

        return Item.getItemFromBlock(this);

    }

 

    public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_)

    {

        byte b0 = 4;

        int i1 = b0 + 1;

 

        if (p_149749_1_.checkChunksExist(p_149749_2_ - i1, p_149749_3_ - i1, p_149749_4_ - i1, p_149749_2_ + i1, p_149749_3_ + i1, p_149749_4_ + i1))

        {

            for (int j1 = -b0; j1 <= b0; ++j1)

            {

                for (int k1 = -b0; k1 <= b0; ++k1)

                {

                    for (int l1 = -b0; l1 <= b0; ++l1)

                    {

                        Block block = p_149749_1_.getBlock(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1);

                        if (block.isLeaves(p_149749_1_, p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1))

                        {

                            block.beginLeavesDecay(p_149749_1_, p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1);

                        }

                    }

                }

            }

        }

    }

    public void registerBlockIcons(IIconRegister iIconRegister){

    topIcon = new IIcon[this.TOP.length];

    sideIcon = new IIcon[this.SIDE.length];

   

    for (int i =0; i < TOP.length;i++){

    topIcon = iIconRegister.registerIcon(HAT.MODID + ":Palm_Wood_Log" + "_Top" + i);

    sideIcon = iIconRegister.registerIcon(HAT.MODID + ":Palm_Wood_Log" + "_Side" + i);

    }

    }

   

    @SideOnly(Side.CLIENT)

    @Override

    protected IIcon getSideIcon(int metadata)

    {

        return sideIcon[metadata];

    }

 

    @SideOnly(Side.CLIENT)

    @Override

    protected IIcon getTopIcon(int metadata)

    {

        return topIcon[metadata];

    }

 

 

    @Override

    public boolean canSustainLeaves(IBlockAccess world, int x, int y, int z)

    {

        return true;

    }

 

    @Override

    public boolean isWood(IBlockAccess world, int x, int y, int z)

    {

        return true;

    }

}

 

  • Author

thanks but doesnt really help, normal textures work fine but i can't use a normal texture for a rotated pillar block as the textures change on direction, but i dont think the texture location is actually definied but dont know how to in the pillar class

Hi

 

As described in the links in my last post, your console will contain an error message along the lines of

"Using missing texture: unable to load nature:textures/items/ingotTitanium.png"

 

That will tell you what filenames it is expecting to find, if you can't be sure from your code.

 

(Hint: the filenames are created here :-)  )

 

       for (int i =0; i < TOP.length;i++){
          topIcon [ i ] = iIconRegister.registerIcon(HAT.MODID + ":Palm_Wood_Log" + "_Top" + i);
          sideIcon [ i ] = iIconRegister.registerIcon(HAT.MODID + ":Palm_Wood_Log" + "_Side" + i);
       }

-TGG

Guest
This topic is now closed to further replies.

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.