Mekanism-tilera-Edition/common/mekanism/api/TabProxy.java

43 lines
1.1 KiB
Java
Raw Normal View History

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
*/
v5 Beta #9 *Bumped animation textures to 32x32. *Added default parameter to TabProxy.tabMekanism(). *Added additional info to Machine/GeneratorType for better handling of metadata. *Added Reinforced Iron, a stronger version of an Iron Block. *Updated onBlockActivated() code to function correctly. *Added feature for a generator or power unit to be placed facing up or down. *Cleaned up GUI access/handler code. *Fixed electric machine shift-click bug. *Added Diamond Dust. *Fixed Energized Bow continuing to fire after it's energy is depleted. *Added HP information to armor and tools. *Fixed slot parameters. *Overhauled packet system. *Cleaned up tile entity hierarchy. *Added BuildCraft liquid support to Heat Generator to allow energy generation with both BuildCraft's fuel buckets and liquid fuel. *Fixed texture preloads. *Added Electolytic Separator -- a machine that separates hydrogen and oxygen molecules from water. It accepts water from BuildCraft pipes. *Added Hydrogen Generator -- a generator that by default generates 128 u/t, but has boosts by the block's height of up to 512 u/t. *Added Solar Generator, a generator that produces 32 u/t when it can see the sun. *Added Gas API! Simple gas management that allows for both storage of gas in items, blocks, and transfer between themselves. So far implemented gasses are oxygen and hydrogen. *Added LiquidSlot for easy management of liquid in tile entities. *Added Hydrogen Tank and Oxygen Tank items. *Added BuildCraft hooks. *Fixed zombies and skeletons spawning with Obsidian Armor, and lowered chances of spawning with any armor. *More OreDictionary registrations to fix IC2's different dust names. *Fixed some javadocs. *Added 'Solar Panel' item as a crafting element for a Solar Generator. *Minor bugfixes.
2012-11-15 21:04:12 +01:00
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.");
v5 Beta #9 *Bumped animation textures to 32x32. *Added default parameter to TabProxy.tabMekanism(). *Added additional info to Machine/GeneratorType for better handling of metadata. *Added Reinforced Iron, a stronger version of an Iron Block. *Updated onBlockActivated() code to function correctly. *Added feature for a generator or power unit to be placed facing up or down. *Cleaned up GUI access/handler code. *Fixed electric machine shift-click bug. *Added Diamond Dust. *Fixed Energized Bow continuing to fire after it's energy is depleted. *Added HP information to armor and tools. *Fixed slot parameters. *Overhauled packet system. *Cleaned up tile entity hierarchy. *Added BuildCraft liquid support to Heat Generator to allow energy generation with both BuildCraft's fuel buckets and liquid fuel. *Fixed texture preloads. *Added Electolytic Separator -- a machine that separates hydrogen and oxygen molecules from water. It accepts water from BuildCraft pipes. *Added Hydrogen Generator -- a generator that by default generates 128 u/t, but has boosts by the block's height of up to 512 u/t. *Added Solar Generator, a generator that produces 32 u/t when it can see the sun. *Added Gas API! Simple gas management that allows for both storage of gas in items, blocks, and transfer between themselves. So far implemented gasses are oxygen and hydrogen. *Added LiquidSlot for easy management of liquid in tile entities. *Added Hydrogen Tank and Oxygen Tank items. *Added BuildCraft hooks. *Fixed zombies and skeletons spawning with Obsidian Armor, and lowered chances of spawning with any armor. *More OreDictionary registrations to fix IC2's different dust names. *Fixed some javadocs. *Added 'Solar Panel' item as a crafting element for a Solar Generator. *Minor bugfixes.
2012-11-15 21:04:12 +01:00
return preferred;
}
}
}