2015-11-02 20:39:44 +00:00
|
|
|
package WayofTime.bloodmagic.api.registry;
|
2015-10-30 03:22:14 +00:00
|
|
|
|
2016-03-17 20:00:44 +00:00
|
|
|
import WayofTime.bloodmagic.api.BloodMagicAPI;
|
|
|
|
import WayofTime.bloodmagic.api.Constants;
|
|
|
|
import WayofTime.bloodmagic.api.altar.EnumAltarTier;
|
|
|
|
import WayofTime.bloodmagic.api.orb.BloodOrb;
|
|
|
|
import WayofTime.bloodmagic.api.orb.IBloodOrb;
|
2017-08-15 03:53:42 +00:00
|
|
|
import WayofTime.bloodmagic.registry.RegistrarBloodMagicItems;
|
2016-03-17 20:00:44 +00:00
|
|
|
import com.google.common.collect.ArrayListMultimap;
|
|
|
|
import net.minecraft.client.renderer.block.model.ModelBakery;
|
|
|
|
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
2016-01-19 10:34:49 +00:00
|
|
|
import net.minecraft.item.Item;
|
2015-10-30 03:22:14 +00:00
|
|
|
import net.minecraft.item.ItemStack;
|
2017-08-15 03:53:42 +00:00
|
|
|
import net.minecraft.nbt.NBTTagCompound;
|
2016-01-10 22:34:01 +00:00
|
|
|
import net.minecraft.util.ResourceLocation;
|
2015-10-30 05:06:18 +00:00
|
|
|
import net.minecraftforge.client.model.ModelLoader;
|
2017-08-15 03:53:42 +00:00
|
|
|
import net.minecraftforge.fml.common.registry.GameRegistry;
|
2015-10-30 03:22:14 +00:00
|
|
|
import net.minecraftforge.fml.relauncher.Side;
|
|
|
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
|
|
|
2016-03-17 20:00:44 +00:00
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.Collections;
|
|
|
|
import java.util.List;
|
2015-10-30 03:22:14 +00:00
|
|
|
|
|
|
|
/**
|
2015-12-30 20:34:40 +00:00
|
|
|
* This is only for those who wish to add a basic {@link BloodOrb}. If you need
|
|
|
|
* custom handling, you will need your own item class.
|
2015-10-30 03:22:14 +00:00
|
|
|
*/
|
2017-08-15 03:53:42 +00:00
|
|
|
@Deprecated
|
2015-12-30 20:34:40 +00:00
|
|
|
public class OrbRegistry
|
|
|
|
{
|
2015-10-30 03:22:14 +00:00
|
|
|
private static List<BloodOrb> orbs = new ArrayList<BloodOrb>();
|
2017-08-15 03:53:42 +00:00
|
|
|
public static ArrayListMultimap<Integer, ItemStack> tierMap = ArrayListMultimap.create();
|
2015-10-30 03:22:14 +00:00
|
|
|
|
2017-08-15 03:53:42 +00:00
|
|
|
@GameRegistry.ObjectHolder("bloodmagic:blood_orb")
|
|
|
|
private static final Item ORB_ITEM = null;
|
2015-10-30 03:22:14 +00:00
|
|
|
|
2016-02-17 04:48:42 +00:00
|
|
|
public static List<ItemStack> getOrbsForTier(int tier)
|
|
|
|
{
|
|
|
|
if (getTierMap().containsKey(tier))
|
|
|
|
return getTierMap().get(tier);
|
|
|
|
|
|
|
|
return Collections.emptyList();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static List<ItemStack> getOrbsUpToTier(int tier)
|
|
|
|
{
|
|
|
|
List<ItemStack> ret = new ArrayList<ItemStack>();
|
|
|
|
|
|
|
|
for (int i = 1; i <= tier; i++)
|
|
|
|
ret.addAll(getOrbsForTier(i));
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static List<ItemStack> getOrbsDownToTier(int tier)
|
|
|
|
{
|
|
|
|
List<ItemStack> ret = new ArrayList<ItemStack>();
|
|
|
|
|
|
|
|
for (int i = EnumAltarTier.MAXTIERS; i >= tier; i--)
|
|
|
|
ret.addAll(getOrbsForTier(i));
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2015-12-30 20:34:40 +00:00
|
|
|
public static ItemStack getOrbStack(BloodOrb orb)
|
|
|
|
{
|
2017-08-15 03:53:42 +00:00
|
|
|
ItemStack ret = new ItemStack(ORB_ITEM);
|
|
|
|
NBTTagCompound tag = new NBTTagCompound();
|
|
|
|
tag.setString("orb", orb.getRegistryName().toString());
|
|
|
|
ret.setTagCompound(tag);
|
|
|
|
return ret;
|
2016-02-18 17:49:12 +00:00
|
|
|
}
|
|
|
|
|
2016-03-16 22:41:06 +00:00
|
|
|
public static ArrayListMultimap<Integer, ItemStack> getTierMap()
|
|
|
|
{
|
2016-02-18 17:49:12 +00:00
|
|
|
return ArrayListMultimap.create(tierMap);
|
|
|
|
}
|
2015-10-30 03:22:14 +00:00
|
|
|
}
|