From 12856eac7fbfb91bc53e9489896a795d25a53fef Mon Sep 17 00:00:00 2001 From: sheenrox82 Date: Sat, 9 Aug 2014 11:25:04 -0500 Subject: [PATCH] Fixes rawtypes and unchecked SuppressWarnings. --- src/main/java/baubles/api/BaublesApi.java | 25 +++++++++++++++-------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/src/main/java/baubles/api/BaublesApi.java b/src/main/java/baubles/api/BaublesApi.java index ca94fcd..f122e90 100644 --- a/src/main/java/baubles/api/BaublesApi.java +++ b/src/main/java/baubles/api/BaublesApi.java @@ -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; }