Air Sigil
This commit is contained in:
parent
ac5402df6b
commit
ed515f5c80
3 changed files with 46 additions and 2 deletions
|
@ -0,0 +1,40 @@
|
|||
package WayofTime.bloodmagic.item.sigil;
|
||||
|
||||
import WayofTime.bloodmagic.registry.ModPotions;
|
||||
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() {
|
||||
super("air", 50);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
|
||||
if (!world.isRemote && !isUnusable(stack)) {
|
||||
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);
|
||||
// }
|
||||
|
||||
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)
|
||||
this.setUnusable(stack, !syphonBatteries(stack, player, getEnergyUsed()));
|
||||
}
|
||||
|
||||
return super.onItemRightClick(stack, world, player);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue