2015-02-03 05:12:08 +01:00
|
|
|
package com.pahimar.ee3.api;
|
|
|
|
|
|
|
|
import com.pahimar.ee3.EquivalentExchange3;
|
|
|
|
import cpw.mods.fml.common.Mod;
|
|
|
|
import net.minecraft.block.Block;
|
|
|
|
import net.minecraft.item.Item;
|
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
|
2015-02-05 05:48:07 +01:00
|
|
|
public final class AbilityRegistryProxy
|
|
|
|
{
|
2015-02-03 05:12:08 +01:00
|
|
|
@Mod.Instance("EE3")
|
|
|
|
private static Object ee3Mod;
|
|
|
|
|
2015-02-05 05:48:07 +01:00
|
|
|
public static boolean isLearnable(Block block)
|
|
|
|
{
|
2015-02-03 05:12:08 +01:00
|
|
|
return isLearnable(new ItemStack(block));
|
|
|
|
}
|
|
|
|
|
2015-02-05 05:48:07 +01:00
|
|
|
public static boolean isLearnable(Item item)
|
|
|
|
{
|
2015-02-03 05:12:08 +01:00
|
|
|
return isLearnable(new ItemStack(item));
|
|
|
|
}
|
|
|
|
|
2015-02-05 05:48:07 +01:00
|
|
|
public static boolean isLearnable(ItemStack itemStack)
|
|
|
|
{
|
2015-02-03 05:12:08 +01:00
|
|
|
init();
|
|
|
|
|
2015-02-05 05:48:07 +01:00
|
|
|
if (ee3Mod != null)
|
|
|
|
{
|
2015-02-03 05:12:08 +01:00
|
|
|
return EE3Wrapper.ee3mod.getAbilityRegistry().isLearnable(itemStack);
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-02-05 05:48:07 +01:00
|
|
|
public static void setAsLearnable(Block block)
|
|
|
|
{
|
2015-02-03 05:12:08 +01:00
|
|
|
setAsLearnable(new ItemStack(block));
|
|
|
|
}
|
|
|
|
|
2015-02-05 05:48:07 +01:00
|
|
|
public static void setAsLearnable(Item item)
|
|
|
|
{
|
2015-02-03 05:12:08 +01:00
|
|
|
setAsLearnable(new ItemStack(item));
|
|
|
|
}
|
|
|
|
|
2015-02-05 05:48:07 +01:00
|
|
|
public static void setAsLearnable(ItemStack itemStack)
|
|
|
|
{
|
2015-02-03 05:12:08 +01:00
|
|
|
init();
|
|
|
|
|
2015-02-05 05:48:07 +01:00
|
|
|
if (ee3Mod != null)
|
|
|
|
{
|
2015-02-03 05:12:08 +01:00
|
|
|
EE3Wrapper.ee3mod.getAbilityRegistry().setAsLearnable(itemStack);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-02-05 05:48:07 +01:00
|
|
|
public static void setAsNotLearnable(Block block)
|
|
|
|
{
|
2015-02-03 05:12:08 +01:00
|
|
|
setAsNotLearnable(new ItemStack(block));
|
|
|
|
}
|
|
|
|
|
2015-02-05 05:48:07 +01:00
|
|
|
public static void setAsNotLearnable(Item item)
|
|
|
|
{
|
2015-02-03 05:12:08 +01:00
|
|
|
setAsNotLearnable(new ItemStack(item));
|
|
|
|
}
|
|
|
|
|
2015-02-05 05:48:07 +01:00
|
|
|
public static void setAsNotLearnable(ItemStack itemStack)
|
|
|
|
{
|
2015-02-03 05:12:08 +01:00
|
|
|
init();
|
|
|
|
|
2015-02-05 05:48:07 +01:00
|
|
|
if (ee3Mod != null)
|
|
|
|
{
|
2015-02-03 05:12:08 +01:00
|
|
|
EE3Wrapper.ee3mod.getAbilityRegistry().setAsNotLearnable(itemStack);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-02-05 05:48:07 +01:00
|
|
|
public static boolean isRecoverable(Block block)
|
|
|
|
{
|
2015-02-03 05:12:08 +01:00
|
|
|
return isRecoverable(new ItemStack(block));
|
|
|
|
}
|
|
|
|
|
2015-02-05 05:48:07 +01:00
|
|
|
public static boolean isRecoverable(Item item)
|
|
|
|
{
|
2015-02-03 05:12:08 +01:00
|
|
|
return isRecoverable(new ItemStack(item));
|
|
|
|
}
|
|
|
|
|
2015-02-05 05:48:07 +01:00
|
|
|
public static boolean isRecoverable(ItemStack itemStack)
|
|
|
|
{
|
2015-02-03 05:12:08 +01:00
|
|
|
init();
|
|
|
|
|
2015-02-05 05:48:07 +01:00
|
|
|
if (ee3Mod != null)
|
|
|
|
{
|
2015-02-03 05:12:08 +01:00
|
|
|
return EE3Wrapper.ee3mod.getAbilityRegistry().isRecoverable(itemStack);
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-02-05 05:48:07 +01:00
|
|
|
public static void setAsRecoverable(Block block)
|
|
|
|
{
|
2015-02-03 05:12:08 +01:00
|
|
|
setAsRecoverable(new ItemStack(block));
|
|
|
|
}
|
|
|
|
|
2015-02-05 05:48:07 +01:00
|
|
|
public static void setAsRecoverable(Item item)
|
|
|
|
{
|
2015-02-03 05:12:08 +01:00
|
|
|
setAsRecoverable(new ItemStack(item));
|
|
|
|
}
|
|
|
|
|
2015-02-05 05:48:07 +01:00
|
|
|
public static void setAsRecoverable(ItemStack itemStack)
|
|
|
|
{
|
2015-02-03 05:12:08 +01:00
|
|
|
init();
|
|
|
|
|
2015-02-05 05:48:07 +01:00
|
|
|
if (ee3Mod != null)
|
|
|
|
{
|
2015-02-03 05:12:08 +01:00
|
|
|
EE3Wrapper.ee3mod.getAbilityRegistry().setAsRecoverable(itemStack);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-02-05 05:48:07 +01:00
|
|
|
public static void setAsNotRecoverable(Block block)
|
|
|
|
{
|
2015-02-03 05:12:08 +01:00
|
|
|
setAsNotRecoverable(new ItemStack(block));
|
|
|
|
}
|
|
|
|
|
2015-02-05 05:48:07 +01:00
|
|
|
public static void setAsNotRecoverable(Item item)
|
|
|
|
{
|
2015-02-03 05:12:08 +01:00
|
|
|
setAsNotRecoverable(new ItemStack(item));
|
|
|
|
}
|
|
|
|
|
2015-02-05 05:48:07 +01:00
|
|
|
public static void setAsNotRecoverable(ItemStack itemStack)
|
|
|
|
{
|
2015-02-03 05:12:08 +01:00
|
|
|
init();
|
|
|
|
|
2015-02-05 05:48:07 +01:00
|
|
|
if (ee3Mod != null)
|
|
|
|
{
|
2015-02-03 05:12:08 +01:00
|
|
|
EE3Wrapper.ee3mod.getAbilityRegistry().setAsNotRecoverable(itemStack);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-02-05 05:48:07 +01:00
|
|
|
private static class EE3Wrapper
|
|
|
|
{
|
2015-02-03 05:12:08 +01:00
|
|
|
private static EquivalentExchange3 ee3mod;
|
|
|
|
}
|
|
|
|
|
2015-02-05 05:48:07 +01:00
|
|
|
private static void init()
|
|
|
|
{
|
|
|
|
if (ee3Mod != null)
|
|
|
|
{
|
2015-02-03 05:12:08 +01:00
|
|
|
EE3Wrapper.ee3mod = (EquivalentExchange3) ee3Mod;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|