#2203 Clean up baubles code, but I don't think it will affect anything

This commit is contained in:
tterrag1098 committed 2015-04-03 00:08:20 -04:00
1 parent 06528517fd
commit f95895a38d
10 files changed
+62 -74

No files matched your search

@@ -0,0 +1,34 @@
package crazypants.util;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import baubles.api.BaublesApi;
import cpw.mods.fml.common.Loader;
public class BaublesUtil {
private static final BaublesUtil instance = new BaublesUtil();
private static final boolean baublesLoaded;
static {
baublesLoaded = Loader.isModLoaded("Baubles");
}
private BaublesUtil() {
}
public static BaublesUtil instance() {
return instance;
}
public boolean hasBaubles() {
return baublesLoaded;
}
public IInventory getBaubles(EntityPlayer player) {
return hasBaubles() ? getBaublesInvUnsafe(player) : null;
}
private IInventory getBaublesInvUnsafe(EntityPlayer player) {
return BaublesApi.getBaubles(player);
}
}