Added very early alpha air effects.
This commit is contained in:
parent
bae5961a48
commit
5150a6972d
6 changed files with 38 additions and 9 deletions
|
|
@ -77,9 +77,9 @@ public class ClientProxy extends CommonProxy {
|
||||||
|
|
||||||
//particles
|
//particles
|
||||||
@Override
|
@Override
|
||||||
public void airFeetFX(World worldObj, double x, double y, double z, float scale)
|
public void airFeetFX(World worldObj, double x, double y, double z, float scale, int age)
|
||||||
{
|
{
|
||||||
PowerAirFX airFX = new PowerAirFX(worldObj, x, y, z, scale);
|
PowerAirFX airFX = new PowerAirFX(worldObj, x, y, z, scale, age);
|
||||||
ModLoader.getMinecraftInstance().effectRenderer.addEffect(airFX);
|
ModLoader.getMinecraftInstance().effectRenderer.addEffect(airFX);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ public class PowerAirFX extends EntityFX
|
||||||
super(world, x, y, z);
|
super(world, x, y, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
public PowerAirFX(World world, double x, double y, double z, float scale){
|
public PowerAirFX(World world, double x, double y, double z, float scale, int age){
|
||||||
super(world, x, y, z);
|
super(world, x, y, z);
|
||||||
this.motionX += motionX;
|
this.motionX += motionX;
|
||||||
this.motionY += motionY;
|
this.motionY += motionY;
|
||||||
|
|
@ -31,7 +31,7 @@ public class PowerAirFX extends EntityFX
|
||||||
this.particleBlue = 1.0F;
|
this.particleBlue = 1.0F;
|
||||||
this.particleScale = scale;
|
this.particleScale = scale;
|
||||||
this.noClip = true;
|
this.noClip = true;
|
||||||
this.particleMaxAge = 15;
|
this.particleMaxAge = age;
|
||||||
}
|
}
|
||||||
|
|
||||||
public PowerAirFX(World world, double x, double y, double z, double motionX, double motionY, double motionZ, float rotPitch, float rotYaw){
|
public PowerAirFX(World world, double x, double y, double z, double motionX, double motionY, double motionZ, float rotPitch, float rotYaw){
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ public class CommonProxy {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void airFeetFX(World worldObj, double x, double y, double z, float scale){
|
public void airFeetFX(World worldObj, double x, double y, double z, float scale, int age){
|
||||||
}
|
}
|
||||||
|
|
||||||
public void earthFX(World worldObj, double x, double y, double z, float scale){
|
public void earthFX(World worldObj, double x, double y, double z, float scale){
|
||||||
|
|
|
||||||
|
|
@ -144,8 +144,8 @@ public class EntityChargeAir extends Entity {
|
||||||
f2 = 0.8F;
|
f2 = 0.8F;
|
||||||
}
|
}
|
||||||
|
|
||||||
MysticWorld.proxy.airFeetFX(this.worldObj, this.posX + (rand.nextDouble()/2), this.posY + 0.5D, this.posZ + (rand.nextDouble()/2), particleScale);
|
MysticWorld.proxy.airFeetFX(this.worldObj, this.posX + (rand.nextDouble()/2), this.posY + 0.5D, this.posZ + (rand.nextDouble()/2), particleScale, 15);
|
||||||
MysticWorld.proxy.airFeetFX(this.worldObj, this.posX + (rand.nextDouble()/2), this.posY + 0.5D, this.posZ + (rand.nextDouble()/2), particleScale);
|
MysticWorld.proxy.airFeetFX(this.worldObj, this.posX + (rand.nextDouble()/2), this.posY + 0.5D, this.posZ + (rand.nextDouble()/2), particleScale, 15);
|
||||||
|
|
||||||
this.setPosition(this.posX, this.posY, this.posZ);
|
this.setPosition(this.posX, this.posY, this.posZ);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ public class ItemOrbAir extends ItemOrb
|
||||||
if (currentItem.itemID == itemStack.itemID)
|
if (currentItem.itemID == itemStack.itemID)
|
||||||
{
|
{
|
||||||
player.fallDistance = 0.0F;
|
player.fallDistance = 0.0F;
|
||||||
MysticWorld.proxy.airFeetFX(world, (player.posX - 0.5D) + rand.nextDouble(), player.posY, (player.posZ - 0.5D) + rand.nextDouble(), 1.0F);
|
MysticWorld.proxy.airFeetFX(world, (player.posX - 0.5D) + rand.nextDouble(), player.posY, (player.posZ - 0.5D) + rand.nextDouble(), 1.0F, 15);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.util.MathHelper;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import org.lwjgl.input.Keyboard;
|
import org.lwjgl.input.Keyboard;
|
||||||
|
|
@ -37,7 +38,7 @@ public class ItemStaffAir extends ItemStaff {
|
||||||
player.fallDistance = 0.0F;
|
player.fallDistance = 0.0F;
|
||||||
|
|
||||||
if (!world.isRemote)
|
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))
|
if (!Mouse.isButtonDown(1))
|
||||||
{
|
{
|
||||||
|
|
@ -65,22 +66,48 @@ public class ItemStaffAir extends ItemStaff {
|
||||||
}
|
}
|
||||||
|
|
||||||
itemStack.stackTagCompound.setInteger("chargeTime", 0);
|
itemStack.stackTagCompound.setInteger("chargeTime", 0);
|
||||||
|
itemStack.stackTagCompound.setFloat("angle", 0);
|
||||||
|
itemStack.stackTagCompound.setDouble("radius", 0);
|
||||||
itemStack.stackTagCompound.setBoolean("charging", false);
|
itemStack.stackTagCompound.setBoolean("charging", false);
|
||||||
}
|
}
|
||||||
else
|
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)
|
if (itemStack.stackTagCompound.getBoolean("charging") == true)
|
||||||
{
|
{
|
||||||
itemStack.stackTagCompound.setInteger("chargeTime", itemStack.stackTagCompound.getInteger("chargeTime") + 1);
|
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"))
|
if (itemStack.stackTagCompound.getInteger("chargeTime") > itemStack.stackTagCompound.getInteger("maxChargeTime"))
|
||||||
{
|
{
|
||||||
itemStack.stackTagCompound.setInteger("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
|
@Override
|
||||||
|
|
@ -89,6 +116,8 @@ public class ItemStaffAir extends ItemStaff {
|
||||||
if (itemStack.stackTagCompound == null)
|
if (itemStack.stackTagCompound == null)
|
||||||
itemStack.setTagCompound(new NBTTagCompound());
|
itemStack.setTagCompound(new NBTTagCompound());
|
||||||
|
|
||||||
|
itemStack.stackTagCompound.setDouble("radius", 2.0D);
|
||||||
|
|
||||||
if (itemStack.stackTagCompound.getBoolean("charging") == false)
|
if (itemStack.stackTagCompound.getBoolean("charging") == false)
|
||||||
{
|
{
|
||||||
itemStack.stackTagCompound.setBoolean("charging", true);
|
itemStack.stackTagCompound.setBoolean("charging", true);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue