2015-11-02 12:39:44 -08:00
|
|
|
package WayofTime.bloodmagic.api.registry;
|
2015-10-29 20:22:14 -07:00
|
|
|
|
2016-03-17 13:00:44 -07: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-14 20:53:42 -07:00
|
|
|
import WayofTime.bloodmagic.registry.RegistrarBloodMagicItems;
|
2016-03-17 13:00:44 -07: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 02:34:49 -08:00
|
|
|
import net.minecraft.item.Item;
|
2015-10-29 20:22:14 -07:00
|
|
|
import net.minecraft.item.ItemStack;
|
2017-08-14 20:53:42 -07:00
|
|
|
import net.minecraft.nbt.NBTTagCompound;
|
2016-01-10 14:34:01 -08:00
|
|
|
import net.minecraft.util.ResourceLocation;
|
2015-10-29 22:06:18 -07:00
|
|
|
import net.minecraftforge.client.model.ModelLoader;
|
2017-08-14 20:53:42 -07:00
|
|
|
import net.minecraftforge.fml.common.registry.GameRegistry;
|
2015-10-29 20:22:14 -07:00
|
|
|
import net.minecraftforge.fml.relauncher.Side;
|
|
|
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
|
|
|
2016-03-17 13:00:44 -07:00
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.Collections;
|
|
|
|
import java.util.List;
|
2015-10-29 20:22:14 -07:00
|
|
|
|
|
|
|
/**
|
2015-12-30 15:34:40 -05: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-29 20:22:14 -07:00
|
|
|
*/
|
2017-08-14 20:53:42 -07:00
|
|
|
@Deprecated
|
2015-12-30 15:34:40 -05:00
|
|
|
public class OrbRegistry
|
|
|
|
{
|
2015-10-29 20:22:14 -07:00
|
|
|
private static List<BloodOrb> orbs = new ArrayList<BloodOrb>();
|
2017-08-14 20:53:42 -07:00
|
|
|
public static ArrayListMultimap<Integer, ItemStack> tierMap = ArrayListMultimap.create();
|
2015-10-29 20:22:14 -07:00
|
|
|
|
2017-08-14 20:53:42 -07:00
|
|
|
@GameRegistry.ObjectHolder("bloodmagic:blood_orb")
|
|
|
|
private static final Item ORB_ITEM = null;
|
2015-10-29 20:22:14 -07:00
|
|
|
|
2016-02-16 20:48:42 -08: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 15:34:40 -05:00
|
|
|
public static ItemStack getOrbStack(BloodOrb orb)
|
|
|
|
{
|
2017-08-14 20:53:42 -07: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 09:49:12 -08:00
|
|
|
}
|
|
|
|
|
2016-03-16 18:41:06 -04:00
|
|
|
public static ArrayListMultimap<Integer, ItemStack> getTierMap()
|
|
|
|
{
|
2016-02-18 09:49:12 -08:00
|
|
|
return ArrayListMultimap.create(tierMap);
|
|
|
|
}
|
2015-10-29 20:22:14 -07:00
|
|
|
}
|