BloodMagic/src/main/java/WayofTime/bloodmagic/item/sigil/ItemSigilAir.java

44 lines
1.6 KiB
Java
Raw Normal View History

2015-11-02 19:57:48 -08:00
package WayofTime.bloodmagic.item.sigil;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
public class ItemSigilAir extends ItemSigilBase
{
public ItemSigilAir()
{
2015-11-02 19:57:48 -08:00
super("air", 50);
}
@Override
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player)
{
if (!world.isRemote && !isUnusable(stack))
{
2015-11-02 19:57:48 -08:00
Vec3 vec = player.getLookVec();
double wantedVelocity = 1.7;
// TODO - Revisit after potions
// if (player.isPotionActive(ModPotions.customPotionBoost)) {
// int amplifier =
// player.getActivePotionEffect(ModPotions.customPotionBoost).getAmplifier();
// wantedVelocity += (1 + amplifier) * (0.35);
// }
2015-11-02 19:57:48 -08:00
player.motionX = vec.xCoord * wantedVelocity;
player.motionY = vec.yCoord * wantedVelocity;
player.motionZ = vec.zCoord * wantedVelocity;
player.velocityChanged = true;
world.playSoundEffect((double) ((float) player.posX + 0.5F), (double) ((float) player.posY + 0.5F), (double) ((float) player.posZ + 0.5F), "random.fizz", 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F);
player.fallDistance = 0;
if (!player.capabilities.isCreativeMode)
2015-12-30 17:24:40 -05:00
this.setUnusable(stack, !syphonNetwork(stack, player, getLPUsed()));
2015-11-02 19:57:48 -08:00
}
return super.onItemRightClick(stack, world, player);
}
}