Added very early alpha air effects.
This commit is contained in:
parent
bae5961a48
commit
5150a6972d
6 changed files with 38 additions and 9 deletions
|
|
@ -4,6 +4,7 @@ import net.minecraft.entity.Entity;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
|
@ -37,7 +38,7 @@ public class ItemStaffAir extends ItemStaff {
|
|||
player.fallDistance = 0.0F;
|
||||
|
||||
if (!world.isRemote)
|
||||
MysticWorld.proxy.airFeetFX(world, (player.posX - 0.5D) + rand.nextDouble(), player.posY + (player.height/itemStack.stackTagCompound.getInteger("maxChargeTime") * itemStack.stackTagCompound.getInteger("chargeTime")), (player.posZ - 0.5D) + rand.nextDouble(), 1.0f + ((float)(itemStack.stackTagCompound.getInteger("chargeTime")) * (5.0f * (1 / (float)itemStack.stackTagCompound.getInteger("maxChargeTime")))));
|
||||
MysticWorld.proxy.airFeetFX(world, (player.posX - 0.5D) + rand.nextDouble(), player.posY + (player.height/itemStack.stackTagCompound.getInteger("maxChargeTime") * itemStack.stackTagCompound.getInteger("chargeTime")), (player.posZ - 0.5D) + rand.nextDouble(), 1.0f + ((float)(itemStack.stackTagCompound.getInteger("chargeTime")) * (5.0f * (1 / (float)itemStack.stackTagCompound.getInteger("maxChargeTime")))), 15);
|
||||
|
||||
if (!Mouse.isButtonDown(1))
|
||||
{
|
||||
|
|
@ -65,22 +66,48 @@ public class ItemStaffAir extends ItemStaff {
|
|||
}
|
||||
|
||||
itemStack.stackTagCompound.setInteger("chargeTime", 0);
|
||||
itemStack.stackTagCompound.setFloat("angle", 0);
|
||||
itemStack.stackTagCompound.setDouble("radius", 0);
|
||||
itemStack.stackTagCompound.setBoolean("charging", false);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)))
|
||||
{
|
||||
if (!world.isRemote)
|
||||
MysticWorld.proxy.airFeetFX(world, player.posX + MathHelper.cos(itemStack.stackTagCompound.getFloat("angle")) * itemStack.stackTagCompound.getDouble("radius"), player.posY, player.posZ + MathHelper.sin(itemStack.stackTagCompound.getFloat("angle")) * itemStack.stackTagCompound.getDouble("radius"), 1.0f + ((float)(itemStack.stackTagCompound.getInteger("chargeTime")) * (5.0f * (1 / (float)itemStack.stackTagCompound.getInteger("maxChargeTime")))), 45);
|
||||
}
|
||||
|
||||
if (itemStack.stackTagCompound.getBoolean("charging") == true)
|
||||
{
|
||||
itemStack.stackTagCompound.setInteger("chargeTime", itemStack.stackTagCompound.getInteger("chargeTime") + 1);
|
||||
itemStack.stackTagCompound.setFloat("angle", itemStack.stackTagCompound.getFloat("angle") + 0.1f);
|
||||
itemStack.stackTagCompound.setDouble("radius", itemStack.stackTagCompound.getDouble("radius") + 0.1D);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
itemStack.stackTagCompound.setInteger("chargeTime", 0);
|
||||
itemStack.stackTagCompound.setFloat("angle", 0);
|
||||
itemStack.stackTagCompound.setDouble("radius", 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (itemStack.stackTagCompound.getInteger("chargeTime") > itemStack.stackTagCompound.getInteger("maxChargeTime"))
|
||||
{
|
||||
itemStack.stackTagCompound.setInteger("chargeTime", itemStack.stackTagCompound.getInteger("maxChargeTime"));
|
||||
}
|
||||
|
||||
if (itemStack.stackTagCompound.getDouble("radius") > 7.0D)
|
||||
{
|
||||
itemStack.stackTagCompound.setDouble("radius", 7.0D);
|
||||
}
|
||||
|
||||
if (itemStack.stackTagCompound.getFloat("angle") > 6.0f)
|
||||
{
|
||||
itemStack.stackTagCompound.setFloat("angle", 0.0f);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -89,6 +116,8 @@ public class ItemStaffAir extends ItemStaff {
|
|||
if (itemStack.stackTagCompound == null)
|
||||
itemStack.setTagCompound(new NBTTagCompound());
|
||||
|
||||
itemStack.stackTagCompound.setDouble("radius", 2.0D);
|
||||
|
||||
if (itemStack.stackTagCompound.getBoolean("charging") == false)
|
||||
{
|
||||
itemStack.stackTagCompound.setBoolean("charging", true);
|
||||
|
|
|
|||
Loading…
Reference in a new issue