mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-27 23:45:55 +00:00
#2203 Clean up baubles code, but I don't think it will affect anything
This commit is contained in:
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);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user