equivalent-exchange-3/src/main/java/com/pahimar/ee3/api/EnergyValueRegistryProxy.java

106 lines
2.6 KiB
Java
Raw Normal View History

package com.pahimar.ee3.api;
import com.pahimar.ee3.EquivalentExchange3;
import cpw.mods.fml.common.Mod;
2014-07-14 12:51:35 +02:00
public final class EnergyValueRegistryProxy
{
@Mod.Instance("EE3")
private static Object ee3Mod;
2014-07-14 12:52:08 +02:00
public static void addPreAssignedEnergyValue(Object object, int energyValue)
{
addPreAssignedEnergyValue(object, new EnergyValue(energyValue));
}
2014-07-14 12:52:08 +02:00
public static void addPreAssignedEnergyValue(Object object, float energyValue)
{
addPreAssignedEnergyValue(object, new EnergyValue(energyValue));
}
2014-07-14 12:52:08 +02:00
public static void addPreAssignedEnergyValue(Object object, EnergyValue energyValue)
{
init();
// NOOP if EquivalentExchange3 is not present
if (ee3Mod == null)
{
return;
}
EE3Wrapper.ee3mod.getEnergyValueRegistry().addPreAssignedEnergyValue(object, energyValue);
}
2014-07-14 12:52:08 +02:00
public static void addPostAssignedEnergyValue(Object object, int energyValue)
{
addPostAssignedEnergyValue(object, new EnergyValue(energyValue));
}
2014-07-14 12:52:08 +02:00
public static void addPostAssignedEnergyValue(Object object, float energyValue)
{
addPostAssignedEnergyValue(object, new EnergyValue(energyValue));
}
2014-07-14 12:52:08 +02:00
public static void addPostAssignedEnergyValue(Object object, EnergyValue energyValue)
{
init();
// NOOP if EquivalentExchange3 is not present
if (ee3Mod == null)
{
return;
}
EE3Wrapper.ee3mod.getEnergyValueRegistry().addPostAssignedEnergyValue(object, energyValue);
}
2014-07-14 12:52:08 +02:00
public static boolean hasEnergyValue(Object object)
{
return hasEnergyValue(object, false);
}
2014-07-14 12:52:08 +02:00
public static boolean hasEnergyValue(Object object, boolean strict)
{
init();
// NOOP if EquivalentExchange3 is not present
if (ee3Mod == null)
{
return false;
}
return EE3Wrapper.ee3mod.getEnergyValueRegistry().hasEnergyValue(object, strict);
}
2014-07-14 12:52:08 +02:00
public static EnergyValue getEnergyValue(Object object)
{
return getEnergyValue(object, false);
}
2014-07-14 12:52:08 +02:00
public static EnergyValue getEnergyValue(Object object, boolean strict)
{
init();
// NOOP if EquivalentExchange3 is not present
if (ee3Mod == null)
{
return null;
}
return EE3Wrapper.ee3mod.getEnergyValueRegistry().getEnergyValue(object, strict);
}
private static void init()
{
if (ee3Mod != null)
{
EE3Wrapper.ee3mod = (EquivalentExchange3) ee3Mod;
}
}
private static class EE3Wrapper
{
private static EquivalentExchange3 ee3mod;
}
}