2015-02-03 05:12:08 +01:00
|
|
|
package com.pahimar.ee3.api;
|
|
|
|
|
|
|
|
import com.pahimar.ee3.EquivalentExchange3;
|
|
|
|
import cpw.mods.fml.common.Mod;
|
|
|
|
|
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-08 05:12:25 +01:00
|
|
|
public static boolean isLearnable(Object object)
|
2015-02-05 05:48:07 +01:00
|
|
|
{
|
2015-02-03 05:12:08 +01:00
|
|
|
init();
|
|
|
|
|
2015-02-05 05:48:07 +01:00
|
|
|
if (ee3Mod != null)
|
|
|
|
{
|
2015-02-08 05:12:25 +01:00
|
|
|
return EE3Wrapper.ee3mod.getAbilityRegistry().isLearnable(object);
|
2015-02-03 05:12:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-02-08 05:12:25 +01:00
|
|
|
public static void setAsLearnable(Object object)
|
2015-02-05 05:48:07 +01:00
|
|
|
{
|
2015-02-03 05:12:08 +01:00
|
|
|
init();
|
|
|
|
|
2015-02-05 05:48:07 +01:00
|
|
|
if (ee3Mod != null)
|
|
|
|
{
|
2015-02-08 05:12:25 +01:00
|
|
|
EE3Wrapper.ee3mod.getAbilityRegistry().setAsLearnable(object);
|
2015-02-03 05:12:08 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-02-08 05:12:25 +01:00
|
|
|
public static void setAsNotLearnable(Object object)
|
2015-02-05 05:48:07 +01:00
|
|
|
{
|
2015-02-03 05:12:08 +01:00
|
|
|
init();
|
|
|
|
|
2015-02-05 05:48:07 +01:00
|
|
|
if (ee3Mod != null)
|
|
|
|
{
|
2015-02-08 05:12:25 +01:00
|
|
|
EE3Wrapper.ee3mod.getAbilityRegistry().setAsNotLearnable(object);
|
2015-02-03 05:12:08 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-02-08 05:12:25 +01:00
|
|
|
public static boolean isRecoverable(Object object)
|
2015-02-05 05:48:07 +01:00
|
|
|
{
|
2015-02-03 05:12:08 +01:00
|
|
|
init();
|
|
|
|
|
2015-02-05 05:48:07 +01:00
|
|
|
if (ee3Mod != null)
|
|
|
|
{
|
2015-02-08 05:12:25 +01:00
|
|
|
return EE3Wrapper.ee3mod.getAbilityRegistry().isRecoverable(object);
|
2015-02-03 05:12:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-02-08 05:12:25 +01:00
|
|
|
public static void setAsRecoverable(Object object)
|
2015-02-05 05:48:07 +01:00
|
|
|
{
|
2015-02-03 05:12:08 +01:00
|
|
|
init();
|
|
|
|
|
2015-02-05 05:48:07 +01:00
|
|
|
if (ee3Mod != null)
|
|
|
|
{
|
2015-02-08 05:12:25 +01:00
|
|
|
EE3Wrapper.ee3mod.getAbilityRegistry().setAsRecoverable(object);
|
2015-02-03 05:12:08 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-02-08 05:12:25 +01:00
|
|
|
public static void setAsNotRecoverable(Object object)
|
2015-02-05 05:48:07 +01:00
|
|
|
{
|
2015-02-03 05:12:08 +01:00
|
|
|
init();
|
|
|
|
|
2015-02-05 05:48:07 +01:00
|
|
|
if (ee3Mod != null)
|
|
|
|
{
|
2015-02-08 05:12:25 +01:00
|
|
|
EE3Wrapper.ee3mod.getAbilityRegistry().setAsNotRecoverable(object);
|
2015-02-03 05:12:08 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-04-09 18:40:19 +02:00
|
|
|
public static void dumpAbilityRegistryToLog()
|
|
|
|
{
|
|
|
|
dumpAbilityRegistryToLog(Abilities.ALL);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void dumpAbilityRegistryToLog(Abilities ability)
|
|
|
|
{
|
|
|
|
init();
|
|
|
|
|
|
|
|
if (ee3Mod != null)
|
|
|
|
{
|
|
|
|
EE3Wrapper.ee3mod.getAbilityRegistry().dumpAbilityRegistryToLog(ability);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
2015-04-09 18:40:19 +02:00
|
|
|
|
|
|
|
public enum Abilities
|
|
|
|
{
|
|
|
|
NOT_LEARNABLE,
|
|
|
|
NOT_RECOVERABLE,
|
|
|
|
ALL
|
|
|
|
}
|
2015-02-03 05:12:08 +01:00
|
|
|
}
|