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

@ -5,8 +5,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
public abstract class HomSpell implements ISimpleSpell
{
public abstract class HomSpell implements ISimpleSpell {
private int offensiveRangedEnergy;
private int offensiveMeleeEnergy;
private int defensiveEnergy;
@ -20,7 +19,9 @@ public abstract class HomSpell implements ISimpleSpell
}
@Override
public abstract ItemStack onOffensiveRangedRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer);;
public abstract ItemStack onOffensiveRangedRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer);
;
@Override
public abstract ItemStack onOffensiveMeleeRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer);
@ -76,7 +77,7 @@ public abstract class HomSpell implements ISimpleSpell
itemStack.setTagCompound(new NBTTagCompound());
}
return(itemStack.stackTagCompound.getInteger("paradigm"));
return (itemStack.stackTagCompound.getInteger("paradigm"));
}
//@Override
@ -89,8 +90,7 @@ public abstract class HomSpell implements ISimpleSpell
if (paradigm < 3)
{
this.setSpellParadigm(par1ItemStack, paradigm + 1);
}
else
} else
{
this.setSpellParadigm(par1ItemStack, 0);
}

View file

@ -2,8 +2,7 @@ package WayofTime.alchemicalWizardry.common.spell.simple;
import net.minecraft.item.ItemStack;
public class HomSpellComponent
{
public class HomSpellComponent {
public HomSpell spell;
public ItemStack item;
public int blockID;

View file

@ -1,13 +1,12 @@
package WayofTime.alchemicalWizardry.common.spell.simple;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
public class HomSpellRegistry
{
import java.util.ArrayList;
import java.util.List;
public class HomSpellRegistry {
public static List<HomSpellComponent> spellList = new ArrayList();
public static void registerBasicSpell(ItemStack item, HomSpell spell)
@ -28,7 +27,7 @@ public class HomSpellRegistry
if (item != null)
{
if (item.getItem()instanceof ItemBlock)
if (item.getItem() instanceof ItemBlock)
{
if (testItem.getItem() instanceof ItemBlock)
{
@ -37,8 +36,7 @@ public class HomSpellRegistry
return hsc.getSpell();
}
}
}
else
} else
{
if (!(testItem.getItem() instanceof ItemBlock))
{

View file

@ -4,10 +4,12 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public interface ISimpleSpell
{
public interface ISimpleSpell {
public abstract ItemStack onOffensiveRangedRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer);
public abstract ItemStack onOffensiveMeleeRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer);
public abstract ItemStack onDefensiveRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer);
public abstract ItemStack onEnvironmentalRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer);
}

View file

@ -1,18 +1,17 @@
package WayofTime.alchemicalWizardry.common.spell.simple;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.common.PacketHandler;
import WayofTime.alchemicalWizardry.common.entity.projectile.MudProjectile;
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import cpw.mods.fml.common.network.PacketDispatcher;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class SpellEarthBender extends HomSpell
{
import java.util.Random;
public class SpellEarthBender extends HomSpell {
Random itemRand = new Random();
public SpellEarthBender()
@ -21,6 +20,7 @@ public class SpellEarthBender extends HomSpell
this.setEnergies(100, 150, 350, 200);
//this.setCreativeTab(CreativeTabs.tabMisc);
}
@Override
public ItemStack onOffensiveRangedRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
@ -88,9 +88,9 @@ public class SpellEarthBender extends HomSpell
double xCoord = par3EntityPlayer.posX;
double yCoord = par3EntityPlayer.posY;
double zCoord = par3EntityPlayer.posZ;
int posX = (int)xCoord;
int posY = (int)yCoord;
int posZ = (int)zCoord;
int posX = (int) xCoord;
int posY = (int) yCoord;
int posZ = (int) zCoord;
int blockID = Block.stone.blockID;
if (par2World.isAirBlock(posX, posY + 3, posZ))
@ -164,17 +164,16 @@ public class SpellEarthBender extends HomSpell
{
for (int k = -range; k <= range; k++)
{
if (par2World.getBlockId((int)par3EntityPlayer.posX + i, (int)par3EntityPlayer.posY + j, (int)par3EntityPlayer.posZ + k) == Block.waterStill.blockID || par2World.getBlockId((int)par3EntityPlayer.posX + i, (int)par3EntityPlayer.posY + j, (int)par3EntityPlayer.posZ + k) == Block.waterMoving.blockID)
if (par2World.getBlockId((int) par3EntityPlayer.posX + i, (int) par3EntityPlayer.posY + j, (int) par3EntityPlayer.posZ + k) == Block.waterStill.blockID || par2World.getBlockId((int) par3EntityPlayer.posX + i, (int) par3EntityPlayer.posY + j, (int) par3EntityPlayer.posZ + k) == Block.waterMoving.blockID)
{
int x = par2World.rand.nextInt(2);
if (x == 0)
{
par2World.setBlock((int)par3EntityPlayer.posX + i, (int)par3EntityPlayer.posY + j, (int)par3EntityPlayer.posZ + k, Block.sand.blockID);
}
else
par2World.setBlock((int) par3EntityPlayer.posX + i, (int) par3EntityPlayer.posY + j, (int) par3EntityPlayer.posZ + k, Block.sand.blockID);
} else
{
par2World.setBlock((int)par3EntityPlayer.posX + i, (int)par3EntityPlayer.posY + j, (int)par3EntityPlayer.posZ + k, Block.dirt.blockID);
par2World.setBlock((int) par3EntityPlayer.posX + i, (int) par3EntityPlayer.posY + j, (int) par3EntityPlayer.posZ + k, Block.dirt.blockID);
}
}
}

View file

@ -1,15 +1,14 @@
package WayofTime.alchemicalWizardry.common.spell.simple;
import java.util.Random;
import WayofTime.alchemicalWizardry.common.entity.projectile.ExplosionProjectile;
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.common.entity.projectile.ExplosionProjectile;
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
public class SpellExplosions extends HomSpell
{
import java.util.Random;
public class SpellExplosions extends HomSpell {
Random itemRand = new Random();
public SpellExplosions()
@ -63,7 +62,7 @@ public class SpellExplosions extends HomSpell
int distance = 4;
double yaw = par3EntityPlayer.rotationYaw / 180 * Math.PI;
double pitch = par3EntityPlayer.rotationPitch / 180 * Math.PI;
par2World.createExplosion(par3EntityPlayer, par3EntityPlayer.posX + Math.sin(yaw) * Math.cos(pitch) * (-distance), par3EntityPlayer.posY + par3EntityPlayer.getEyeHeight() + Math.sin(-pitch) * distance, par3EntityPlayer.posZ + Math.cos(yaw) * Math.cos(pitch) * distance, (float)(3), true);
par2World.createExplosion(par3EntityPlayer, par3EntityPlayer.posX + Math.sin(yaw) * Math.cos(pitch) * (-distance), par3EntityPlayer.posY + par3EntityPlayer.getEyeHeight() + Math.sin(-pitch) * distance, par3EntityPlayer.posZ + Math.cos(yaw) * Math.cos(pitch) * distance, (float) (3), true);
return par1ItemStack;
}
@ -85,7 +84,7 @@ public class SpellExplosions extends HomSpell
int distance = 4;
// double yaw = par3EntityPlayer.rotationYaw/180*Math.PI;
// double pitch = par3EntityPlayer.rotationPitch/180*Math.PI;
par2World.createExplosion(par3EntityPlayer, par3EntityPlayer.posX, par3EntityPlayer.posY + par3EntityPlayer.getEyeHeight(), par3EntityPlayer.posZ, (float)(distance), false);
par2World.createExplosion(par3EntityPlayer, par3EntityPlayer.posX, par3EntityPlayer.posY + par3EntityPlayer.getEyeHeight(), par3EntityPlayer.posZ, (float) (distance), false);
return par1ItemStack;
}
@ -108,7 +107,7 @@ public class SpellExplosions extends HomSpell
for (int i = 0; i < 360; i += 36)
{
par2World.createExplosion(par3EntityPlayer, par3EntityPlayer.posX + Math.cos(i) * radius, par3EntityPlayer.posY, par3EntityPlayer.posZ + Math.sin(i) * radius, (float)(2), true);
par2World.createExplosion(par3EntityPlayer, par3EntityPlayer.posX + Math.cos(i) * radius, par3EntityPlayer.posY, par3EntityPlayer.posZ + Math.sin(i) * radius, (float) (2), true);
}
return null;

View file

@ -1,9 +1,7 @@
package WayofTime.alchemicalWizardry.common.spell.simple;
import java.util.Iterator;
import java.util.List;
import java.util.Random;
import WayofTime.alchemicalWizardry.common.entity.projectile.FireProjectile;
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import net.minecraft.block.Block;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
@ -11,12 +9,14 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.common.entity.projectile.FireProjectile;
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
public class SpellFireBurst extends HomSpell
{
import java.util.Iterator;
import java.util.List;
import java.util.Random;
public class SpellFireBurst extends HomSpell {
public Random itemRand = new Random();
public SpellFireBurst()
{
super();
@ -98,14 +98,14 @@ public class SpellFireBurst extends HomSpell
par2World.playSoundAtEntity(par3EntityPlayer, "random.fizz", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
int d0 = 2;
AxisAlignedBB axisalignedbb = AxisAlignedBB.getAABBPool().getAABB((double)par3EntityPlayer.posX, (double)par3EntityPlayer.posY, (double)par3EntityPlayer.posZ, (double)(par3EntityPlayer.posX + 1), (double)(par3EntityPlayer.posY + 2), (double)(par3EntityPlayer.posZ + 1)).expand(d0, d0, d0);
AxisAlignedBB axisalignedbb = AxisAlignedBB.getAABBPool().getAABB((double) par3EntityPlayer.posX, (double) par3EntityPlayer.posY, (double) par3EntityPlayer.posZ, (double) (par3EntityPlayer.posX + 1), (double) (par3EntityPlayer.posY + 2), (double) (par3EntityPlayer.posZ + 1)).expand(d0, d0, d0);
//axisalignedbb.maxY = (double)this.worldObj.getHeight();
List list = par3EntityPlayer.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb);
Iterator iterator = list.iterator();
while (iterator.hasNext())
{
EntityLivingBase entityLiving = (EntityLivingBase)iterator.next();
EntityLivingBase entityLiving = (EntityLivingBase) iterator.next();
if (entityLiving instanceof EntityPlayer)
{
@ -157,11 +157,11 @@ public class SpellFireBurst extends HomSpell
{
for (int k = -1; k <= 1; k++)
{
if (worldObj.isAirBlock((int)par3EntityPlayer.posX + i, (int)par3EntityPlayer.posY + j, (int)par3EntityPlayer.posZ + k))
if (worldObj.isAirBlock((int) par3EntityPlayer.posX + i, (int) par3EntityPlayer.posY + j, (int) par3EntityPlayer.posZ + k))
{
if (worldObj.rand.nextFloat() < 0.8F)
{
worldObj.setBlock((int)par3EntityPlayer.posX + i, (int)par3EntityPlayer.posY + j, (int)par3EntityPlayer.posZ + k, Block.fire.blockID);
worldObj.setBlock((int) par3EntityPlayer.posX + i, (int) par3EntityPlayer.posY + j, (int) par3EntityPlayer.posZ + k, Block.fire.blockID);
}
}
}

View file

@ -1,17 +1,17 @@
package WayofTime.alchemicalWizardry.common.spell.simple;
import java.util.Random;
import WayofTime.alchemicalWizardry.common.entity.projectile.IceProjectile;
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.common.entity.projectile.IceProjectile;
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
public class SpellFrozenWater extends HomSpell
{
import java.util.Random;
public class SpellFrozenWater extends HomSpell {
public Random itemRand = new Random();
public SpellFrozenWater()
{
super();
@ -86,24 +86,23 @@ public class SpellFrozenWater extends HomSpell
{
for (int j = -range; j <= range; j++)
{
if (par2World.isAirBlock((int)par3EntityPlayer.posX + i, (int)par3EntityPlayer.posY - 1, (int)par3EntityPlayer.posZ + j))
if (par2World.isAirBlock((int) par3EntityPlayer.posX + i, (int) par3EntityPlayer.posY - 1, (int) par3EntityPlayer.posZ + j))
{
par2World.setBlock((int)par3EntityPlayer.posX + i, (int)par3EntityPlayer.posY - 1, (int)par3EntityPlayer.posZ + j, Block.ice.blockID);
par2World.setBlock((int) par3EntityPlayer.posX + i, (int) par3EntityPlayer.posY - 1, (int) par3EntityPlayer.posZ + j, Block.ice.blockID);
}
}
}
return par1ItemStack;
}
else if (pitch < -40F)
} else if (pitch < -40F)
{
for (int i = -range; i <= range; i++)
{
for (int j = -range; j <= range; j++)
{
if (par2World.isAirBlock((int)par3EntityPlayer.posX + i, (int)par3EntityPlayer.posY + 3, (int)par3EntityPlayer.posZ + j))
if (par2World.isAirBlock((int) par3EntityPlayer.posX + i, (int) par3EntityPlayer.posY + 3, (int) par3EntityPlayer.posZ + j))
{
par2World.setBlock((int)par3EntityPlayer.posX + i, (int)par3EntityPlayer.posY + 3, (int)par3EntityPlayer.posZ + j, Block.ice.blockID);
par2World.setBlock((int) par3EntityPlayer.posX + i, (int) par3EntityPlayer.posY + 3, (int) par3EntityPlayer.posZ + j, Block.ice.blockID);
}
}
}
@ -117,48 +116,45 @@ public class SpellFrozenWater extends HomSpell
{
for (int j = 0; j < range * 2 + 1; j++)
{
if (par2World.isAirBlock((int)par3EntityPlayer.posX + i, (int)par3EntityPlayer.posY + j, (int)par3EntityPlayer.posZ + 2))
if (par2World.isAirBlock((int) par3EntityPlayer.posX + i, (int) par3EntityPlayer.posY + j, (int) par3EntityPlayer.posZ + 2))
{
par2World.setBlock((int)par3EntityPlayer.posX + i, (int)par3EntityPlayer.posY + j, (int)par3EntityPlayer.posZ + 2, Block.ice.blockID);
par2World.setBlock((int) par3EntityPlayer.posX + i, (int) par3EntityPlayer.posY + j, (int) par3EntityPlayer.posZ + 2, Block.ice.blockID);
}
}
}
}
else if (yaw >= 45 && yaw < 135)
} else if (yaw >= 45 && yaw < 135)
{
for (int i = -range; i <= range; i++)
{
for (int j = 0; j < range * 2 + 1; j++)
{
if (par2World.isAirBlock((int)par3EntityPlayer.posX - 2, (int)par3EntityPlayer.posY + j, (int)par3EntityPlayer.posZ + i))
if (par2World.isAirBlock((int) par3EntityPlayer.posX - 2, (int) par3EntityPlayer.posY + j, (int) par3EntityPlayer.posZ + i))
{
par2World.setBlock((int)par3EntityPlayer.posX - 2, (int)par3EntityPlayer.posY + j, (int)par3EntityPlayer.posZ + i, Block.ice.blockID);
par2World.setBlock((int) par3EntityPlayer.posX - 2, (int) par3EntityPlayer.posY + j, (int) par3EntityPlayer.posZ + i, Block.ice.blockID);
}
}
}
}
else if (yaw >= 135 && yaw < 225)
} else if (yaw >= 135 && yaw < 225)
{
for (int i = -range; i <= range; i++)
{
for (int j = 0; j < range * 2 + 1; j++)
{
if (par2World.isAirBlock((int)par3EntityPlayer.posX + i, (int)par3EntityPlayer.posY + j, (int)par3EntityPlayer.posZ - 2))
if (par2World.isAirBlock((int) par3EntityPlayer.posX + i, (int) par3EntityPlayer.posY + j, (int) par3EntityPlayer.posZ - 2))
{
par2World.setBlock((int)par3EntityPlayer.posX + i, (int)par3EntityPlayer.posY + j, (int)par3EntityPlayer.posZ - 2, Block.ice.blockID);
par2World.setBlock((int) par3EntityPlayer.posX + i, (int) par3EntityPlayer.posY + j, (int) par3EntityPlayer.posZ - 2, Block.ice.blockID);
}
}
}
}
else
} else
{
for (int i = -range; i <= range; i++)
{
for (int j = 0; j < range * 2 + 1; j++)
{
if (par2World.isAirBlock((int)par3EntityPlayer.posX + 2, (int)par3EntityPlayer.posY + j, (int)par3EntityPlayer.posZ + i))
if (par2World.isAirBlock((int) par3EntityPlayer.posX + 2, (int) par3EntityPlayer.posY + j, (int) par3EntityPlayer.posZ + i))
{
par2World.setBlock((int)par3EntityPlayer.posX + 2, (int)par3EntityPlayer.posY + j, (int)par3EntityPlayer.posZ + i, Block.ice.blockID);
par2World.setBlock((int) par3EntityPlayer.posX + 2, (int) par3EntityPlayer.posY + j, (int) par3EntityPlayer.posZ + i, Block.ice.blockID);
}
}
}
@ -178,9 +174,9 @@ public class SpellFrozenWater extends HomSpell
}
int radius = 3;
int posX = (int)par3EntityPlayer.posX;
int posY = (int)par3EntityPlayer.posY;
int posZ = (int)par3EntityPlayer.posZ;
int posX = (int) par3EntityPlayer.posX;
int posY = (int) par3EntityPlayer.posY;
int posZ = (int) par3EntityPlayer.posZ;
for (int i = -radius; i <= radius; i++)
{
@ -188,12 +184,12 @@ public class SpellFrozenWater extends HomSpell
{
for (int k = -radius; k <= radius; k++)
{
int blockID = par2World.getBlockId((int)par3EntityPlayer.posX + i - 1, (int)par3EntityPlayer.posY + j, (int)par3EntityPlayer.posZ + k);
int blockID = par2World.getBlockId((int) par3EntityPlayer.posX + i - 1, (int) par3EntityPlayer.posY + j, (int) par3EntityPlayer.posZ + k);
//Block block = Block.blocksList[blockID];
if (blockID == Block.waterMoving.blockID || blockID == Block.waterStill.blockID)
{
par2World.setBlock((int)par3EntityPlayer.posX + i - 1, (int)par3EntityPlayer.posY + j, (int)par3EntityPlayer.posZ + k, Block.ice.blockID);
par2World.setBlock((int) par3EntityPlayer.posX + i - 1, (int) par3EntityPlayer.posY + j, (int) par3EntityPlayer.posZ + k, Block.ice.blockID);
}
}
}

View file

@ -1,22 +1,21 @@
package WayofTime.alchemicalWizardry.common.spell.simple;
import java.util.Iterator;
import java.util.List;
import java.util.Random;
import WayofTime.alchemicalWizardry.common.PacketHandler;
import WayofTime.alchemicalWizardry.common.entity.projectile.HolyProjectile;
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import cpw.mods.fml.common.network.PacketDispatcher;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.common.PacketHandler;
import WayofTime.alchemicalWizardry.common.entity.projectile.HolyProjectile;
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import cpw.mods.fml.common.network.PacketDispatcher;
public class SpellHolyBlast extends HomSpell
{
import java.util.Iterator;
import java.util.List;
import java.util.Random;
public class SpellHolyBlast extends HomSpell {
Random itemRand = new Random();
public SpellHolyBlast()
@ -25,6 +24,7 @@ public class SpellHolyBlast extends HomSpell
this.setEnergies(100, 300, 500, 400);
//this.setCreativeTab(CreativeTabs.tabMisc);
}
@Override
public ItemStack onOffensiveRangedRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
@ -80,7 +80,7 @@ public class SpellHolyBlast extends HomSpell
while (iterator.hasNext())
{
EntityLivingBase entityLiving = (EntityLivingBase)iterator.next();
EntityLivingBase entityLiving = (EntityLivingBase) iterator.next();
if (entityLiving instanceof EntityPlayer)
{
@ -102,7 +102,7 @@ public class SpellHolyBlast extends HomSpell
//par2World.createExplosion(par3EntityPlayer, par3EntityPlayer.posX, par3EntityPlayer.posY, par3EntityPlayer.posZ, (float)(2), false);
}
par2World.createExplosion(par3EntityPlayer, xCoord, yCoord, zCoord, (float)(1), false);
par2World.createExplosion(par3EntityPlayer, xCoord, yCoord, zCoord, (float) (1), false);
for (int i = 0; i < 5; i++)
{
@ -154,14 +154,14 @@ public class SpellHolyBlast extends HomSpell
}
int d0 = 3;
AxisAlignedBB axisalignedbb = AxisAlignedBB.getAABBPool().getAABB((double)par3EntityPlayer.posX, (double)par3EntityPlayer.posY, (double)par3EntityPlayer.posZ, (double)(par3EntityPlayer.posX + 1), (double)(par3EntityPlayer.posY + 2), (double)(par3EntityPlayer.posZ + 1)).expand(d0, d0, d0);
AxisAlignedBB axisalignedbb = AxisAlignedBB.getAABBPool().getAABB((double) par3EntityPlayer.posX, (double) par3EntityPlayer.posY, (double) par3EntityPlayer.posZ, (double) (par3EntityPlayer.posX + 1), (double) (par3EntityPlayer.posY + 2), (double) (par3EntityPlayer.posZ + 1)).expand(d0, d0, d0);
//axisalignedbb.maxY = (double)this.worldObj.getHeight();
List list = par3EntityPlayer.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb);
Iterator iterator = list.iterator();
while (iterator.hasNext())
{
EntityLivingBase entityLiving = (EntityLivingBase)iterator.next();
EntityLivingBase entityLiving = (EntityLivingBase) iterator.next();
if (entityLiving instanceof EntityPlayer)
{
@ -183,7 +183,7 @@ public class SpellHolyBlast extends HomSpell
//par2World.createExplosion(par3EntityPlayer, par3EntityPlayer.posX, par3EntityPlayer.posY, par3EntityPlayer.posZ, (float)(2), false);
}
par2World.createExplosion(par3EntityPlayer, par3EntityPlayer.posX, par3EntityPlayer.posY, par3EntityPlayer.posZ, (float)(2), false);
par2World.createExplosion(par3EntityPlayer, par3EntityPlayer.posX, par3EntityPlayer.posY, par3EntityPlayer.posZ, (float) (2), false);
double xCoord = par3EntityPlayer.posX;
double yCoord = par3EntityPlayer.posY;
double zCoord = par3EntityPlayer.posZ;

View file

@ -1,18 +1,17 @@
package WayofTime.alchemicalWizardry.common.spell.simple;
import java.util.Random;
import net.minecraft.entity.effect.EntityLightningBolt;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.common.PacketHandler;
import WayofTime.alchemicalWizardry.common.entity.projectile.LightningBoltProjectile;
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import cpw.mods.fml.common.network.PacketDispatcher;
import net.minecraft.entity.effect.EntityLightningBolt;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class SpellLightningBolt extends HomSpell
{
import java.util.Random;
public class SpellLightningBolt extends HomSpell {
Random itemRand = new Random();
public SpellLightningBolt()
@ -21,6 +20,7 @@ public class SpellLightningBolt extends HomSpell
this.setEnergies(75, 200, 700, 700);
//this.setCreativeTab(CreativeTabs.tabMisc);
}
@Override
public ItemStack onOffensiveRangedRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{

View file

@ -1,9 +1,9 @@
package WayofTime.alchemicalWizardry.common.spell.simple;
import java.util.Iterator;
import java.util.List;
import java.util.Random;
import WayofTime.alchemicalWizardry.common.PacketHandler;
import WayofTime.alchemicalWizardry.common.entity.projectile.TeleportProjectile;
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import cpw.mods.fml.common.network.PacketDispatcher;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@ -16,13 +16,12 @@ import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.living.EnderTeleportEvent;
import WayofTime.alchemicalWizardry.common.PacketHandler;
import WayofTime.alchemicalWizardry.common.entity.projectile.TeleportProjectile;
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import cpw.mods.fml.common.network.PacketDispatcher;
public class SpellTeleport extends HomSpell
{
import java.util.Iterator;
import java.util.List;
import java.util.Random;
public class SpellTeleport extends HomSpell {
Random itemRand = new Random();
public SpellTeleport()
@ -31,6 +30,7 @@ public class SpellTeleport extends HomSpell
this.setEnergies(500, 300, 500, 1000);
//this.setCreativeTab(CreativeTabs.tabMisc);
}
@Override
public ItemStack onOffensiveRangedRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
@ -117,14 +117,14 @@ public class SpellTeleport extends HomSpell
if (!par2World.isRemote)
{
int d0 = 3;
AxisAlignedBB axisalignedbb = AxisAlignedBB.getAABBPool().getAABB((double)par3EntityPlayer.posX, (double)par3EntityPlayer.posY, (double)par3EntityPlayer.posZ, (double)(par3EntityPlayer.posX + 1), (double)(par3EntityPlayer.posY + 2), (double)(par3EntityPlayer.posZ + 1)).expand(d0, d0, d0);
AxisAlignedBB axisalignedbb = AxisAlignedBB.getAABBPool().getAABB((double) par3EntityPlayer.posX, (double) par3EntityPlayer.posY, (double) par3EntityPlayer.posZ, (double) (par3EntityPlayer.posX + 1), (double) (par3EntityPlayer.posY + 2), (double) (par3EntityPlayer.posZ + 1)).expand(d0, d0, d0);
//axisalignedbb.maxY = (double)this.worldObj.getHeight();
List list = par3EntityPlayer.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb);
Iterator iterator = list.iterator();
while (iterator.hasNext())
{
EntityLivingBase entityLiving = (EntityLivingBase)iterator.next();
EntityLivingBase entityLiving = (EntityLivingBase) iterator.next();
if (entityLiving instanceof EntityPlayer)
{
@ -158,14 +158,14 @@ public class SpellTeleport extends HomSpell
double z = entityLiving.posZ;
Random rand = new Random();
double d0 = x + (rand.nextDouble() - 0.5D) * distance;
double d1 = y + (double)(rand.nextInt((int)distance) - (distance) / 2);
double d1 = y + (double) (rand.nextInt((int) distance) - (distance) / 2);
double d2 = z + (rand.nextDouble() - 0.5D) * distance;
int i = 0;
while (!SpellTeleport.teleportTo(entityLiving, d0, d1, d2, x, y, z) && i < 100)
{
d0 = x + (rand.nextDouble() - 0.5D) * distance;
d1 = y + (double)(rand.nextInt((int)distance) - (distance) / 2);
d1 = y + (double) (rand.nextInt((int) distance) - (distance) / 2);
d2 = z + (rand.nextDouble() - 0.5D) * distance;
i++;
}
@ -209,8 +209,7 @@ public class SpellTeleport extends HomSpell
if (l != 0 && Block.blocksList[l].blockMaterial.blocksMovement())
{
flag1 = true;
}
else
} else
{
--entityLiving.posY;
--j;
@ -232,21 +231,20 @@ public class SpellTeleport extends HomSpell
{
SpellTeleport.moveEntityViaTeleport(entityLiving, d3, d4, d5);
return false;
}
else
} else
{
short short1 = 128;
for (l = 0; l < short1; ++l)
{
double d6 = (double)l / ((double)short1 - 1.0D);
double d6 = (double) l / ((double) short1 - 1.0D);
float f = (entityLiving.worldObj.rand.nextFloat() - 0.5F) * 0.2F;
float f1 = (entityLiving.worldObj.rand.nextFloat() - 0.5F) * 0.2F;
float f2 = (entityLiving.worldObj.rand.nextFloat() - 0.5F) * 0.2F;
double d7 = d3 + (entityLiving.posX - d3) * d6 + (entityLiving.worldObj.rand.nextDouble() - 0.5D) * (double)entityLiving.width * 2.0D;
double d8 = d4 + (entityLiving.posY - d4) * d6 + entityLiving.worldObj.rand.nextDouble() * (double)entityLiving.height;
double d9 = d5 + (entityLiving.posZ - d5) * d6 + (entityLiving.worldObj.rand.nextDouble() - 0.5D) * (double)entityLiving.width * 2.0D;
entityLiving.worldObj.spawnParticle("portal", d7, d8, d9, (double)f, (double)f1, (double)f2);
double d7 = d3 + (entityLiving.posX - d3) * d6 + (entityLiving.worldObj.rand.nextDouble() - 0.5D) * (double) entityLiving.width * 2.0D;
double d8 = d4 + (entityLiving.posY - d4) * d6 + entityLiving.worldObj.rand.nextDouble() * (double) entityLiving.height;
double d9 = d5 + (entityLiving.posZ - d5) * d6 + (entityLiving.worldObj.rand.nextDouble() - 0.5D) * (double) entityLiving.width * 2.0D;
entityLiving.worldObj.spawnParticle("portal", d7, d8, d9, (double) f, (double) f1, (double) f2);
}
// this.worldObj.playSoundEffect(d3, d4, d5, "mob.endermen.portal", 1.0F, 1.0F);
@ -261,7 +259,7 @@ public class SpellTeleport extends HomSpell
{
if (entityLiving != null && entityLiving instanceof EntityPlayerMP)
{
EntityPlayerMP entityplayermp = (EntityPlayerMP)entityLiving;
EntityPlayerMP entityplayermp = (EntityPlayerMP) entityLiving;
if (!entityplayermp.playerNetServerHandler.connectionClosed && entityplayermp.worldObj == entityLiving.worldObj)
{
@ -271,7 +269,7 @@ public class SpellTeleport extends HomSpell
{
if (entityLiving.isRiding())
{
entityLiving.mountEntity((Entity)null);
entityLiving.mountEntity((Entity) null);
}
entityLiving.setPositionAndUpdate(event.targetX, event.targetY, event.targetZ);
@ -280,8 +278,7 @@ public class SpellTeleport extends HomSpell
}
}
}
}
else if (entityLiving != null)
} else if (entityLiving != null)
{
entityLiving.setPosition(x, y, z);
}

View file

@ -1,9 +1,10 @@
package WayofTime.alchemicalWizardry.common.spell.simple;
import java.util.Iterator;
import java.util.List;
import java.util.Random;
import WayofTime.alchemicalWizardry.common.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.common.PacketHandler;
import WayofTime.alchemicalWizardry.common.entity.projectile.WaterProjectile;
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import cpw.mods.fml.common.network.PacketDispatcher;
import net.minecraft.block.Block;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
@ -12,14 +13,12 @@ import net.minecraft.potion.PotionEffect;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.common.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.common.PacketHandler;
import WayofTime.alchemicalWizardry.common.entity.projectile.WaterProjectile;
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import cpw.mods.fml.common.network.PacketDispatcher;
public class SpellWateryGrave extends HomSpell
{
import java.util.Iterator;
import java.util.List;
import java.util.Random;
public class SpellWateryGrave extends HomSpell {
Random itemRand = new Random();
public SpellWateryGrave()
@ -28,6 +27,7 @@ public class SpellWateryGrave extends HomSpell
this.setEnergies(250, 350, 500, 750);
//this.setCreativeTab(CreativeTabs.tabMisc);
}
@Override
public ItemStack onOffensiveRangedRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
@ -93,14 +93,14 @@ public class SpellWateryGrave extends HomSpell
}
int d0 = 3;
AxisAlignedBB axisalignedbb = AxisAlignedBB.getAABBPool().getAABB((double)par3EntityPlayer.posX, (double)par3EntityPlayer.posY, (double)par3EntityPlayer.posZ, (double)(par3EntityPlayer.posX + 1), (double)(par3EntityPlayer.posY + 2), (double)(par3EntityPlayer.posZ + 1)).expand(d0, d0, d0);
AxisAlignedBB axisalignedbb = AxisAlignedBB.getAABBPool().getAABB((double) par3EntityPlayer.posX, (double) par3EntityPlayer.posY, (double) par3EntityPlayer.posZ, (double) (par3EntityPlayer.posX + 1), (double) (par3EntityPlayer.posY + 2), (double) (par3EntityPlayer.posZ + 1)).expand(d0, d0, d0);
//axisalignedbb.maxY = (double)this.worldObj.getHeight();
List list = par3EntityPlayer.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb);
Iterator iterator = list.iterator();
while (iterator.hasNext())
{
EntityLivingBase entityLiving = (EntityLivingBase)iterator.next();
EntityLivingBase entityLiving = (EntityLivingBase) iterator.next();
if (entityLiving instanceof EntityPlayer)
{
@ -156,9 +156,9 @@ public class SpellWateryGrave extends HomSpell
{
for (int j = -range; j <= range; j++)
{
if (par2World.isAirBlock((int)par3EntityPlayer.posX + i, (int)par3EntityPlayer.posY, (int)par3EntityPlayer.posZ + j))
if (par2World.isAirBlock((int) par3EntityPlayer.posX + i, (int) par3EntityPlayer.posY, (int) par3EntityPlayer.posZ + j))
{
par2World.setBlock((int)par3EntityPlayer.posX + i, (int)par3EntityPlayer.posY, (int)par3EntityPlayer.posZ + j, Block.waterStill.blockID);
par2World.setBlock((int) par3EntityPlayer.posX + i, (int) par3EntityPlayer.posY, (int) par3EntityPlayer.posZ + j, Block.waterStill.blockID);
}
}
}

View file

@ -1,23 +1,22 @@
package WayofTime.alchemicalWizardry.common.spell.simple;
import java.util.Iterator;
import java.util.List;
import java.util.Random;
import WayofTime.alchemicalWizardry.common.PacketHandler;
import WayofTime.alchemicalWizardry.common.entity.projectile.WindGustProjectile;
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import cpw.mods.fml.common.network.PacketDispatcher;
import cpw.mods.fml.common.network.Player;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.common.PacketHandler;
import WayofTime.alchemicalWizardry.common.entity.projectile.WindGustProjectile;
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import cpw.mods.fml.common.network.PacketDispatcher;
import cpw.mods.fml.common.network.Player;
public class SpellWindGust extends HomSpell
{
import java.util.Iterator;
import java.util.List;
import java.util.Random;
public class SpellWindGust extends HomSpell {
Random itemRand = new Random();
public SpellWindGust()
@ -26,6 +25,7 @@ public class SpellWindGust extends HomSpell
this.setEnergies(300, 400, 300, 500);
//this.setCreativeTab(CreativeTabs.tabMisc);
}
@Override
public ItemStack onOffensiveRangedRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
@ -81,7 +81,7 @@ public class SpellWindGust extends HomSpell
while (iterator.hasNext())
{
EntityLivingBase entityLiving = (EntityLivingBase)iterator.next();
EntityLivingBase entityLiving = (EntityLivingBase) iterator.next();
if (entityLiving instanceof EntityPlayer)
{
@ -136,8 +136,8 @@ public class SpellWindGust extends HomSpell
par3EntityPlayer.motionX = vec.xCoord * wantedVelocity;
par3EntityPlayer.motionY = vec.yCoord * wantedVelocity;
par3EntityPlayer.motionZ = vec.zCoord * wantedVelocity;
PacketDispatcher.sendPacketToPlayer(PacketHandler.getPlayerVelocitySettingPacket(xVel, yVel, zVel), (Player)par3EntityPlayer);
par2World.playSoundEffect((double)((float)par3EntityPlayer.posX + 0.5F), (double)((float)par3EntityPlayer.posY + 0.5F), (double)((float)par3EntityPlayer.posZ + 0.5F), "random.fizz", 0.5F, 2.6F + (par2World.rand.nextFloat() - par2World.rand.nextFloat()) * 0.8F);
PacketDispatcher.sendPacketToPlayer(PacketHandler.getPlayerVelocitySettingPacket(xVel, yVel, zVel), (Player) par3EntityPlayer);
par2World.playSoundEffect((double) ((float) par3EntityPlayer.posX + 0.5F), (double) ((float) par3EntityPlayer.posY + 0.5F), (double) ((float) par3EntityPlayer.posZ + 0.5F), "random.fizz", 0.5F, 2.6F + (par2World.rand.nextFloat() - par2World.rand.nextFloat()) * 0.8F);
par3EntityPlayer.fallDistance = 0;
//par2World.createExplosion(par3EntityPlayer, par3EntityPlayer.posX, par3EntityPlayer.posY, par3EntityPlayer.posZ, (float)(2), false);
double xCoord = par3EntityPlayer.posX;
@ -168,7 +168,7 @@ public class SpellWindGust extends HomSpell
}
int d0 = 3;
AxisAlignedBB axisalignedbb = AxisAlignedBB.getAABBPool().getAABB((double)par3EntityPlayer.posX, (double)par3EntityPlayer.posY, (double)par3EntityPlayer.posZ, (double)(par3EntityPlayer.posX + 1), (double)(par3EntityPlayer.posY + 2), (double)(par3EntityPlayer.posZ + 1)).expand(d0, d0, d0);
AxisAlignedBB axisalignedbb = AxisAlignedBB.getAABBPool().getAABB((double) par3EntityPlayer.posX, (double) par3EntityPlayer.posY, (double) par3EntityPlayer.posZ, (double) (par3EntityPlayer.posX + 1), (double) (par3EntityPlayer.posY + 2), (double) (par3EntityPlayer.posZ + 1)).expand(d0, d0, d0);
//axisalignedbb.maxY = (double)this.worldObj.getHeight();
List list = par3EntityPlayer.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb);
Iterator iterator = list.iterator();
@ -179,7 +179,7 @@ public class SpellWindGust extends HomSpell
while (iterator.hasNext())
{
EntityLivingBase entityLiving = (EntityLivingBase)iterator.next();
EntityLivingBase entityLiving = (EntityLivingBase) iterator.next();
if (entityLiving instanceof EntityPlayer)
{