Pushing before merging

This commit is contained in:
WayofTime 2014-10-09 07:48:45 -04:00
parent 297567a417
commit 1d99b70f14
31 changed files with 588 additions and 262 deletions

View file

@ -1,6 +1,7 @@
package WayofTime.alchemicalWizardry.common.entity.projectile;
import net.minecraft.entity.Entity;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
@ -9,6 +10,12 @@ import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorRegistry;
public class EntityMeteor extends EnergyBlastProjectile
{
private int meteorID;
public boolean hasTerrae;
public boolean hasOrbisTerrae;
public boolean hasCrystallos;
public boolean hasIncendium;
public boolean hasTennebrae;
public EntityMeteor(World par1World)
{
@ -21,6 +28,32 @@ public class EntityMeteor extends EnergyBlastProjectile
super(par1World, par2, par4, par6);
this.meteorID = meteorID;
}
@Override
public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound)
{
super.writeEntityToNBT(par1NBTTagCompound);
par1NBTTagCompound.setInteger("meteorID", meteorID);
par1NBTTagCompound.setBoolean("hasTerrae", hasTerrae);
par1NBTTagCompound.setBoolean("hasOrbisTerrae", hasOrbisTerrae);
par1NBTTagCompound.setBoolean("hasCrystallos", hasCrystallos);
par1NBTTagCompound.setBoolean("hasIncendium", hasIncendium);
par1NBTTagCompound.setBoolean("hasTennebrae", hasTennebrae);
}
@Override
public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound)
{
super.readEntityFromNBT(par1NBTTagCompound);
meteorID = par1NBTTagCompound.getInteger("meteorID");
hasTerrae = par1NBTTagCompound.getBoolean("hasTerrae");
hasOrbisTerrae = par1NBTTagCompound.getBoolean("hasOrbisTerrae");
hasIncendium = par1NBTTagCompound.getBoolean("hasIncendium");
hasCrystallos = par1NBTTagCompound.getBoolean("hasCrystallos");
hasTennebrae = par1NBTTagCompound.getBoolean("hasTennebrae");
}
@Override
public DamageSource getDamageSource()
@ -41,7 +74,7 @@ public class EntityMeteor extends EnergyBlastProjectile
this.onImpact(mop.entityHit);
} else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
{
MeteorRegistry.createMeteorImpact(worldObj, mop.blockX, mop.blockY, mop.blockZ, this.meteorID);
MeteorRegistry.createMeteorImpact(worldObj, mop.blockX, mop.blockY, mop.blockZ, this.meteorID, new boolean[]{hasTerrae, hasOrbisTerrae, hasCrystallos, hasIncendium, hasTennebrae});
}
this.setDead();
@ -50,7 +83,7 @@ public class EntityMeteor extends EnergyBlastProjectile
@Override
public void onImpact(Entity mop)
{
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, new boolean[]{hasTerrae, hasOrbisTerrae, hasCrystallos, hasIncendium, hasTennebrae});
this.setDead();
}