mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-26 23:03:01 +00:00
Final build for 1.4.7. *Cleaned up imports. *Added javadocs and cleaned up code. *API improvements and fixes. *Changed around packages and finalized API. *Fixed auto-download feature. *Removed UE implementation of multiblock, added my own. *Better Obsidian TNT code. *Better Atomic Assembler efficiency modes. *Made gas storage tanks more CPU efficient. *Better version control. *Added RecipeHelper for reflective implementations of recipes. *Reduced Osmium generation. *Fixed upgrade bug. *Pressurized Tube doesn't function when receiving a redstone signal. *Better Advanced Solar Generator code. *HP information for hoes. *Lowered chance of mobs spawning with armor. *InfuseRegistry for adding new infuse objects. *GasTransmission for external gas transmission.
43 lines
1.1 KiB
Java
43 lines
1.1 KiB
Java
package mekanism.api;
|
|
|
|
import net.minecraft.creativetab.CreativeTabs;
|
|
|
|
/**
|
|
* Class used to indirectly reference the Mekanism creative tab.
|
|
* @author AidanBrady
|
|
*
|
|
*/
|
|
public final class TabProxy
|
|
{
|
|
/** The 'Mekanism' class where the tab instance is stored. */
|
|
public static Class Mekanism;
|
|
|
|
/**
|
|
* Attempts to get the Mekanism creative tab instance from the 'Mekanism' class. Will return
|
|
* the tab if the mod is loaded, but otherwise will return the defined 'preferred' creative tab. This way
|
|
* you don't need to worry about NPEs!
|
|
* @return mekanism creative tab if can, otherwise preferred tab
|
|
*/
|
|
public static CreativeTabs tabMekanism(CreativeTabs preferred)
|
|
{
|
|
try {
|
|
if(Mekanism == null)
|
|
{
|
|
Mekanism = Class.forName("mekanism.common.Mekanism");
|
|
}
|
|
|
|
Object ret = Mekanism.getField("tabMekanism").get(null);
|
|
|
|
if(ret instanceof CreativeTabs)
|
|
{
|
|
return (CreativeTabs)ret;
|
|
}
|
|
|
|
return preferred;
|
|
} catch(Exception e) {
|
|
System.err.println("[Mekanism] Error retrieving Mekanism creative tab.");
|
|
return preferred;
|
|
}
|
|
}
|
|
}
|