Massive rework of configs, items and blocks.

I redone where the items/blocsks are stored and how the configs are
handled to clean up it and give space. You can change the config line to
AWWayofTime if you want to keep the compatibility with old configs. Now
you reference the blocks from the ModBlocks and Items from the ModItems.
This commit is contained in:
Fenn 2014-01-17 21:05:38 +00:00
parent 8601e9faff
commit e3644f2d2b
304 changed files with 3941 additions and 5108 deletions

View file

@ -1,8 +1,7 @@
package WayofTime.alchemicalWizardry.common.entity.projectile;
import java.util.Iterator;
import java.util.List;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@ -11,28 +10,23 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumMovingObjectType;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.util.*;
import net.minecraft.world.World;
import cpw.mods.fml.common.network.PacketDispatcher;
import cpw.mods.fml.common.network.Player;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.Iterator;
import java.util.List;
//Shamelessly ripped off from x3n0ph0b3
public class EnergyBlastProjectile extends Entity implements IProjectile
{
public class EnergyBlastProjectile extends Entity implements IProjectile {
protected int xTile = -1;
protected int yTile = -1;
protected int zTile = -1;
protected int inTile = 0;
protected int inData = 0;
protected boolean inGround = false;
/** The owner of this arrow. */
/**
* The owner of this arrow.
*/
public EntityLivingBase shootingEntity;
protected int ticksInAir = 0;
protected int maxTicksInAir = 600;
@ -61,14 +55,14 @@ public class EnergyBlastProjectile extends Entity implements IProjectile
float par3 = 0.8F;
this.setSize(0.5F, 0.5F);
this.setLocationAndAngles(par2EntityPlayer.posX, par2EntityPlayer.posY + par2EntityPlayer.getEyeHeight(), par2EntityPlayer.posZ, par2EntityPlayer.rotationYaw, par2EntityPlayer.rotationPitch);
posX -= MathHelper.cos(rotationYaw / 180.0F * (float)Math.PI) * 0.16F;
posX -= MathHelper.cos(rotationYaw / 180.0F * (float) Math.PI) * 0.16F;
posY -= 0.2D;
posZ -= MathHelper.sin(rotationYaw / 180.0F * (float)Math.PI) * 0.16F;
posZ -= MathHelper.sin(rotationYaw / 180.0F * (float) Math.PI) * 0.16F;
this.setPosition(posX, posY, posZ);
yOffset = 0.0F;
motionX = -MathHelper.sin(rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float)Math.PI);
motionZ = MathHelper.cos(rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float)Math.PI);
motionY = -MathHelper.sin(rotationPitch / 180.0F * (float)Math.PI);
motionX = -MathHelper.sin(rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float) Math.PI);
motionZ = MathHelper.cos(rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float) Math.PI);
motionY = -MathHelper.sin(rotationPitch / 180.0F * (float) Math.PI);
this.setThrowableHeading(motionX, motionY, motionZ, par3 * 1.5F, 1.0F);
this.projectileDamage = damage;
this.maxTicksInAir = 600;
@ -81,14 +75,14 @@ public class EnergyBlastProjectile extends Entity implements IProjectile
float par3 = 0.8F;
this.setSize(0.5F, 0.5F);
this.setLocationAndAngles(posX, posY, posZ, rotationYaw, rotationPitch);
posX -= MathHelper.cos(rotationYaw / 180.0F * (float)Math.PI) * 0.16F;
posX -= MathHelper.cos(rotationYaw / 180.0F * (float) Math.PI) * 0.16F;
posY -= 0.2D;
posZ -= MathHelper.sin(rotationYaw / 180.0F * (float)Math.PI) * 0.16F;
posZ -= MathHelper.sin(rotationYaw / 180.0F * (float) Math.PI) * 0.16F;
this.setPosition(posX, posY, posZ);
yOffset = 0.0F;
motionX = -MathHelper.sin(rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float)Math.PI);
motionZ = MathHelper.cos(rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float)Math.PI);
motionY = -MathHelper.sin(rotationPitch / 180.0F * (float)Math.PI);
motionX = -MathHelper.sin(rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float) Math.PI);
motionZ = MathHelper.cos(rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float) Math.PI);
motionY = -MathHelper.sin(rotationPitch / 180.0F * (float) Math.PI);
this.setThrowableHeading(motionX, motionY, motionZ, par3 * 1.5F, 1.0F);
this.projectileDamage = damage;
this.maxTicksInAir = maxTicksInAir;
@ -99,21 +93,21 @@ public class EnergyBlastProjectile extends Entity implements IProjectile
super(par1World);
this.renderDistanceWeight = 10.0D;
this.shootingEntity = par2EntityLivingBase;
this.posY = par2EntityLivingBase.posY + (double)par2EntityLivingBase.getEyeHeight() - 0.10000000149011612D;
this.posY = par2EntityLivingBase.posY + (double) par2EntityLivingBase.getEyeHeight() - 0.10000000149011612D;
double d0 = par3EntityLivingBase.posX - par2EntityLivingBase.posX;
double d1 = par3EntityLivingBase.boundingBox.minY + (double)(par3EntityLivingBase.height / 1.5F) - this.posY;
double d1 = par3EntityLivingBase.boundingBox.minY + (double) (par3EntityLivingBase.height / 1.5F) - this.posY;
double d2 = par3EntityLivingBase.posZ - par2EntityLivingBase.posZ;
double d3 = (double)MathHelper.sqrt_double(d0 * d0 + d2 * d2);
double d3 = (double) MathHelper.sqrt_double(d0 * d0 + d2 * d2);
if (d3 >= 1.0E-7D)
{
float f2 = (float)(Math.atan2(d2, d0) * 180.0D / Math.PI) - 90.0F;
float f3 = (float)(-(Math.atan2(d1, d3) * 180.0D / Math.PI));
float f2 = (float) (Math.atan2(d2, d0) * 180.0D / Math.PI) - 90.0F;
float f3 = (float) (-(Math.atan2(d1, d3) * 180.0D / Math.PI));
double d4 = d0 / d3;
double d5 = d2 / d3;
this.setLocationAndAngles(par2EntityLivingBase.posX + d4, this.posY, par2EntityLivingBase.posZ + d5, f2, f3);
this.yOffset = 0.0F;
float f4 = (float)d3 * 0.2F;
float f4 = (float) d3 * 0.2F;
this.setThrowableHeading(d0, d1, d2, par4, par5);
}
@ -124,7 +118,7 @@ public class EnergyBlastProjectile extends Entity implements IProjectile
@Override
protected void entityInit()
{
dataWatcher.addObject(16, Byte.valueOf((byte)0));
dataWatcher.addObject(16, Byte.valueOf((byte) 0));
}
/**
@ -148,8 +142,8 @@ public class EnergyBlastProjectile extends Entity implements IProjectile
motionY = var3;
motionZ = var5;
float var10 = MathHelper.sqrt_double(var1 * var1 + var5 * var5);
prevRotationYaw = rotationYaw = (float)(Math.atan2(var1, var5) * 180.0D / Math.PI);
prevRotationPitch = rotationPitch = (float)(Math.atan2(var3, var10) * 180.0D / Math.PI);
prevRotationYaw = rotationYaw = (float) (Math.atan2(var1, var5) * 180.0D / Math.PI);
prevRotationPitch = rotationPitch = (float) (Math.atan2(var3, var10) * 180.0D / Math.PI);
}
@Override
@ -178,8 +172,8 @@ public class EnergyBlastProjectile extends Entity implements IProjectile
if (prevRotationPitch == 0.0F && prevRotationYaw == 0.0F)
{
float var7 = MathHelper.sqrt_double(par1 * par1 + par5 * par5);
prevRotationYaw = rotationYaw = (float)(Math.atan2(par1, par5) * 180.0D / Math.PI);
prevRotationPitch = rotationPitch = (float)(Math.atan2(par3, var7) * 180.0D / Math.PI);
prevRotationYaw = rotationYaw = (float) (Math.atan2(par1, par5) * 180.0D / Math.PI);
prevRotationPitch = rotationPitch = (float) (Math.atan2(par3, var7) * 180.0D / Math.PI);
prevRotationPitch = rotationPitch;
prevRotationYaw = rotationYaw;
this.setLocationAndAngles(posX, posY, posZ, rotationYaw, rotationPitch);
@ -208,7 +202,7 @@ public class EnergyBlastProjectile extends Entity implements IProjectile
while (i.hasNext())
{
EntityPlayer e = (EntityPlayer)i.next();
EntityPlayer e = (EntityPlayer) i.next();
double distance = e.getDistanceToEntity(this);
if (distance < closestDistance)
@ -226,8 +220,8 @@ public class EnergyBlastProjectile extends Entity implements IProjectile
if (prevRotationPitch == 0.0F && prevRotationYaw == 0.0F)
{
float var1 = MathHelper.sqrt_double(motionX * motionX + motionZ * motionZ);
prevRotationYaw = rotationYaw = (float)(Math.atan2(motionX, motionZ) * 180.0D / Math.PI);
prevRotationPitch = rotationPitch = (float)(Math.atan2(motionY, var1) * 180.0D / Math.PI);
prevRotationYaw = rotationYaw = (float) (Math.atan2(motionX, motionZ) * 180.0D / Math.PI);
prevRotationPitch = rotationPitch = (float) (Math.atan2(motionY, var1) * 180.0D / Math.PI);
}
int var16 = worldObj.getBlockId(xTile, yTile, zTile);
@ -253,8 +247,7 @@ public class EnergyBlastProjectile extends Entity implements IProjectile
// this.groundImpact();
// this.setDead();
}
}
else
} else
{
++ticksInAir;
@ -286,7 +279,7 @@ public class EnergyBlastProjectile extends Entity implements IProjectile
while (var9.hasNext())
{
Entity var10 = (Entity)var9.next();
Entity var10 = (Entity) var9.next();
if (var10.canBeCollidedWith() && (var10 != shootingEntity || ticksInAir >= 5))
{
@ -343,12 +336,12 @@ public class EnergyBlastProjectile extends Entity implements IProjectile
@Override
public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound)
{
par1NBTTagCompound.setShort("xTile", (short)xTile);
par1NBTTagCompound.setShort("yTile", (short)yTile);
par1NBTTagCompound.setShort("zTile", (short)zTile);
par1NBTTagCompound.setByte("inTile", (byte)inTile);
par1NBTTagCompound.setByte("inData", (byte)inData);
par1NBTTagCompound.setByte("inGround", (byte)(inGround ? 1 : 0));
par1NBTTagCompound.setShort("xTile", (short) xTile);
par1NBTTagCompound.setShort("yTile", (short) yTile);
par1NBTTagCompound.setShort("zTile", (short) zTile);
par1NBTTagCompound.setByte("inTile", (byte) inTile);
par1NBTTagCompound.setByte("inData", (byte) inData);
par1NBTTagCompound.setByte("inGround", (byte) (inGround ? 1 : 0));
par1NBTTagCompound.setInteger("ticksInAir", ticksInAir);
par1NBTTagCompound.setInteger("maxTicksInAir", maxTicksInAir);
par1NBTTagCompound.setInteger("projectileDamage", this.projectileDamage);
@ -414,11 +407,10 @@ public class EnergyBlastProjectile extends Entity implements IProjectile
if (par1)
{
dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 | 1)));
}
else
dataWatcher.updateObject(16, Byte.valueOf((byte) (var2 | 1)));
} else
{
dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 & -2)));
dataWatcher.updateObject(16, Byte.valueOf((byte) (var2 & -2)));
}
}
@ -442,10 +434,9 @@ public class EnergyBlastProjectile extends Entity implements IProjectile
}
this.onImpact(mop.entityHit);
}
else if (mop.typeOfHit == EnumMovingObjectType.TILE)
} else if (mop.typeOfHit == EnumMovingObjectType.TILE)
{
worldObj.createExplosion(shootingEntity, this.posX, this.posY, this.posZ, (float)(0.1), true);
worldObj.createExplosion(shootingEntity, this.posX, this.posY, this.posZ, (float) (0.1), true);
this.setDead();
}
}
@ -456,17 +447,16 @@ public class EnergyBlastProjectile extends Entity implements IProjectile
{
shootingEntity.attackEntityFrom(DamageSource.causeMobDamage(shootingEntity), 1);
this.setDead();
}
else
} else
{
//doDamage(8 + d6(), mop);
if (mop instanceof EntityLivingBase)
{
((EntityLivingBase)mop).addPotionEffect(new PotionEffect(Potion.weakness.id, 60, 2));
((EntityLivingBase) mop).addPotionEffect(new PotionEffect(Potion.weakness.id, 60, 2));
}
doDamage(projectileDamage, mop);
worldObj.createExplosion(shootingEntity, this.posX, this.posY, this.posZ, (float)(0.1), true);
worldObj.createExplosion(shootingEntity, this.posX, this.posY, this.posZ, (float) (0.1), true);
}
spawnHitParticles("magicCrit", 8);

View file

@ -1,6 +1,6 @@
package WayofTime.alchemicalWizardry.common.entity.projectile;
import WayofTime.alchemicalWizardry.common.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.common.ModBlocks;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@ -11,8 +11,7 @@ import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
public class EntityBloodLightProjectile extends EnergyBlastProjectile
{
public class EntityBloodLightProjectile extends EnergyBlastProjectile {
public EntityBloodLightProjectile(World par1World)
{
super(par1World);
@ -35,7 +34,7 @@ public class EntityBloodLightProjectile extends EnergyBlastProjectile
public EntityBloodLightProjectile(World par1World, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase, float par4, float par5, int damage, int maxTicksInAir)
{
super(par1World, par2EntityLivingBase, par3EntityLivingBase, par4, par5, damage, maxTicksInAir);
super(par1World, par2EntityLivingBase, par3EntityLivingBase, par4, par5, damage, maxTicksInAir);
}
@Override
@ -55,8 +54,7 @@ public class EntityBloodLightProjectile extends EnergyBlastProjectile
}
this.onImpact(mop.entityHit);
}
else if (mop.typeOfHit == EnumMovingObjectType.TILE)
} else if (mop.typeOfHit == EnumMovingObjectType.TILE)
{
int sideHit = mop.sideHit;
int blockX = mop.blockX;
@ -65,32 +63,32 @@ public class EntityBloodLightProjectile extends EnergyBlastProjectile
if (sideHit == 0 && this.worldObj.isAirBlock(blockX, blockY - 1, blockZ))
{
this.worldObj.setBlock(blockX, blockY - 1, blockZ, AlchemicalWizardry.blockBloodLight.blockID);
this.worldObj.setBlock(blockX, blockY - 1, blockZ, ModBlocks.blockBloodLight.blockID);
}
if (sideHit == 1 && this.worldObj.isAirBlock(blockX, blockY + 1, blockZ))
{
this.worldObj.setBlock(blockX, blockY + 1, blockZ, AlchemicalWizardry.blockBloodLight.blockID);
this.worldObj.setBlock(blockX, blockY + 1, blockZ, ModBlocks.blockBloodLight.blockID);
}
if (sideHit == 2 && this.worldObj.isAirBlock(blockX, blockY, blockZ - 1))
{
this.worldObj.setBlock(blockX, blockY, blockZ - 1 , AlchemicalWizardry.blockBloodLight.blockID);
this.worldObj.setBlock(blockX, blockY, blockZ - 1, ModBlocks.blockBloodLight.blockID);
}
if (sideHit == 3 && this.worldObj.isAirBlock(blockX, blockY, blockZ + 1))
{
this.worldObj.setBlock(blockX, blockY, blockZ + 1 , AlchemicalWizardry.blockBloodLight.blockID);
this.worldObj.setBlock(blockX, blockY, blockZ + 1, ModBlocks.blockBloodLight.blockID);
}
if (sideHit == 4 && this.worldObj.isAirBlock(blockX - 1, blockY, blockZ))
{
this.worldObj.setBlock(blockX - 1, blockY, blockZ, AlchemicalWizardry.blockBloodLight.blockID);
this.worldObj.setBlock(blockX - 1, blockY, blockZ, ModBlocks.blockBloodLight.blockID);
}
if (sideHit == 5 && this.worldObj.isAirBlock(blockX + 1, blockY, blockZ))
{
this.worldObj.setBlock(blockX + 1, blockY, blockZ, AlchemicalWizardry.blockBloodLight.blockID);
this.worldObj.setBlock(blockX + 1, blockY, blockZ, ModBlocks.blockBloodLight.blockID);
}
//worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(0.1), true);
@ -106,33 +104,31 @@ public class EntityBloodLightProjectile extends EnergyBlastProjectile
{
shootingEntity.attackEntityFrom(DamageSource.causeMobDamage(shootingEntity), 1);
this.setDead();
}
else
} else
{
//doDamage(8 + d6(), mop);
if (mop instanceof EntityLivingBase)
{
//((EntityLivingBase)mop).addPotionEffect(new PotionEffect(Potion.weakness.id, 60,2));
((EntityLivingBase)mop).setFire(50);
((EntityLivingBase)mop).setRevengeTarget(shootingEntity);
((EntityLivingBase) mop).setFire(50);
((EntityLivingBase) mop).setRevengeTarget(shootingEntity);
if (((EntityLivingBase)mop).isPotionActive(Potion.fireResistance) || ((EntityLivingBase)mop).isImmuneToFire())
if (((EntityLivingBase) mop).isPotionActive(Potion.fireResistance) || ((EntityLivingBase) mop).isImmuneToFire())
{
((EntityLivingBase)mop).attackEntityFrom(DamageSource.causeMobDamage(shootingEntity), 1);
}
else
((EntityLivingBase) mop).attackEntityFrom(DamageSource.causeMobDamage(shootingEntity), 1);
} else
{
doDamage(projectileDamage, mop);
((EntityLivingBase)mop).hurtResistantTime = 0;
((EntityLivingBase) mop).hurtResistantTime = 0;
}
}
//worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(0.1), true);
}
if (worldObj.isAirBlock((int)this.posX, (int)this.posY, (int)this.posZ))
if (worldObj.isAirBlock((int) this.posX, (int) this.posY, (int) this.posZ))
{
worldObj.setBlock((int)this.posX, (int)this.posY, (int)this.posZ, Block.fire.blockID);
worldObj.setBlock((int) this.posX, (int) this.posY, (int) this.posZ, Block.fire.blockID);
}
spawnHitParticles("magicCrit", 8);

View file

@ -1,19 +1,13 @@
package WayofTime.alchemicalWizardry.common.entity.projectile;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumMovingObjectType;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
public class EntityEnergyBazookaMainProjectile extends EnergyBlastProjectile
{
public class EntityEnergyBazookaMainProjectile extends EnergyBlastProjectile {
public EntityEnergyBazookaMainProjectile(World par1World)
{
super(par1World);
@ -36,7 +30,7 @@ public class EntityEnergyBazookaMainProjectile extends EnergyBlastProjectile
public EntityEnergyBazookaMainProjectile(World par1World, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase, float par4, float par5, int damage, int maxTicksInAir)
{
super(par1World, par2EntityLivingBase, par3EntityLivingBase, par4, par5, damage, maxTicksInAir);
super(par1World, par2EntityLivingBase, par3EntityLivingBase, par4, par5, damage, maxTicksInAir);
}
@Override
@ -56,10 +50,9 @@ public class EntityEnergyBazookaMainProjectile extends EnergyBlastProjectile
}
this.onImpact(mop.entityHit);
}
else if (mop.typeOfHit == EnumMovingObjectType.TILE)
} else if (mop.typeOfHit == EnumMovingObjectType.TILE)
{
worldObj.createExplosion(this.shootingEntity, this.posX, this.posY, this.posZ, (float)(5.0f), false);
worldObj.createExplosion(this.shootingEntity, this.posX, this.posY, this.posZ, (float) (5.0f), false);
this.spawnSecondaryProjectiles();
}
@ -73,8 +66,7 @@ public class EntityEnergyBazookaMainProjectile extends EnergyBlastProjectile
{
shootingEntity.attackEntityFrom(DamageSource.causeMobDamage(shootingEntity), 1);
this.setDead();
}
else
} else
{
//doDamage(8 + d6(), mop);
if (mop instanceof EntityLivingBase)
@ -82,7 +74,7 @@ public class EntityEnergyBazookaMainProjectile extends EnergyBlastProjectile
spawnSecondaryProjectiles();
}
worldObj.createExplosion(this.shootingEntity, this.posX, this.posY, this.posZ, (float)(5.0f), false);
worldObj.createExplosion(this.shootingEntity, this.posX, this.posY, this.posZ, (float) (5.0f), false);
}
spawnHitParticles("magicCrit", 8);

View file

@ -1,32 +1,29 @@
package WayofTime.alchemicalWizardry.common.entity.projectile;
import java.util.Iterator;
import java.util.List;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.IProjectile;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumMovingObjectType;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.util.*;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectile implements IProjectile
{
import java.util.Iterator;
import java.util.List;
public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectile implements IProjectile {
private int xTile = -1;
private int yTile = -1;
private int zTile = -1;
private int inTile = 0;
private int inData = 0;
private boolean inGround = false;
/** The owner of this arrow. */
/**
* The owner of this arrow.
*/
public EntityLivingBase shootingEntity;
private int ticksInAir = 0;
private int ricochetCounter = 0;
@ -56,14 +53,14 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil
float par3 = 0.8F;
this.setSize(0.1F, 0.1F);
this.setLocationAndAngles(par2EntityPlayer.posX, par2EntityPlayer.posY + par2EntityPlayer.getEyeHeight(), par2EntityPlayer.posZ, par2EntityPlayer.rotationYaw, par2EntityPlayer.rotationPitch);
posX -= MathHelper.cos(rotationYaw / 180.0F * (float)Math.PI) * 0.16F;
posX -= MathHelper.cos(rotationYaw / 180.0F * (float) Math.PI) * 0.16F;
posY -= 0.2D;
posZ -= MathHelper.sin(rotationYaw / 180.0F * (float)Math.PI) * 0.16F;
posZ -= MathHelper.sin(rotationYaw / 180.0F * (float) Math.PI) * 0.16F;
this.setPosition(posX, posY, posZ);
yOffset = 0.0F;
motionX = -MathHelper.sin(rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float)Math.PI);
motionZ = MathHelper.cos(rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float)Math.PI);
motionY = -MathHelper.sin(rotationPitch / 180.0F * (float)Math.PI);
motionX = -MathHelper.sin(rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float) Math.PI);
motionZ = MathHelper.cos(rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float) Math.PI);
motionY = -MathHelper.sin(rotationPitch / 180.0F * (float) Math.PI);
this.setThrowableHeading(motionX, motionY, motionZ, par3 * 1.5F, 1.0F);
this.damage = damage;
}
@ -71,7 +68,7 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil
@Override
protected void entityInit()
{
dataWatcher.addObject(16, Byte.valueOf((byte)0));
dataWatcher.addObject(16, Byte.valueOf((byte) 0));
}
/**
@ -95,8 +92,8 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil
motionY = var3;
motionZ = var5;
float var10 = MathHelper.sqrt_double(var1 * var1 + var5 * var5);
prevRotationYaw = rotationYaw = (float)(Math.atan2(var1, var5) * 180.0D / Math.PI);
prevRotationPitch = rotationPitch = (float)(Math.atan2(var3, var10) * 180.0D / Math.PI);
prevRotationYaw = rotationYaw = (float) (Math.atan2(var1, var5) * 180.0D / Math.PI);
prevRotationPitch = rotationPitch = (float) (Math.atan2(var3, var10) * 180.0D / Math.PI);
}
@Override
@ -125,8 +122,8 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil
if (prevRotationPitch == 0.0F && prevRotationYaw == 0.0F)
{
float var7 = MathHelper.sqrt_double(par1 * par1 + par5 * par5);
prevRotationYaw = rotationYaw = (float)(Math.atan2(par1, par5) * 180.0D / Math.PI);
prevRotationPitch = rotationPitch = (float)(Math.atan2(par3, var7) * 180.0D / Math.PI);
prevRotationYaw = rotationYaw = (float) (Math.atan2(par1, par5) * 180.0D / Math.PI);
prevRotationPitch = rotationPitch = (float) (Math.atan2(par3, var7) * 180.0D / Math.PI);
prevRotationPitch = rotationPitch;
prevRotationYaw = rotationYaw;
this.setLocationAndAngles(posX, posY, posZ, rotationYaw, rotationPitch);
@ -153,7 +150,7 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil
while (i.hasNext())
{
EntityPlayer e = (EntityPlayer)i.next();
EntityPlayer e = (EntityPlayer) i.next();
double distance = e.getDistanceToEntity(this);
if (distance < closestDistance)
@ -171,8 +168,8 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil
if (prevRotationPitch == 0.0F && prevRotationYaw == 0.0F)
{
float var1 = MathHelper.sqrt_double(motionX * motionX + motionZ * motionZ);
prevRotationYaw = rotationYaw = (float)(Math.atan2(motionX, motionZ) * 180.0D / Math.PI);
prevRotationPitch = rotationPitch = (float)(Math.atan2(motionY, var1) * 180.0D / Math.PI);
prevRotationYaw = rotationYaw = (float) (Math.atan2(motionX, motionZ) * 180.0D / Math.PI);
prevRotationPitch = rotationPitch = (float) (Math.atan2(motionY, var1) * 180.0D / Math.PI);
}
int var16 = worldObj.getBlockId(xTile, yTile, zTile);
@ -198,8 +195,7 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil
// this.groundImpact();
// this.setDead();
}
}
else
} else
{
++ticksInAir;
@ -232,7 +228,7 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil
while (var9.hasNext())
{
Entity var10 = (Entity)var9.next();
Entity var10 = (Entity) var9.next();
if (var10.canBeCollidedWith() && (var10 != shootingEntity || ticksInAir >= 5))
{
@ -290,12 +286,12 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil
@Override
public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound)
{
par1NBTTagCompound.setShort("xTile", (short)xTile);
par1NBTTagCompound.setShort("yTile", (short)yTile);
par1NBTTagCompound.setShort("zTile", (short)zTile);
par1NBTTagCompound.setByte("inTile", (byte)inTile);
par1NBTTagCompound.setByte("inData", (byte)inData);
par1NBTTagCompound.setByte("inGround", (byte)(inGround ? 1 : 0));
par1NBTTagCompound.setShort("xTile", (short) xTile);
par1NBTTagCompound.setShort("yTile", (short) yTile);
par1NBTTagCompound.setShort("zTile", (short) zTile);
par1NBTTagCompound.setByte("inTile", (byte) inTile);
par1NBTTagCompound.setByte("inData", (byte) inData);
par1NBTTagCompound.setByte("inGround", (byte) (inGround ? 1 : 0));
}
/**
@ -355,11 +351,10 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil
if (par1)
{
dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 | 1)));
}
else
dataWatcher.updateObject(16, Byte.valueOf((byte) (var2 | 1)));
} else
{
dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 & -2)));
dataWatcher.updateObject(16, Byte.valueOf((byte) (var2 & -2)));
}
}
@ -383,8 +378,7 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil
}
this.onImpact(mop.entityHit);
}
else if (mop.typeOfHit == EnumMovingObjectType.TILE)
} else if (mop.typeOfHit == EnumMovingObjectType.TILE)
{
this.groundImpact(mop.sideHit);
worldObj.createExplosion(shootingEntity, posX, posY, posZ, 2, false);
@ -397,8 +391,7 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil
{
shootingEntity.attackEntityFrom(DamageSource.causeMobDamage(shootingEntity), 1);
this.setDead();
}
else
} else
{
doDamage(this.damage + d6(), mop);
worldObj.createExplosion(shootingEntity, posX, posY, posZ, 2, false);

View file

@ -1,20 +1,13 @@
package WayofTime.alchemicalWizardry.common.entity.projectile;
import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorRegistry;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumMovingObjectType;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
public class EntityMeteor extends EnergyBlastProjectile
{
public class EntityMeteor extends EnergyBlastProjectile {
private int meteorID;
public EntityMeteor(World par1World)
@ -46,8 +39,7 @@ public class EntityMeteor extends EnergyBlastProjectile
if (mop.typeOfHit == EnumMovingObjectType.ENTITY && mop.entityHit != null)
{
this.onImpact(mop.entityHit);
}
else if (mop.typeOfHit == EnumMovingObjectType.TILE)
} else if (mop.typeOfHit == EnumMovingObjectType.TILE)
{
MeteorRegistry.createMeteorImpact(worldObj, mop.blockX, mop.blockY, mop.blockZ, this.meteorID);
}
@ -62,10 +54,9 @@ public class EntityMeteor extends EnergyBlastProjectile
{
shootingEntity.attackEntityFrom(DamageSource.causeMobDamage(shootingEntity), 1);
this.setDead();
}
else
} else
{
MeteorRegistry.createMeteorImpact(worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, meteorID);
MeteorRegistry.createMeteorImpact(worldObj, (int) this.posX, (int) this.posY, (int) this.posZ, meteorID);
}
this.setDead();

View file

@ -2,17 +2,13 @@ package WayofTime.alchemicalWizardry.common.entity.projectile;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumMovingObjectType;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
public class ExplosionProjectile extends EnergyBlastProjectile
{
public class ExplosionProjectile extends EnergyBlastProjectile {
protected boolean causesEnvDamage;
public ExplosionProjectile(World par1World)
@ -53,10 +49,9 @@ public class ExplosionProjectile extends EnergyBlastProjectile
return;
}
worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(2), causesEnvDamage);
worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float) (2), causesEnvDamage);
//this.onImpact(mop.entityHit);
}
else if (mop.typeOfHit == EnumMovingObjectType.TILE)
} else if (mop.typeOfHit == EnumMovingObjectType.TILE)
{
// for(int i=-1;i<=1;i++)
// {
@ -71,7 +66,7 @@ public class ExplosionProjectile extends EnergyBlastProjectile
// }
// }
// }
worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(2), causesEnvDamage);
worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float) (2), causesEnvDamage);
}
this.setDead();
@ -84,8 +79,7 @@ public class ExplosionProjectile extends EnergyBlastProjectile
{
shootingEntity.attackEntityFrom(DamageSource.causeMobDamage(shootingEntity), 1);
this.setDead();
}
else
} else
{
//doDamage(8 + d6(), mop);
if (mop instanceof EntityLivingBase)
@ -93,11 +87,10 @@ public class ExplosionProjectile extends EnergyBlastProjectile
//((EntityLivingBase)mop).addPotionEffect(new PotionEffect(Potion.weakness.id, 60,2));
//((EntityLivingBase)mop).setFire(50);
//((EntityLivingBase)mop).setRevengeTarget(shootingEntity);
if (((EntityLivingBase)mop).isImmuneToFire())
if (((EntityLivingBase) mop).isImmuneToFire())
{
doDamage((int)(projectileDamage), mop);
}
else
doDamage((int) (projectileDamage), mop);
} else
{
doDamage(projectileDamage, mop);
}
@ -106,7 +99,7 @@ public class ExplosionProjectile extends EnergyBlastProjectile
//worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(0.1), true);
}
if (worldObj.isAirBlock((int)this.posX, (int)this.posY, (int)this.posZ))
if (worldObj.isAirBlock((int) this.posX, (int) this.posY, (int) this.posZ))
{
//worldObj.setBlock((int)this.posX, (int)this.posY, (int)this.posZ,Block.fire.blockID);
}

View file

@ -3,17 +3,13 @@ package WayofTime.alchemicalWizardry.common.entity.projectile;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumMovingObjectType;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
public class FireProjectile extends EnergyBlastProjectile
{
public class FireProjectile extends EnergyBlastProjectile {
public FireProjectile(World par1World)
{
super(par1World);
@ -36,7 +32,7 @@ public class FireProjectile extends EnergyBlastProjectile
public FireProjectile(World par1World, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase, float par4, float par5, int damage, int maxTicksInAir)
{
super(par1World, par2EntityLivingBase, par3EntityLivingBase, par4, par5, damage, maxTicksInAir);
super(par1World, par2EntityLivingBase, par3EntityLivingBase, par4, par5, damage, maxTicksInAir);
}
@Override
@ -56,8 +52,7 @@ public class FireProjectile extends EnergyBlastProjectile
}
this.onImpact(mop.entityHit);
}
else if (mop.typeOfHit == EnumMovingObjectType.TILE)
} else if (mop.typeOfHit == EnumMovingObjectType.TILE)
{
for (int i = -1; i <= 1; i++)
{
@ -65,9 +60,9 @@ public class FireProjectile extends EnergyBlastProjectile
{
for (int k = -1; k <= 1; k++)
{
if (worldObj.isAirBlock((int)this.posX + i, (int)this.posY + j, (int)this.posZ + k))
if (worldObj.isAirBlock((int) this.posX + i, (int) this.posY + j, (int) this.posZ + k))
{
worldObj.setBlock((int)this.posX + i, (int)this.posY + j, (int)this.posZ + k, Block.fire.blockID);
worldObj.setBlock((int) this.posX + i, (int) this.posY + j, (int) this.posZ + k, Block.fire.blockID);
}
}
}
@ -86,33 +81,31 @@ public class FireProjectile extends EnergyBlastProjectile
{
shootingEntity.attackEntityFrom(DamageSource.causeMobDamage(shootingEntity), 1);
this.setDead();
}
else
} else
{
//doDamage(8 + d6(), mop);
if (mop instanceof EntityLivingBase)
{
//((EntityLivingBase)mop).addPotionEffect(new PotionEffect(Potion.weakness.id, 60,2));
((EntityLivingBase)mop).setFire(50);
((EntityLivingBase)mop).setRevengeTarget(shootingEntity);
((EntityLivingBase) mop).setFire(50);
((EntityLivingBase) mop).setRevengeTarget(shootingEntity);
if (((EntityLivingBase)mop).isPotionActive(Potion.fireResistance) || ((EntityLivingBase)mop).isImmuneToFire())
if (((EntityLivingBase) mop).isPotionActive(Potion.fireResistance) || ((EntityLivingBase) mop).isImmuneToFire())
{
((EntityLivingBase)mop).attackEntityFrom(DamageSource.causeMobDamage(shootingEntity), 1);
}
else
((EntityLivingBase) mop).attackEntityFrom(DamageSource.causeMobDamage(shootingEntity), 1);
} else
{
doDamage(projectileDamage, mop);
((EntityLivingBase)mop).hurtResistantTime = 0;
((EntityLivingBase) mop).hurtResistantTime = 0;
}
}
//worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(0.1), true);
}
if (worldObj.isAirBlock((int)this.posX, (int)this.posY, (int)this.posZ))
if (worldObj.isAirBlock((int) this.posX, (int) this.posY, (int) this.posZ))
{
worldObj.setBlock((int)this.posX, (int)this.posY, (int)this.posZ, Block.fire.blockID);
worldObj.setBlock((int) this.posX, (int) this.posY, (int) this.posZ, Block.fire.blockID);
}
spawnHitParticles("magicCrit", 8);

View file

@ -4,14 +4,12 @@ import WayofTime.alchemicalWizardry.common.PacketHandler;
import cpw.mods.fml.common.network.PacketDispatcher;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumMovingObjectType;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
public class HolyProjectile extends EnergyBlastProjectile
{
public class HolyProjectile extends EnergyBlastProjectile {
public HolyProjectile(World par1World)
{
super(par1World);
@ -34,7 +32,7 @@ public class HolyProjectile extends EnergyBlastProjectile
public HolyProjectile(World par1World, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase, float par4, float par5, int damage, int maxTicksInAir)
{
super(par1World, par2EntityLivingBase, par3EntityLivingBase, par4, par5, damage, maxTicksInAir);
super(par1World, par2EntityLivingBase, par3EntityLivingBase, par4, par5, damage, maxTicksInAir);
}
@Override
@ -54,8 +52,7 @@ public class HolyProjectile extends EnergyBlastProjectile
}
this.onImpact(mop.entityHit);
}
else if (mop.typeOfHit == EnumMovingObjectType.TILE)
} else if (mop.typeOfHit == EnumMovingObjectType.TILE)
{
// for(int i=-1;i<=1;i++)
// {
@ -82,8 +79,7 @@ public class HolyProjectile extends EnergyBlastProjectile
{
shootingEntity.attackEntityFrom(DamageSource.causeMobDamage(shootingEntity), 1);
this.setDead();
}
else
} else
{
//doDamage(8 + d6(), mop);
if (mop instanceof EntityLivingBase)
@ -91,11 +87,10 @@ public class HolyProjectile extends EnergyBlastProjectile
//((EntityLivingBase)mop).addPotionEffect(new PotionEffect(Potion.weakness.id, 60,2));
//((EntityLivingBase)mop).setFire(50);
//((EntityLivingBase)mop).setRevengeTarget(shootingEntity);
if (((EntityLivingBase)mop).isEntityUndead())
if (((EntityLivingBase) mop).isEntityUndead())
{
doDamage((int)(projectileDamage * 2), mop);
}
else
doDamage((int) (projectileDamage * 2), mop);
} else
{
doDamage(projectileDamage, mop);
}
@ -104,7 +99,7 @@ public class HolyProjectile extends EnergyBlastProjectile
//worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(0.1), true);
}
if (worldObj.isAirBlock((int)this.posX, (int)this.posY, (int)this.posZ))
if (worldObj.isAirBlock((int) this.posX, (int) this.posY, (int) this.posZ))
{
//worldObj.setBlock((int)this.posX, (int)this.posY, (int)this.posZ,Block.fire.blockID);
}

View file

@ -3,10 +3,8 @@ package WayofTime.alchemicalWizardry.common.entity.projectile;
import WayofTime.alchemicalWizardry.common.PacketHandler;
import WayofTime.alchemicalWizardry.common.entity.mob.EntityIceDemon;
import cpw.mods.fml.common.network.PacketDispatcher;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.DamageSource;
@ -14,8 +12,7 @@ import net.minecraft.util.EnumMovingObjectType;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
public class IceProjectile extends EnergyBlastProjectile
{
public class IceProjectile extends EnergyBlastProjectile {
public IceProjectile(World par1World)
{
super(par1World);
@ -35,6 +32,7 @@ public class IceProjectile extends EnergyBlastProjectile
{
super(par1World, par2EntityPlayer, damage, maxTicksInAir, posX, posY, posZ, rotationYaw, rotationPitch);
}
public IceProjectile(World worldObj, EntityIceDemon entityIceDemon, EntityLivingBase par1EntityLivingBase, float f, float g, int i, int j)
{
super(worldObj, entityIceDemon, par1EntityLivingBase, f, g, i, j);
@ -57,8 +55,7 @@ public class IceProjectile extends EnergyBlastProjectile
}
this.onImpact(mop.entityHit);
}
else if (mop.typeOfHit == EnumMovingObjectType.TILE)
} else if (mop.typeOfHit == EnumMovingObjectType.TILE)
{
// for(int i=-1;i<=1;i++)
// {
@ -86,8 +83,7 @@ public class IceProjectile extends EnergyBlastProjectile
{
shootingEntity.attackEntityFrom(DamageSource.causeMobDamage(shootingEntity), 1);
this.setDead();
}
else
} else
{
//doDamage(8 + d6(), mop);
if (mop instanceof EntityLivingBase)
@ -95,12 +91,11 @@ public class IceProjectile extends EnergyBlastProjectile
//((EntityLivingBase)mop).addPotionEffect(new PotionEffect(Potion.weakness.id, 60,2));
//((EntityLivingBase)mop).setFire(50);
//((EntityLivingBase)mop).setRevengeTarget(shootingEntity);
if (((EntityLivingBase)mop).isImmuneToFire())
if (((EntityLivingBase) mop).isImmuneToFire())
{
doDamage((int)(projectileDamage * 2), mop);
doDamage((int) (projectileDamage * 2), mop);
((EntityLivingBase) mop).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 200, 2));
}
else
} else
{
doDamage(projectileDamage, mop);
((EntityLivingBase) mop).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 100, 1));
@ -110,7 +105,7 @@ public class IceProjectile extends EnergyBlastProjectile
//worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(0.1), true);
}
if (worldObj.isAirBlock((int)this.posX, (int)this.posY, (int)this.posZ))
if (worldObj.isAirBlock((int) this.posX, (int) this.posY, (int) this.posZ))
{
//worldObj.setBlock((int)this.posX, (int)this.posY, (int)this.posZ,Block.fire.blockID);
}

View file

@ -1,20 +1,17 @@
package WayofTime.alchemicalWizardry.common.entity.projectile;
import WayofTime.alchemicalWizardry.common.PacketHandler;
import cpw.mods.fml.common.network.PacketDispatcher;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.effect.EntityLightningBolt;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumMovingObjectType;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import cpw.mods.fml.common.network.PacketDispatcher;
public class LightningBoltProjectile extends EnergyBlastProjectile
{
public class LightningBoltProjectile extends EnergyBlastProjectile {
private boolean causeLightning;
public LightningBoltProjectile(World par1World)
@ -56,8 +53,7 @@ public class LightningBoltProjectile extends EnergyBlastProjectile
}
this.onImpact(mop.entityHit);
}
else if (mop.typeOfHit == EnumMovingObjectType.TILE)
} else if (mop.typeOfHit == EnumMovingObjectType.TILE)
{
if (causeLightning)
{
@ -75,8 +71,7 @@ public class LightningBoltProjectile extends EnergyBlastProjectile
{
//shootingEntity.attackEntityFrom(DamageSource.causePlayerDamage(shootingEntity), 1);
this.setDead();
}
else
} else
{
//doDamage(8 + d6(), mop);
if (mop instanceof EntityLivingBase)
@ -93,9 +88,8 @@ public class LightningBoltProjectile extends EnergyBlastProjectile
// }
if (causeLightning)
{
this.worldObj.addWeatherEffect(new EntityLightningBolt(this.worldObj, ((EntityLivingBase)mop).posX, ((EntityLivingBase)mop).posY, ((EntityLivingBase)mop).posZ));
}
else
this.worldObj.addWeatherEffect(new EntityLightningBolt(this.worldObj, ((EntityLivingBase) mop).posX, ((EntityLivingBase) mop).posY, ((EntityLivingBase) mop).posZ));
} else
{
doDamage(projectileDamage, mop);
}

View file

@ -1,9 +1,9 @@
package WayofTime.alchemicalWizardry.common.entity.projectile;
import WayofTime.alchemicalWizardry.common.PacketHandler;
import cpw.mods.fml.common.network.PacketDispatcher;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
@ -11,10 +11,8 @@ import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumMovingObjectType;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import cpw.mods.fml.common.network.PacketDispatcher;
public class MudProjectile extends EnergyBlastProjectile
{
public class MudProjectile extends EnergyBlastProjectile {
private boolean doesBlindness; //True for when it applies blindness, false for slowness
public MudProjectile(World par1World)
@ -41,7 +39,7 @@ public class MudProjectile extends EnergyBlastProjectile
public MudProjectile(World par1World, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase, float par4, float par5, int damage, int maxTicksInAir, boolean flag)
{
super(par1World, par2EntityLivingBase, par3EntityLivingBase, par4, par5, damage, maxTicksInAir);
super(par1World, par2EntityLivingBase, par3EntityLivingBase, par4, par5, damage, maxTicksInAir);
doesBlindness = flag;
}
@ -62,8 +60,7 @@ public class MudProjectile extends EnergyBlastProjectile
}
this.onImpact(mop.entityHit);
}
else if (mop.typeOfHit == EnumMovingObjectType.TILE)
} else if (mop.typeOfHit == EnumMovingObjectType.TILE)
{
}
@ -77,8 +74,7 @@ public class MudProjectile extends EnergyBlastProjectile
{
//shootingEntity.attackEntityFrom(DamageSource.causePlayerDamage(shootingEntity), 1);
this.setDead();
}
else
} else
{
//doDamage(8 + d6(), mop);
if (mop instanceof EntityLivingBase)
@ -95,11 +91,10 @@ public class MudProjectile extends EnergyBlastProjectile
// }
if (doesBlindness)
{
((EntityLivingBase)mop).addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 0));
}
else
((EntityLivingBase) mop).addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 0));
} else
{
((EntityLivingBase)mop).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 100, 2));
((EntityLivingBase) mop).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 100, 2));
}
doDamage(projectileDamage, mop);

View file

@ -2,24 +2,19 @@ package WayofTime.alchemicalWizardry.common.entity.projectile;
import WayofTime.alchemicalWizardry.common.PacketHandler;
import WayofTime.alchemicalWizardry.common.spell.simple.SpellTeleport;
import cpw.mods.fml.common.network.PacketDispatcher;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumMovingObjectType;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.living.EnderTeleportEvent;
import cpw.mods.fml.common.network.PacketDispatcher;
import cpw.mods.fml.common.network.Player;
public class TeleportProjectile extends EnergyBlastProjectile
{
public class TeleportProjectile extends EnergyBlastProjectile {
private boolean isEntityTeleport; //True if the entity firing teleports on hit
public TeleportProjectile(World par1World)
@ -73,14 +68,13 @@ public class TeleportProjectile extends EnergyBlastProjectile
}
this.onImpact(mop.entityHit);
}
else if (mop.typeOfHit == EnumMovingObjectType.TILE)
} else if (mop.typeOfHit == EnumMovingObjectType.TILE)
{
if (isEntityTeleport)
{
if (shootingEntity != null && shootingEntity instanceof EntityPlayerMP)
{
EntityPlayerMP entityplayermp = (EntityPlayerMP)shootingEntity;
EntityPlayerMP entityplayermp = (EntityPlayerMP) shootingEntity;
if (!entityplayermp.playerNetServerHandler.connectionClosed && entityplayermp.worldObj == this.worldObj)
{
@ -90,7 +84,7 @@ public class TeleportProjectile extends EnergyBlastProjectile
{
if (shootingEntity.isRiding())
{
shootingEntity.mountEntity((Entity)null);
shootingEntity.mountEntity((Entity) null);
}
shootingEntity.setPositionAndUpdate(event.targetX, event.targetY, event.targetZ);
@ -112,8 +106,7 @@ public class TeleportProjectile extends EnergyBlastProjectile
{
//shootingEntity.attackEntityFrom(DamageSource.causePlayerDamage(shootingEntity), 1);
this.setDead();
}
else
} else
{
//doDamage(8 + d6(), mop);
if (mop instanceof EntityLivingBase)
@ -132,7 +125,7 @@ public class TeleportProjectile extends EnergyBlastProjectile
{
if (shootingEntity != null && shootingEntity instanceof EntityPlayerMP)
{
EntityPlayerMP entityplayermp = (EntityPlayerMP)shootingEntity;
EntityPlayerMP entityplayermp = (EntityPlayerMP) shootingEntity;
if (!entityplayermp.playerNetServerHandler.connectionClosed && entityplayermp.worldObj == this.worldObj)
{
@ -142,7 +135,7 @@ public class TeleportProjectile extends EnergyBlastProjectile
{
if (shootingEntity.isRiding())
{
shootingEntity.mountEntity((Entity)null);
shootingEntity.mountEntity((Entity) null);
}
shootingEntity.setPositionAndUpdate(event.targetX, event.targetY, event.targetZ);
@ -151,8 +144,7 @@ public class TeleportProjectile extends EnergyBlastProjectile
}
}
}
}
else
} else
{
// int x = (int)this.posX + mop.worldObj.rand.nextInt(100) - mop.worldObj.rand.nextInt(100);
// int y = (int)this.posY + mop.worldObj.rand.nextInt(10) - mop.worldObj.rand.nextInt(10);
@ -175,7 +167,7 @@ public class TeleportProjectile extends EnergyBlastProjectile
// i++;
// }
// }
SpellTeleport.teleportRandomly((EntityLivingBase)mop, 64);
SpellTeleport.teleportRandomly((EntityLivingBase) mop, 64);
}
//doDamage(projectileDamage, mop);

View file

@ -2,19 +2,16 @@ package WayofTime.alchemicalWizardry.common.entity.projectile;
import WayofTime.alchemicalWizardry.common.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.common.PacketHandler;
import cpw.mods.fml.common.network.PacketDispatcher;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.effect.EntityLightningBolt;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumMovingObjectType;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import cpw.mods.fml.common.network.PacketDispatcher;
public class WaterProjectile extends EnergyBlastProjectile
{
public class WaterProjectile extends EnergyBlastProjectile {
public WaterProjectile(World par1World)
{
super(par1World);
@ -52,8 +49,7 @@ public class WaterProjectile extends EnergyBlastProjectile
}
this.onImpact(mop.entityHit);
}
else if (mop.typeOfHit == EnumMovingObjectType.TILE)
} else if (mop.typeOfHit == EnumMovingObjectType.TILE)
{
}
@ -67,8 +63,7 @@ public class WaterProjectile extends EnergyBlastProjectile
{
//shootingEntity.attackEntityFrom(DamageSource.causePlayerDamage(shootingEntity), 1);
this.setDead();
}
else
} else
{
//doDamage(8 + d6(), mop);
if (mop instanceof EntityLivingBase)
@ -83,15 +78,14 @@ public class WaterProjectile extends EnergyBlastProjectile
// {
// doDamage(projectileDamage, mop);
// }
if (((EntityLivingBase)mop).isImmuneToFire())
if (((EntityLivingBase) mop).isImmuneToFire())
{
doDamage(projectileDamage * 2, mop);
((EntityLivingBase)mop).addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionDrowning.id, 80, 1));
}
else
((EntityLivingBase) mop).addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionDrowning.id, 80, 1));
} else
{
doDamage(projectileDamage, mop);
((EntityLivingBase)mop).addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionDrowning.id, 80, 0));
((EntityLivingBase) mop).addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionDrowning.id, 80, 0));
}
//((EntityLivingBase)mop).setVelocity(this.motionX*2, ((EntityLivingBase)mop).motionY+1.5, this.motionZ*2);

View file

@ -1,17 +1,15 @@
package WayofTime.alchemicalWizardry.common.entity.projectile;
import WayofTime.alchemicalWizardry.common.PacketHandler;
import cpw.mods.fml.common.network.PacketDispatcher;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumMovingObjectType;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import cpw.mods.fml.common.network.PacketDispatcher;
public class WindGustProjectile extends EnergyBlastProjectile
{
public class WindGustProjectile extends EnergyBlastProjectile {
public WindGustProjectile(World par1World)
{
super(par1World);
@ -49,8 +47,7 @@ public class WindGustProjectile extends EnergyBlastProjectile
}
this.onImpact(mop.entityHit);
}
else if (mop.typeOfHit == EnumMovingObjectType.TILE)
} else if (mop.typeOfHit == EnumMovingObjectType.TILE)
{
// for(int i=-1;i<=1;i++)
// {
@ -77,8 +74,7 @@ public class WindGustProjectile extends EnergyBlastProjectile
{
//shootingEntity.attackEntityFrom(DamageSource.causePlayerDamage(shootingEntity), 1);
this.setDead();
}
else
} else
{
//doDamage(8 + d6(), mop);
if (mop instanceof EntityLivingBase)
@ -93,9 +89,9 @@ public class WindGustProjectile extends EnergyBlastProjectile
// {
// doDamage(projectileDamage, mop);
// }
((EntityLivingBase)mop).motionX = this.motionX * 2;
((EntityLivingBase)mop).motionY = 1.5;
((EntityLivingBase)mop).motionZ = this.motionZ * 2;
((EntityLivingBase) mop).motionX = this.motionX * 2;
((EntityLivingBase) mop).motionY = 1.5;
((EntityLivingBase) mop).motionZ = this.motionZ * 2;
//((EntityLivingBase)mop).setVelocity(this.motionX*2, ((EntityLivingBase)mop).motionY+1.5, this.motionZ*2);
}