Jump to content




API Request: Creative tab access


  • You cannot reply to this topic
5 replies to this topic

#1 Xfel

    Peripheral Designer

  • Members
  • 515 posts

Posted 05 November 2012 - 12:48 AM

When writing a small peripheral mod, I'd like my peripherals to appear on the same creative tab as all other cc items. So, I would like to see a method like ComputerCraftAPI.getCreativeTab, as I currently have to use reflection...

#2 Leo Verto

  • Members
  • 620 posts
  • LocationOver there

Posted 05 November 2012 - 01:08 AM

I think this would be really good, as some peripheral authors started making their own tabs, which would spam the creative menu.

#3 Orwell

    Self-Destructive

  • Members
  • 1,091 posts

Posted 05 November 2012 - 03:28 AM

Why do you need reflection? The getCreativeTab() method (or is it just a data member, don't remember) is declared public in ComputerCraft.class . I just had to compile it against ComputerCraft as a library. Nevertheless, it would be good that this would b accessible in the API. That's what the API is made for, right? Easy access to helpful methods. :D/>

#4 Cloudy

    Ex-Developer

  • Members
  • 2,543 posts

Posted 05 November 2012 - 10:59 AM

I plan to expose this when I add a new API soon. Although you can probably access it through the CreativeTabs object right now by checking against the name.

#5 Orwell

    Self-Destructive

  • Members
  • 1,091 posts

Posted 06 November 2012 - 02:43 PM

I checked again, and if you don't mind linking against ComputerCraft as a library, you can access it as 'ComputerCraft.ccTab' . Of course, if you could do it Cloudy's way, it keeps your mod version compatible.

#6 Xfel

    Peripheral Designer

  • Members
  • 515 posts

Posted 06 November 2012 - 07:44 PM

I'm using Orwells solution now, as I have a deobfuscated version of ComputerCraft for debugging anyway.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users