2015-11-02 12:39:44 -08:00
|
|
|
package WayofTime.bloodmagic.api;
|
2015-10-29 20:22:14 -07:00
|
|
|
|
2015-11-02 12:39:44 -08:00
|
|
|
import WayofTime.bloodmagic.api.util.helper.LogHelper;
|
2015-10-29 20:22:14 -07:00
|
|
|
import lombok.Getter;
|
|
|
|
import lombok.Setter;
|
2016-01-01 12:33:42 -08:00
|
|
|
import net.minecraft.block.Block;
|
2015-10-29 20:22:14 -07:00
|
|
|
import net.minecraft.item.Item;
|
|
|
|
import net.minecraft.util.DamageSource;
|
|
|
|
import net.minecraftforge.fluids.Fluid;
|
2015-12-23 09:42:52 -08:00
|
|
|
import net.minecraftforge.fml.common.registry.GameRegistry;
|
2015-10-29 20:22:14 -07:00
|
|
|
|
2016-01-01 12:33:42 -08:00
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
|
|
|
|
2015-12-30 15:34:40 -05:00
|
|
|
public class BloodMagicAPI
|
|
|
|
{
|
2015-12-23 09:42:52 -08:00
|
|
|
public static final String ORB = "ItemBloodOrb";
|
|
|
|
public static final String SCRIBE = "ItemInscriptionTool";
|
|
|
|
|
2016-01-01 12:33:42 -08:00
|
|
|
@Getter
|
|
|
|
private static final List<BlockStack> teleposerBlacklist = new ArrayList<BlockStack>();
|
|
|
|
|
2015-12-30 15:34:40 -05:00
|
|
|
@Getter
|
|
|
|
@Setter
|
2015-10-29 20:22:14 -07:00
|
|
|
private static boolean loggingEnabled;
|
|
|
|
|
|
|
|
@Getter
|
2015-11-02 12:39:44 -08:00
|
|
|
private static LogHelper logger = new LogHelper("BloodMagic|API");
|
2015-10-29 20:22:14 -07:00
|
|
|
|
|
|
|
@Getter
|
|
|
|
private static DamageSource damageSource = new DamageSourceBloodMagic();
|
|
|
|
|
2016-01-01 12:33:42 -08:00
|
|
|
@Getter
|
|
|
|
@Setter
|
|
|
|
private static Fluid lifeEssence;
|
|
|
|
|
2015-12-23 09:42:52 -08:00
|
|
|
/**
|
2015-12-30 15:34:40 -05:00
|
|
|
* Used to obtain Items from BloodMagic. Use the constants above for common
|
|
|
|
* items in case internal names change.
|
|
|
|
*
|
|
|
|
* @param name
|
|
|
|
* - The registered name of the item. Usually the same as the
|
|
|
|
* class name.
|
2015-12-23 09:42:52 -08:00
|
|
|
* @return - The requested Item
|
|
|
|
*/
|
2015-12-30 15:34:40 -05:00
|
|
|
public static Item getItem(String name)
|
|
|
|
{
|
2015-12-23 09:42:52 -08:00
|
|
|
return GameRegistry.findItem(Constants.Mod.MODID, name);
|
|
|
|
}
|
2015-12-02 00:55:32 -08:00
|
|
|
|
2016-01-01 12:33:42 -08:00
|
|
|
/**
|
|
|
|
* Used to add a {@link BlockStack} to the Teleposer blacklist that
|
|
|
|
* cannot be changed via Configuration files.
|
|
|
|
*
|
|
|
|
* @param blockStack
|
|
|
|
* - The BlockStack to blacklist.
|
|
|
|
*/
|
|
|
|
public static void addToTeleposerBlacklist(BlockStack blockStack)
|
|
|
|
{
|
|
|
|
if (!teleposerBlacklist.contains(blockStack))
|
|
|
|
teleposerBlacklist.add(blockStack);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @see #addToTeleposerBlacklist(BlockStack)
|
|
|
|
*
|
|
|
|
* @param block
|
|
|
|
* - The block to blacklist
|
|
|
|
* @param meta
|
|
|
|
* - The meta of the block to blacklist
|
|
|
|
*/
|
|
|
|
public static void addToTeleposerBlacklist(Block block, int meta)
|
|
|
|
{
|
|
|
|
addToTeleposerBlacklist(new BlockStack(block, meta));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @see #addToTeleposerBlacklist(BlockStack)
|
|
|
|
*
|
|
|
|
* @param block
|
|
|
|
* - The block to blacklist
|
|
|
|
*/
|
|
|
|
public static void addToTeleposerBlacklist(Block block)
|
|
|
|
{
|
|
|
|
addToTeleposerBlacklist(block, 0);
|
|
|
|
}
|
2015-10-29 20:22:14 -07:00
|
|
|
}
|