package com.mattdahepic.mobdropores.block;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IStringSerializable;
import java.util.HashMap;
import java.util.Map;
public enum EnumMob implements IStringSerializable {
ZOMBIE("zombie",0,new ItemStackWithChance[]{new ItemStackWithChance(MobDropManager.ROTTEN_FLESH,0.5F,2)}),
BLAZE("blaze",1,new ItemStackWithChance[]{new ItemStackWithChance(MobDropManager.BLAZE_ROD,0.5F,1)}),
CREEPER("creeper",2,new ItemStackWithChance[]{new ItemStackWithChance(MobDropManager.GUNPOWDER,0.5F,2)}),
ENDERMAN("enderman",3,new ItemStackWithChance[]{new ItemStackWithChance(MobDropManager.ENDER_PEARL,0.5F,1)}),
GHAST("ghast",4,new ItemStackWithChance[]{new ItemStackWithChance(MobDropManager.GHAST_TEAR,1.0F,1),new ItemStackWithChance(MobDropManager.GUNPOWDER,0.5F,2)}),
GUARDIAN("guardian",5,new ItemStackWithChance[]{new ItemStackWithChance(MobDropManager.PRIS_CRYS,0.5F,1),new ItemStackWithChance(MobDropManager.PRIS_SHARD,0.5F,2),new ItemStackWithChance(MobDropManager.RAW_FISH,0.5F,1)}),
SKELETON("skeleton",6,new ItemStackWithChance[]{new ItemStackWithChance(MobDropManager.BONE,0.5F,2),new ItemStackWithChance(MobDropManager.ARROW,0.5F,2)}),
SLIME("slime",7,new ItemStackWithChance[]{new ItemStackWithChance(MobDropManager.SLIME_BALL,0.5F,2)}),
SPIDER("spider",8,new ItemStackWithChance[]{new ItemStackWithChance(MobDropManager.STRING,0.5F,2),new ItemStackWithChance(MobDropManager.SPIDER_EYE,0.5F,1)}),
WITCH("witch",9,new ItemStackWithChance[]{new ItemStackWithChance(MobDropManager.GLASS_BOTT,0.5F,1),new ItemStackWithChance(MobDropManager.GLOW_DUST,0.5F,1),new ItemStackWithChance(MobDropManager.GUNPOWDER,0.5F,1),new ItemStackWithChance(MobDropManager.REDSTONE,0.5F,1),new ItemStackWithChance(MobDropManager.SPIDER_EYE,0.5F,1),new ItemStackWithChance(MobDropManager.STICK,0.5F,2),new ItemStackWithChance(MobDropManager.SUGAR,0.5F,1)}),
WITHER("wither",10,new ItemStackWithChance[]{new ItemStackWithChance(MobDropManager.STAR,0.01F,1)});
private Map<Integer,EnumMob> META_TO_MOB = new HashMap<>();
private Map<EnumMob,Integer> MOB_TO_META = new HashMap<>();
private final String name;
private final ItemStackWithChance[] drops;
EnumMob (String name, int meta, ItemStackWithChance[] drops) {
this.name = name;
this.drops = drops;
META_TO_MOB.put(meta,this);
MOB_TO_META.put(this,meta);
}
public ItemStackWithChance[] getDrops () {
return drops;
}
public String getName() {
return name;
}
public int metaFromMob (EnumMob mob) {
return MOB_TO_META.get(mob);
}
public EnumMob mobFromMeta (int meta) {
return META_TO_MOB.get(meta);
}
}