mirror of
https://github.com/GTNewHorizons/ForbiddenMagic.git
synced 2026-11-12 00:07:58 +00:00
Updated Baubles API.
This commit is contained in:
1 parent
0f012b13bf
commit
76103c8bea
5 files changed
+25
-19
No files matched your search
@@ -6,28 +6,35 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @author Azanor
|
||||
*/
|
||||
public class BaublesApi {
|
||||
|
||||
public class BaublesApi
|
||||
{
|
||||
static Method getBaubles;
|
||||
|
||||
/**
|
||||
* Retrieves the baubles inventory for the supplied player
|
||||
*/
|
||||
public static IInventory getBaubles(EntityPlayer player) {
|
||||
public static IInventory getBaubles(EntityPlayer player)
|
||||
{
|
||||
IInventory ot = null;
|
||||
try {
|
||||
if(getBaubles == null) {
|
||||
Class fake = Class.forName("baubles.common.lib.PlayerHandler");
|
||||
|
||||
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) {
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
FMLLog.warning("[Baubles API] Could not invoke baubles.common.lib.PlayerHandler method getPlayerBaubles");
|
||||
}
|
||||
|
||||
return ot;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,11 +4,10 @@ import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Azanor
|
||||
*
|
||||
* This interface should be extended by items that can be worn in bauble slots
|
||||
*
|
||||
*
|
||||
* @author Azanor
|
||||
*/
|
||||
|
||||
public interface IBauble {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@API(owner = "Baubles", apiVersion = baubles.common.Baubles.VERSION, provides = "Baubles|API")
|
||||
@API(owner = "Baubles", apiVersion = "1.0.1.10", provides = "Baubles|API")
|
||||
package baubles.api;
|
||||
|
||||
import cpw.mods.fml.common.API;
|
||||
|
||||
Reference in new issue
Block a user