Some subitem cleanup

Still lots left to do. This will help prepare for The Flattening.
This commit is contained in:
Nicholas Ignoffo 2018-02-13 23:32:15 -08:00
parent 65b89795bc
commit c03af41c88
15 changed files with 210 additions and 281 deletions

View file

@ -36,5 +36,7 @@ public interface IMeshProvider {
* @return - The custom ResourceLocation
*/
@Nullable
ResourceLocation getCustomLocation();
default ResourceLocation getCustomLocation() {
return null;
}
}

View file

@ -17,6 +17,7 @@ import WayofTime.bloodmagic.item.routing.ItemRouterFilter;
import WayofTime.bloodmagic.item.sigil.*;
import WayofTime.bloodmagic.item.soul.*;
import WayofTime.bloodmagic.item.types.ComponentTypes;
import WayofTime.bloodmagic.item.types.ShardType;
import com.google.common.collect.Lists;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.init.Items;
@ -166,11 +167,11 @@ public class RegistrarBloodMagicItems {
new ItemSigilClaw().setRegistryName("sigil_claw"),
new ItemSigilBounce().setRegistryName("sigil_bounce"),
new ItemSigilFrost().setRegistryName("sigil_frost"),
new ItemEnum<>(ComponentTypes.class, "baseComponent").setRegistryName("component"),
new ItemEnum.Variant<>(ComponentTypes.class, "baseComponent").setRegistryName("component"),
new ItemDemonCrystal().setRegistryName("item_demon_crystal"),
new ItemTelepositionFocus().setRegistryName("teleposition_focus"),
new ItemExperienceBook().setRegistryName("experience_tome"),
new ItemBloodShard().setRegistryName("blood_shard"),
new ItemEnum.Variant<>(ShardType.class, "blood_shard").setRegistryName("blood_shard"),
new ItemLivingArmour(EntityEquipmentSlot.HEAD).setRegistryName("living_armour_helmet"),
new ItemLivingArmour(EntityEquipmentSlot.CHEST).setRegistryName("living_armour_chest"),
new ItemLivingArmour(EntityEquipmentSlot.LEGS).setRegistryName("living_armour_leggings"),

View file

@ -1,64 +1,65 @@
package WayofTime.bloodmagic.item;
import WayofTime.bloodmagic.BloodMagic;
import WayofTime.bloodmagic.client.IVariantProvider;
import WayofTime.bloodmagic.apibutnotreally.iface.IBindable;
import WayofTime.bloodmagic.apibutnotreally.util.helper.PlayerHelper;
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
import WayofTime.bloodmagic.item.types.ISubItem;
import WayofTime.bloodmagic.util.helper.TextHelper;
import com.google.common.base.Strings;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair;
import java.util.ArrayList;
import javax.annotation.Nonnull;
import java.util.List;
import java.util.Locale;
public class ItemActivationCrystal extends ItemBindableBase implements IVariantProvider {
public static String[] names = {"weak", "awakened", "creative"};
public class ItemActivationCrystal extends ItemEnum.Variant<ItemActivationCrystal.CrystalType> implements IBindable {
public ItemActivationCrystal() {
super();
super(CrystalType.class, "activation_crystal");
setUnlocalizedName(BloodMagic.MODID + ".activationCrystal.");
setHasSubtypes(true);
}
@Override
public String getUnlocalizedName(ItemStack stack) {
return super.getUnlocalizedName(stack) + names[stack.getItemDamage()];
}
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(CreativeTabs creativeTab, NonNullList<ItemStack> list) {
if (!isInCreativeTab(creativeTab))
return;
for (int i = 0; i < names.length; i++)
list.add(new ItemStack(this, 1, i));
setMaxStackSize(1);
setCreativeTab(BloodMagic.TAB_BM);
}
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, World world, List<String> tooltip, ITooltipFlag flag) {
tooltip.add(TextHelper.localize("tooltip.bloodmagic.activationCrystal." + names[stack.getItemDamage()]));
tooltip.add(TextHelper.localize("tooltip.bloodmagic.activation_crystal." + getItemType(stack).getInternalName()));
if (!stack.hasTagCompound())
return;
if (!Strings.isNullOrEmpty(getOwnerUUID(stack)))
tooltip.add(TextHelper.localizeEffect("tooltip.bloodmagic.currentOwner", PlayerHelper.getUsernameFromStack(stack)));
super.addInformation(stack, world, tooltip, flag);
}
@Override
public List<Pair<Integer, String>> getVariants() {
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
ret.add(new ImmutablePair<Integer, String>(0, "type=weak"));
ret.add(new ImmutablePair<Integer, String>(1, "type=demonic"));
ret.add(new ImmutablePair<Integer, String>(2, "type=creative"));
return ret;
}
public int getCrystalLevel(ItemStack stack) {
return stack.getItemDamage() > 1 ? Integer.MAX_VALUE : stack.getItemDamage() + 1;
}
public enum CrystalType implements ISubItem {
WEAK,
AWAKENED,
CREATIVE,
;
@Nonnull
@Override
public String getInternalName() {
return name().toLowerCase(Locale.ROOT);
}
@Nonnull
@Override
public ItemStack getStack(int count) {
return new ItemStack(RegistrarBloodMagicItems.ACTIVATION_CRYSTAL, count, ordinal());
}
}
}

View file

@ -1,7 +1,6 @@
package WayofTime.bloodmagic.item;
import WayofTime.bloodmagic.BloodMagic;
import WayofTime.bloodmagic.apibutnotreally.iface.IBindable;
import WayofTime.bloodmagic.apibutnotreally.orb.BloodOrb;
import WayofTime.bloodmagic.apibutnotreally.orb.IBloodOrb;
import WayofTime.bloodmagic.apibutnotreally.util.helper.NetworkHelper;
@ -23,7 +22,7 @@ import net.minecraftforge.fml.relauncher.SideOnly;
import javax.annotation.Nullable;
import java.util.List;
public class ItemBloodOrb extends ItemBindableBase implements IBloodOrb, IBindable {
public class ItemBloodOrb extends ItemBindableBase implements IBloodOrb {
public ItemBloodOrb() {
setUnlocalizedName(BloodMagic.MODID + ".orb");
this.setMaxDamage(0);
@ -109,13 +108,6 @@ public class ItemBloodOrb extends ItemBindableBase implements IBloodOrb, IBindab
return true;
}
// IBindable
@Override
public boolean onBind(EntityPlayer player, ItemStack stack) {
return true;
}
// IBloodOrb
@Nullable

View file

@ -1,50 +0,0 @@
package WayofTime.bloodmagic.item;
import WayofTime.bloodmagic.BloodMagic;
import WayofTime.bloodmagic.client.IVariantProvider;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair;
import java.util.ArrayList;
import java.util.List;
public class ItemBloodShard extends Item implements IVariantProvider {
public String[] names = {"weak", "demon"};
public ItemBloodShard() {
super();
setCreativeTab(BloodMagic.TAB_BM);
setUnlocalizedName(BloodMagic.MODID + ".bloodShard.");
setHasSubtypes(true);
}
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(CreativeTabs creativeTab, NonNullList<ItemStack> list) {
if (!isInCreativeTab(creativeTab))
return;
for (int i = 0; i < names.length; i++)
list.add(new ItemStack(this, 1, i));
}
@Override
public String getUnlocalizedName(ItemStack stack) {
return super.getUnlocalizedName(stack) + names[stack.getItemDamage()];
}
@Override
public List<Pair<Integer, String>> getVariants() {
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
ret.add(new ImmutablePair<Integer, String>(0, "type=weak"));
ret.add(new ImmutablePair<Integer, String>(1, "type=demonic"));
return ret;
}
}

View file

@ -3,23 +3,10 @@ package WayofTime.bloodmagic.item;
import WayofTime.bloodmagic.BloodMagic;
import WayofTime.bloodmagic.apibutnotreally.soul.EnumDemonWillType;
import WayofTime.bloodmagic.apibutnotreally.soul.IDiscreteDemonWill;
import WayofTime.bloodmagic.client.IVariantProvider;
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
import com.google.common.collect.Lists;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair;
import java.util.ArrayList;
import java.util.List;
public class ItemDemonCrystal extends ItemEnum<EnumDemonWillType> implements IDiscreteDemonWill, IVariantProvider {
public class ItemDemonCrystal extends ItemEnum.Variant<EnumDemonWillType> implements IDiscreteDemonWill {
public ItemDemonCrystal() {
super(EnumDemonWillType.class, "demonCrystal");

View file

@ -15,7 +15,7 @@ import org.apache.commons.lang3.tuple.Pair;
import java.util.List;
public class ItemEnum<T extends Enum<T> & ISubItem> extends Item implements IVariantProvider {
public class ItemEnum<T extends Enum<T> & ISubItem> extends Item {
protected final T[] types;
@ -48,12 +48,19 @@ public class ItemEnum<T extends Enum<T> & ISubItem> extends Item implements IVar
return types[MathHelper.clamp(stack.getItemDamage(), 0, types.length)];
}
@Override
public List<Pair<Integer, String>> getVariants() {
List<Pair<Integer, String>> variants = Lists.newArrayList();
for (int i = 0; i < types.length; i++)
variants.add(Pair.of(i, "type=" + types[i].getInternalName()));
public static class Variant<T extends Enum<T> & ISubItem> extends ItemEnum<T> implements IVariantProvider {
return variants;
public Variant(Class<T> enumClass, String baseName) {
super(enumClass, baseName);
}
@Override
public List<Pair<Integer, String>> getVariants() {
List<Pair<Integer, String>> variants = Lists.newArrayList();
for (int i = 0; i < types.length; i++)
variants.add(Pair.of(i, "type=" + types[i].getInternalName()));
return variants;
}
}
}

View file

@ -1,6 +1,5 @@
package WayofTime.bloodmagic.item;
import WayofTime.bloodmagic.BloodMagic;
import WayofTime.bloodmagic.ConfigHandler;
import WayofTime.bloodmagic.apibutnotreally.BloodMagicAPI;
import WayofTime.bloodmagic.apibutnotreally.Constants;
@ -9,18 +8,18 @@ import WayofTime.bloodmagic.apibutnotreally.util.helper.NBTHelper;
import WayofTime.bloodmagic.apibutnotreally.util.helper.PlayerHelper;
import WayofTime.bloodmagic.apibutnotreally.util.helper.PlayerSacrificeHelper;
import WayofTime.bloodmagic.client.IMeshProvider;
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
import WayofTime.bloodmagic.item.types.ISubItem;
import WayofTime.bloodmagic.tile.TileAltar;
import WayofTime.bloodmagic.util.helper.TextHelper;
import net.minecraft.client.renderer.ItemMeshDefinition;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.EnumAction;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.*;
@ -30,39 +29,22 @@ import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import javax.annotation.Nullable;
import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Locale;
public class ItemSacrificialDagger extends Item implements IMeshProvider {
public static String[] names = {"normal", "creative"};
public class ItemSacrificialDagger extends ItemEnum<ItemSacrificialDagger.DaggerType> implements IMeshProvider {
public ItemSacrificialDagger() {
super();
super(DaggerType.class, "sacrificial_dagger");
setUnlocalizedName(BloodMagic.MODID + ".sacrificialDagger.");
setCreativeTab(BloodMagic.TAB_BM);
setHasSubtypes(true);
setMaxStackSize(1);
setFull3D();
}
@Override
public String getUnlocalizedName(ItemStack stack) {
return super.getUnlocalizedName(stack) + names[stack.getItemDamage()];
}
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(CreativeTabs creativeTab, NonNullList<ItemStack> list) {
if (!isInCreativeTab(creativeTab))
return;
for (int i = 0; i < names.length; i++)
list.add(new ItemStack(this, 1, i));
}
@Override
public void addInformation(ItemStack stack, World world, List<String> list, ITooltipFlag flag) {
list.addAll(Arrays.asList(TextHelper.cutLongString(TextHelper.localizeEffect("tooltip.bloodmagic.sacrificialDagger.desc"))));
@ -191,9 +173,22 @@ public class ItemSacrificialDagger extends Item implements IMeshProvider {
return variants;
}
@Nullable
@Override
public ResourceLocation getCustomLocation() {
return null;
public enum DaggerType implements ISubItem {
NORMAL,
CREATIVE,
;
@Nonnull
@Override
public String getInternalName() {
return name().toLowerCase(Locale.ROOT);
}
@Nonnull
@Override
public ItemStack getStack(int count) {
return new ItemStack(RegistrarBloodMagicItems.SACRIFICIAL_DAGGER, count, ordinal());
}
}
}

View file

@ -1,47 +1,23 @@
package WayofTime.bloodmagic.item;
import WayofTime.bloodmagic.BloodMagic;
import WayofTime.bloodmagic.client.IVariantProvider;
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
import WayofTime.bloodmagic.item.types.ISubItem;
import WayofTime.bloodmagic.util.helper.TextHelper;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair;
import java.util.ArrayList;
import javax.annotation.Nonnull;
import java.util.Arrays;
import java.util.List;
import java.util.Locale;
public class ItemSlate extends Item implements IVariantProvider {
public String[] names = {"blank", "reinforced", "imbued", "demonic", "ethereal"};
public class ItemSlate extends ItemEnum.Variant<ItemSlate.SlateType> {
public ItemSlate() {
super();
setCreativeTab(BloodMagic.TAB_BM);
setUnlocalizedName(BloodMagic.MODID + ".slate.");
setHasSubtypes(true);
}
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(CreativeTabs creativeTab, NonNullList<ItemStack> list) {
if (!isInCreativeTab(creativeTab))
return;
for (int i = 0; i < names.length; i++)
list.add(new ItemStack(this, 1, i));
}
@Override
public String getUnlocalizedName(ItemStack stack) {
return super.getUnlocalizedName(stack) + names[stack.getItemDamage()];
super(SlateType.class, "slate");
}
@Override
@ -50,14 +26,25 @@ public class ItemSlate extends Item implements IVariantProvider {
list.addAll(Arrays.asList(TextHelper.cutLongString(TextHelper.localizeEffect("tooltip.bloodmagic.slate.desc"))));
}
@Override
public List<Pair<Integer, String>> getVariants() {
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
ret.add(new ImmutablePair<Integer, String>(0, "type=blank"));
ret.add(new ImmutablePair<Integer, String>(1, "type=reinforced"));
ret.add(new ImmutablePair<Integer, String>(2, "type=imbued"));
ret.add(new ImmutablePair<Integer, String>(3, "type=demonic"));
ret.add(new ImmutablePair<Integer, String>(4, "type=ethereal"));
return ret;
public enum SlateType implements ISubItem {
BLANK,
REINFORCED,
IMBUED,
DEMONIC,
ETHEREAL,
;
@Nonnull
@Override
public String getInternalName() {
return name().toLowerCase(Locale.ROOT);
}
@Nonnull
@Override
public ItemStack getStack(int count) {
return new ItemStack(RegistrarBloodMagicItems.SLATE, count, ordinal());
}
}
}

View file

@ -1,56 +1,35 @@
package WayofTime.bloodmagic.item;
import WayofTime.bloodmagic.BloodMagic;
import WayofTime.bloodmagic.apibutnotreally.Constants;
import WayofTime.bloodmagic.apibutnotreally.iface.IBindable;
import WayofTime.bloodmagic.apibutnotreally.util.helper.NBTHelper;
import WayofTime.bloodmagic.client.IVariantProvider;
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
import WayofTime.bloodmagic.item.types.ISubItem;
import WayofTime.bloodmagic.util.helper.TextHelper;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ActionResult;
import net.minecraft.util.EnumHand;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.world.World;
import net.minecraftforge.common.DimensionManager;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair;
import java.util.ArrayList;
import javax.annotation.Nonnull;
import java.util.Arrays;
import java.util.List;
import java.util.Locale;
public class ItemTelepositionFocus extends ItemBindableBase implements IVariantProvider {
public static String[] names = {"weak", "enhanced", "reinforced", "demonic"};
public class ItemTelepositionFocus extends ItemEnum.Variant<ItemTelepositionFocus.FocusType> implements IBindable {
public ItemTelepositionFocus() {
super();
super(FocusType.class, "focus");
setUnlocalizedName(BloodMagic.MODID + ".focus.");
setCreativeTab(BloodMagic.TAB_BM);
setMaxStackSize(1);
setHasSubtypes(true);
}
@Override
public String getUnlocalizedName(ItemStack stack) {
return super.getUnlocalizedName(stack) + names[stack.getItemDamage()];
}
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(CreativeTabs creativeTab, NonNullList<ItemStack> list) {
if (!isInCreativeTab(creativeTab))
return;
for (int i = 0; i < names.length; i++)
list.add(new ItemStack(this, 1, i));
}
@Override
@ -69,7 +48,7 @@ public class ItemTelepositionFocus extends ItemBindableBase implements IVariantP
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, World world, List<String> tooltip, ITooltipFlag flag) {
tooltip.addAll(Arrays.asList(TextHelper.cutLongString(TextHelper.localize("tooltip.bloodmagic.telepositionFocus." + names[stack.getItemDamage()]))));
tooltip.addAll(Arrays.asList(TextHelper.cutLongString(TextHelper.localize("tooltip.bloodmagic.telepositionFocus." + getItemType(stack).getInternalName()))));
super.addInformation(stack, world, tooltip, flag);
@ -86,16 +65,6 @@ public class ItemTelepositionFocus extends ItemBindableBase implements IVariantP
}
}
@Override
public List<Pair<Integer, String>> getVariants() {
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
ret.add(new ImmutablePair<Integer, String>(0, "type=weak"));
ret.add(new ImmutablePair<Integer, String>(1, "type=enhanced"));
ret.add(new ImmutablePair<Integer, String>(2, "type=reinforced"));
ret.add(new ImmutablePair<Integer, String>(3, "type=demonic"));
return ret;
}
public World getWorld(ItemStack stack) {
stack = NBTHelper.checkNBT(stack);
return DimensionManager.getWorld(stack.getTagCompound().getInteger(Constants.NBT.DIMENSION_ID));
@ -115,4 +84,25 @@ public class ItemTelepositionFocus extends ItemBindableBase implements IVariantP
itemTag.setInteger(Constants.NBT.DIMENSION_ID, world.provider.getDimension());
return stack;
}
public enum FocusType implements ISubItem {
WEAK,
ENHANCED,
REINFORCED,
DEMONIC,
;
@Nonnull
@Override
public String getInternalName() {
return name().toLowerCase(Locale.ROOT);
}
@Nonnull
@Override
public ItemStack getStack(int count) {
return new ItemStack(RegistrarBloodMagicItems.TELEPOSITION_FOCUS, count, ordinal());
}
}
}

View file

@ -1,53 +1,32 @@
package WayofTime.bloodmagic.item.soul;
import WayofTime.bloodmagic.BloodMagic;
import WayofTime.bloodmagic.apibutnotreally.Constants;
import WayofTime.bloodmagic.apibutnotreally.soul.EnumDemonWillType;
import WayofTime.bloodmagic.apibutnotreally.soul.IDemonWill;
import WayofTime.bloodmagic.apibutnotreally.util.helper.NBTHelper;
import WayofTime.bloodmagic.client.IVariantProvider;
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
import WayofTime.bloodmagic.item.ItemEnum;
import WayofTime.bloodmagic.item.types.ISubItem;
import WayofTime.bloodmagic.util.helper.TextHelper;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.NonNullList;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair;
import java.util.ArrayList;
import javax.annotation.Nonnull;
import java.util.List;
import java.util.Locale;
public class ItemMonsterSoul extends Item implements IDemonWill, IVariantProvider {
public static String[] names = {"base", "corrosive", "destructive", "vengeful", "steadfast"};
public class ItemMonsterSoul extends ItemEnum.Variant<ItemMonsterSoul.WillType> implements IDemonWill {
public ItemMonsterSoul() {
super();
super(WillType.class, "monster_soul");
setUnlocalizedName(BloodMagic.MODID + ".monsterSoul.");
setCreativeTab(BloodMagic.TAB_BM);
setHasSubtypes(true);
setMaxStackSize(1);
}
@Override
public String getUnlocalizedName(ItemStack stack) {
return super.getUnlocalizedName(stack) + names[stack.getItemDamage()];
}
@Override
public void getSubItems(CreativeTabs creativeTab, NonNullList<ItemStack> list) {
if (!isInCreativeTab(creativeTab))
return;
for (int i = 0; i < names.length; i++)
list.add(new ItemStack(this, 1, i));
}
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, World world, List<String> tooltip, ITooltipFlag flag) {
@ -104,16 +83,6 @@ public class ItemMonsterSoul extends Item implements IDemonWill, IVariantProvide
return soulStack;
}
@Override
public List<Pair<Integer, String>> getVariants() {
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
for (int i = 0; i < names.length; i++) {
String name = names[i];
ret.add(new ImmutablePair<Integer, String>(i, "type=" + name));
}
return ret;
}
@Override
public double getWill(ItemStack willStack) {
return this.getWill(EnumDemonWillType.DEFAULT, willStack);
@ -128,4 +97,26 @@ public class ItemMonsterSoul extends Item implements IDemonWill, IVariantProvide
public double drainWill(ItemStack willStack, double drainAmount) {
return this.drainWill(EnumDemonWillType.DEFAULT, willStack, drainAmount);
}
public enum WillType implements ISubItem {
RAW,
CORROSIVE,
DESTRUCTIVE,
VENGEFUL,
STEADFAST,
;
@Nonnull
@Override
public String getInternalName() {
return name().toLowerCase(Locale.ROOT);
}
@Nonnull
@Override
public ItemStack getStack(int count) {
return new ItemStack(RegistrarBloodMagicItems.MONSTER_SOUL, count, ordinal());
}
}
}

View file

@ -0,0 +1,26 @@
package WayofTime.bloodmagic.item.types;
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
import net.minecraft.item.ItemStack;
import javax.annotation.Nonnull;
import java.util.Locale;
public enum ShardType implements ISubItem {
WEAK,
DEMONIC,
;
@Nonnull
@Override
public String getInternalName() {
return name().toLowerCase(Locale.ROOT);
}
@Nonnull
@Override
public ItemStack getStack(int count) {
return new ItemStack(RegistrarBloodMagicItems.BLOOD_SHARD, count, ordinal());
}
}

View file

@ -11,7 +11,7 @@
"layer0": "bloodmagic:items/activationCrystalWeak"
}
},
"demonic": {
"awakened": {
"textures": {
"layer0": "bloodmagic:items/activationCrystalAwakened"
}

View file

@ -6,7 +6,7 @@
},
"variants": {
"type": {
"base": {
"raw": {
"textures": {
"layer0": "bloodmagic:items/BaseMonsterSoul"
}

View file

@ -3,12 +3,12 @@ itemGroup.bloodmagic.creativeTab=Blood Magic
itemGroup.bloodmagic.creativeTabTome=Blood Magic | Tomes
#Items
item.bloodmagic.activationCrystal.weak.name=Weak Activation Crystal
item.bloodmagic.activationCrystal.awakened.name=Awakened Activation Crystal
item.bloodmagic.activationCrystal.creative.name=Creative Activation Crystal
item.bloodmagic.activation_crystal.weak.name=Weak Activation Crystal
item.bloodmagic.activation_crystal.awakened.name=Awakened Activation Crystal
item.bloodmagic.activation_crystal.creative.name=Creative Activation Crystal
item.bloodmagic.sacrificialDagger.normal.name=Sacrificial Dagger
item.bloodmagic.sacrificialDagger.creative.name=Creative Sacrificial Dagger
item.bloodmagic.sacrificial_dagger.normal.name=Sacrificial Dagger
item.bloodmagic.sacrificial_dagger.creative.name=Creative Sacrificial Dagger
item.bloodmagic.pack.selfSacrifice.name=Blood Letter's Pack
item.bloodmagic.pack.sacrifice.name=Coat of Arms
item.bloodmagic.daggerOfSacrifice.name=Dagger of Sacrifice
@ -63,8 +63,8 @@ item.bloodmagic.reagent.virtus.name=Virtus
item.bloodmagic.reagent.reductus.name=Reductus
item.bloodmagic.reagent.potentia.name=Potentia
item.bloodmagic.bloodShard.weak.name=Weak Blood Shard
item.bloodmagic.bloodShard.demon.name=Demon Blood Shard
item.bloodmagic.blood_shard.weak.name=Weak Blood Shard
item.bloodmagic.blood_shard.demonic.name=Demon Blood Shard
item.bloodmagic.baseComponent.reagent_water.name=Water Reagent
item.bloodmagic.baseComponent.reagent_lava.name=Lava Reagent
@ -110,11 +110,11 @@ item.bloodmagic.demonCrystal.destructive.name=Destructive Will Crystal
item.bloodmagic.demonCrystal.vengeful.name=Vengeful Will Crystal
item.bloodmagic.demonCrystal.steadfast.name=Steadfast Will Crystal
item.bloodmagic.monsterSoul.base.name=Demonic Will
item.bloodmagic.monsterSoul.corrosive.name=Corrosive Demonic Will
item.bloodmagic.monsterSoul.destructive.name=Destructive Demonic Will
item.bloodmagic.monsterSoul.vengeful.name=Vengeful Demonic Will
item.bloodmagic.monsterSoul.steadfast.name=Steadfast Demonic Will
item.bloodmagic.monster_soul.raw.name=Demonic Will
item.bloodmagic.monster_soul.corrosive.name=Corrosive Demonic Will
item.bloodmagic.monster_soul.destructive.name=Destructive Demonic Will
item.bloodmagic.monster_soul.vengeful.name=Vengeful Demonic Will
item.bloodmagic.monster_soul.steadfast.name=Steadfast Demonic Will
item.bloodmagic.sigil.air.name=Air Sigil
item.bloodmagic.sigil.blood_light.name=Sigil of the Blood Lamp
@ -124,7 +124,7 @@ item.bloodmagic.sigil.water.name=Water Sigil
item.bloodmagic.sigil.lava.name=Lava Sigil
item.bloodmagic.sigil.void.name=Void Sigil
item.bloodmagic.sigil.green_grove.name=Sigil of the Green Grove
item.bloodmagic.sigil.elementalAffinity.name=Sigil of Elemental Affinity
item.bloodmagic.sigil.elemental_affinity.name=Sigil of Elemental Affinity
item.bloodmagic.sigil.haste.name=Sigil of Haste
item.bloodmagic.sigil.suppression.name=Sigil of Suppression
item.bloodmagic.sigil.magnetism.name=Sigil of Magnetism
@ -440,9 +440,9 @@ tooltip.bloodmagic.pack.selfSacrifice.desc=This pack really chafes...
tooltip.bloodmagic.pack.sacrifice.desc=Description
tooltip.bloodmagic.pack.stored=Stored: %d LP
tooltip.bloodmagic.activationCrystal.weak=Activates low-level rituals
tooltip.bloodmagic.activationCrystal.awakened=Activates more powerful rituals
tooltip.bloodmagic.activationCrystal.creative=Creative Only - Activates any ritual
tooltip.bloodmagic.activation_crystal.weak=Activates low-level rituals
tooltip.bloodmagic.activation_crystal.awakened=Activates more powerful rituals
tooltip.bloodmagic.activation_crystal.creative=Creative Only - Activates any ritual
tooltip.bloodmagic.diviner.currentRitual=Current Ritual:
tooltip.bloodmagic.diviner.blankRune=Blank Runes: %d