Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.techmage.magetech.item;
- import com.techmage.magetech.handler.SoulsHandler;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.entity.projectile.EntitySmallFireball;
- import net.minecraft.item.ItemStack;
- import net.minecraft.util.Vec3;
- import net.minecraft.world.World;
- public class ItemBookFireball extends ItemMageTech
- {
- public static final int soulCost = 100;
- public ItemBookFireball()
- {
- super();
- this.setMaxStackSize(1);
- }
- @Override
- public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn)
- {
- if (SoulsHandler.hasEnoughSouls(playerIn, soulCost))
- {
- SoulsHandler.useSouls(playerIn, soulCost);
- Vec3 look = playerIn.getLookVec();
- EntitySmallFireball fireball = new EntitySmallFireball(worldIn, playerIn, 1, 1, 1);
- fireball.setPosition(playerIn.posX + look.xCoord * 5, playerIn.posY + 1 + look.yCoord * 5, playerIn.posZ + look.zCoord * 5);
- fireball.accelerationX = look.xCoord * 0.1;
- fireball.accelerationY = look.yCoord * 0.1;
- fireball.accelerationZ = look.zCoord * 0.1;
- worldIn.spawnEntityInWorld(fireball);
- }
- return itemStackIn;
- }
- }
Add Comment
Please, Sign In to add comment