mirror of
https://github.com/GTNewHorizons/Electro-Magic-Tools.git
synced 2026-11-26 06:43:01 +00:00
Api derpage apparently... Some new drills, and chainsaws. Started working on omnitools, but I got distracted. I NEED TEXTURES :(
36 lines
929 B
Java
36 lines
929 B
Java
package baubles.api;
|
|
|
|
import cpw.mods.fml.common.FMLLog;
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
import net.minecraft.inventory.IInventory;
|
|
|
|
import java.lang.reflect.Method;
|
|
|
|
/**
|
|
* @author Azanor
|
|
*/
|
|
public class BaublesApi {
|
|
static Method getBaubles;
|
|
|
|
/**
|
|
* Retrieves the baubles inventory for the supplied player
|
|
*/
|
|
public static IInventory getBaubles(EntityPlayer player) {
|
|
IInventory ot = null;
|
|
|
|
try {
|
|
if (getBaubles == null) {
|
|
Class<?> fake = Class.forName("baubles.common.lib.PlayerHandler");
|
|
getBaubles = fake.getMethod("getPlayerBaubles", EntityPlayer.class);
|
|
}
|
|
|
|
ot = (IInventory) getBaubles.invoke(null, player);
|
|
} catch (Exception ex) {
|
|
FMLLog.warning("[Baubles API] Could not invoke baubles.common.lib.PlayerHandler method getPlayerBaubles");
|
|
}
|
|
|
|
return ot;
|
|
}
|
|
|
|
}
|