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

Okay, I'm.. stumped.. I'm making a set of logs to go a long with the vanilla logs which are basically the vanilla logs without bark.. So I've tried extending BlockLog and BlockNewLog.. both of which work the same way.. and overridden the methods and passed in my custom textures and such.. and am being held back by a problem. Oak, Spruce, Birch, and Jungle logs work perfectly but Acacia and Dark Oak aren't working correctly. They're named correctly but the textures are loading from my Oak and Spruce textures, not my acacia and dark oak ones.

 

Going through and printing whats loading in my ItemBlockWithMetadata class and in the registerBlockIcons method both print out the correct things... it's just not working. Do I really have to split logs into two classes like the vanilla code has done? Or am I missing something basic?

 

 

 

public class DebarkedWood extends BlockNewLog
{

public DebarkedWood() 
{
	super();

	setCreativeTab(ATCreativeTabs.blocksTab);
	setHardness(2.0f);
	setResistance(10.0f);
	setStepSound(soundTypeWood);
}

    public static final String[] types = new String[] {"oak", "spruce", "birch", "jungle", "acacia", "darkOak"};
    
    @SideOnly(Side.CLIENT)
    private IIcon[] iconSide;
    @SideOnly(Side.CLIENT)
    private IIcon[] iconTop;

    @Override
    public int damageDropped(int meta)
    {
        return meta;
    }

    @SideOnly(Side.CLIENT)
    @Override
    public void getSubBlocks(Item item, CreativeTabs tab, List list)
    {
    	list.add(new ItemStack(item, 1, 0));
    	list.add(new ItemStack(item, 1, 1));
    	list.add(new ItemStack(item, 1, 2));
    	list.add(new ItemStack(item, 1, 3));
    	list.add(new ItemStack(item, 1, 4));
    	list.add(new ItemStack(item, 1, 5));
    }
    
    @SideOnly(Side.CLIENT)
    @Override
    protected IIcon getSideIcon(int meta)
    {
        return iconSide[meta];
    }

    @SideOnly(Side.CLIENT)
    @Override
    protected IIcon getTopIcon(int meta)
    {
        return iconTop[meta];
    }
    

    @SideOnly(Side.CLIENT)
    @Override
    public void registerBlockIcons(IIconRegister register)
    {
        iconSide = new IIcon[types.length];
        iconTop = new IIcon[types.length];

        for (int i = 0; i < iconSide.length; ++i)
        {
            iconSide[i] = register.registerIcon(Reference.RESOURCEID + types[i] + this.getTextureName());
        }
        
        for (int i = 0; i < iconTop.length; ++i)
        {
            iconTop[i] = register.registerIcon(Reference.RESOURCEID + types[i] + "LogTop");
        }
    }
}

 

 

Developing the Spiral Power Mod .

こんにちは!お元気ですか?

Logs require 4* metadata values per type, so you can only have a maximum of 4 log types per block instance, which is basically the same as per unique block class (though you could "get around it" by passing in the types array to the constructor and making a separate instance of the same class).

 

So yes, you do need to split them up.

 

* More technically: meta 0-3 (bits 1 and 2) are used for the wood type, and then bits 3 (i.e. meta = 4) and 4 (i.e. meta = 8 ) are used for block rotation, so there is no room left for other variants in a 4-bit space. E.g. type 0 also has values at 4, 8, and 12; a total of 4 states per type.

  • Author

I see. I was wondering how wood handled it's rotation... that makes sense. Thanks :)

Developing the Spiral Power Mod .

こんにちは!お元気ですか?

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.