Spell Work

Need to work on how the EntitySpellProjectile saves its data. Does not
work properly. Perhaps it was not registered?
This commit is contained in:
WayofTime 2014-01-25 09:22:59 -05:00
parent 5dcef131dc
commit 112b4e6b53
15 changed files with 314 additions and 92 deletions

View file

@ -2,9 +2,10 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects;
import net.minecraft.entity.Entity;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
public interface IProjectileImpactEffect
{
public void onEntityImpact(Entity mop);
public void onTileImpact(MovingObjectPosition mop);
public void onTileImpact(World world, MovingObjectPosition mop);
}

View file

@ -0,0 +1,33 @@
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
public class ProjectileDefaultFire extends ProjectileImpactEffect
{
public ProjectileDefaultFire(int power, int potency, int cost)
{
super(power, potency, cost);
}
@Override
public void onEntityImpact(Entity mop)
{
mop.setFire((int)Math.pow(2,this.powerUpgrades));
}
@Override
public void onTileImpact(World world, MovingObjectPosition mop)
{
int x = mop.blockX;
int y = mop.blockY;
int z = mop.blockZ;
if(world.isAirBlock(x, y+1, z))
{
world.setBlock(x, y+1, z, Block.fire.blockID);
}
}
}

View file

@ -0,0 +1,15 @@
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects;
public abstract class ProjectileImpactEffect implements IProjectileImpactEffect
{
protected int powerUpgrades;
protected int potencyUpgrades;
protected int costUpgrades;
public ProjectileImpactEffect(int power, int potency, int cost)
{
this.powerUpgrades = power;
this.potencyUpgrades = potency;
this.costUpgrades = cost;
}
}