mirror of
https://github.com/GTNewHorizons/Baubles-Expanded.git
synced 2026-11-20 12:09:59 +00:00
Fixes rawtypes and unchecked SuppressWarnings.
This commit is contained in:
1 parent
2ef1fca7cb
commit
12856eac7f
1 file changed
+16
-9
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user