This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Xfel's profile picture

API Request: Creative tab access

Started by Xfel, 04 November 2012 - 11:48 PM
Xfel #1
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…
Leo Verto #2
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.
Orwell #3
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/>/>
Cloudy #4
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.
Orwell #5
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.
Xfel #6
Posted 06 November 2012 - 07:44 PM
I'm using Orwells solution now, as I have a deobfuscated version of ComputerCraft for debugging anyway.