Added the Soul Snare renderer and recipe and basically everything soul snare
This commit is contained in:
parent
c015e3421f
commit
74718f5042
18 changed files with 273 additions and 23 deletions
|
@ -0,0 +1,72 @@
|
|||
package WayofTime.bloodmagic.item.soul;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.entity.projectile.EntitySoulSnare;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
|
||||
public class ItemSoulSnare extends Item
|
||||
{
|
||||
public static String[] names = { "base" };
|
||||
|
||||
public ItemSoulSnare()
|
||||
{
|
||||
super();
|
||||
|
||||
setUnlocalizedName(Constants.Mod.MODID + ".soulSnare.");
|
||||
setCreativeTab(BloodMagic.tabBloodMagic);
|
||||
setHasSubtypes(true);
|
||||
setMaxStackSize(16);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn)
|
||||
{
|
||||
if (!playerIn.capabilities.isCreativeMode)
|
||||
{
|
||||
--itemStackIn.stackSize;
|
||||
}
|
||||
|
||||
worldIn.playSoundAtEntity(playerIn, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
|
||||
|
||||
if (!worldIn.isRemote)
|
||||
{
|
||||
worldIn.spawnEntityInWorld(new EntitySoulSnare(worldIn, playerIn));
|
||||
}
|
||||
|
||||
return itemStackIn;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack stack)
|
||||
{
|
||||
return super.getUnlocalizedName(stack) + names[stack.getItemDamage()];
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item id, CreativeTabs creativeTab, List<ItemStack> list)
|
||||
{
|
||||
for (int i = 0; i < names.length; i++)
|
||||
list.add(new ItemStack(id, 1, i));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List<String> tooltip, boolean advanced)
|
||||
{
|
||||
tooltip.add(TextHelper.localize("tooltip.BloodMagic.soulSnare.desc1"));
|
||||
tooltip.add(TextHelper.localize("tooltip.BloodMagic.soulSnare.desc2"));
|
||||
|
||||
super.addInformation(stack, player, tooltip, advanced);
|
||||
}
|
||||
}
|
|
@ -145,8 +145,12 @@ public class ItemSoulSword extends ItemSword implements ISoulWeapon
|
|||
if (getActivated(stack))
|
||||
{
|
||||
ISoul soul = ((ISoul) ModItems.monsterSoul);
|
||||
ItemStack soulStack = soul.createSoul(0, looting * 0.5 + 1);
|
||||
soulList.add(soulStack);
|
||||
|
||||
for (int i = 0; i <= looting; i++)
|
||||
{
|
||||
ItemStack soulStack = soul.createSoul(0, (getDamageOfActivatedSword(stack) - 7) / 2 * attackingEntity.worldObj.rand.nextDouble() + 0.5);
|
||||
soulList.add(soulStack);
|
||||
}
|
||||
}
|
||||
|
||||
return soulList;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue