Fixed the wand charging station texture, moved the baubles API to package it, and using the @API annotation for it. Added the Config GUIs existing in MinecraftForge for EMT! Awesome!

This commit is contained in:
Tombenpotter committed 2014-07-15 15:00:03 +02:00
1 parent bfdc4d5f9c
commit f0ee38df32
44 files changed
+347 -289

No files matched your search

+34
View File
@@ -0,0 +1,34 @@
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;
}
}