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

Posted

Hi, I need help trying to render my wood block so it would kind of look like bamboo, but the block just always look like a regular block. Here is my code:

 

package mymod.blocks;

 

import net.minecraft.block.Block;

import net.minecraft.block.material.Material;

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

import net.minecraft.creativetab.CreativeTabs;

import net.minecraft.util.Icon;

import net.minecraft.world.IBlockAccess;

 

public class PapayaWood extends Block{

 

private Icon PapayaTreeBlock; //Side of Block

private Icon PapayaTreeBlockTop; //Top & Bottom of Block

 

public PapayaWood(int par1)

    {

        super(par1, Material.wood);

        this.setCreativeTab(CreativeTabs.tabBlock);

    }

   

    /**

    * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)

    */

    public boolean renderAsNormalBlock()

    {

        return false;

    }

 

    public boolean getBlocksMovement(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)

    {

        return false;

    }

 

    /**

    * Is this block (a) opaque and (b) a full 1m cube?  This determines whether or not to render the shared face of two

    * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.

    */

    public boolean isOpaqueCube()

    {

        return false;

    }

 

 

@Override public void registerIcons(IconRegister iconRegister)

    {

this.PapayaTreeBlock = iconRegister.registerIcon("mymod:PapayaTreeBlock");

    this.PapayaTreeBlockTop = iconRegister.registerIcon("mymod:PapayaTreeBlockTop");

    }

 

public Icon getBlockTexture(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)

    {

if (par5 == 0)

        {

            return this.PapayaTreeBlockTop;

        }

        else if (par5 == 1)

        {

            return this.PapayaTreeBlockTop;

        }

        else

        {

        return this.PapayaTreeBlock;

        }

    }

        public Icon getIcon(int par1, int par2)

        {

            return par1 == 1 ? this.PapayaTreeBlockTop : par1 == 0 ? this.PapayaTreeBlockTop : this.PapayaTreeBlock; // 1- Top    0- Bottom  else: Side );

        }

}

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

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.