use of am2.particles.AMParticle in project ArsMagica2 by Mithion.
the class EntityHecate method spawnLivingParticles.
private void spawnLivingParticles() {
if (rand.nextInt(3) == 0) {
double yPos = this.posY + 1.1;
if (this.currentForwardRotation >= 0.24) {
yPos += 0.3;
}
AMParticle effect = (AMParticle) AMCore.instance.proxy.particleManager.spawn(worldObj, "smoke", this.posX + ((rand.nextFloat() * 0.2) - 0.1f), yPos, this.posZ + ((rand.nextFloat() * 0.4) - 0.2f));
if (effect != null) {
if (this.currentForwardRotation < 0.24) {
effect.AddParticleController(new ParticleFloatUpward(effect, 0.1f, -0.06f, 1, false));
} else {
effect.AddParticleController(new ParticleMoveOnHeading(effect, this.rotationYaw - 90, this.rotationPitch, 0.01f, 1, false));
}
effect.AddParticleController(new ParticleFadeOut(effect, 2, false).setFadeSpeed(0.04f));
effect.setMaxAge(25);
effect.setIgnoreMaxAge(false);
effect.setRGBColorF(0.3f, 0.3f, 0.3f);
}
}
}
use of am2.particles.AMParticle in project ArsMagica2 by Mithion.
the class EntityFireElemental method onUpdate.
@Override
public void onUpdate() {
int cookTargetID = dataWatcher.getWatchableObjectInt(19);
if (cookTargetID != 0) {
List<EntityItem> items = worldObj.getEntitiesWithinAABB(EntityItem.class, this.boundingBox.expand(cookRadius, cookRadius, cookRadius));
EntityItem inanimate = null;
for (EntityItem item : items) {
if (item.getEntityId() == cookTargetID) {
inanimate = item;
}
}
if (inanimate != null && worldObj.isRemote) {
AMParticle effect = (AMParticle) AMCore.instance.proxy.particleManager.spawn(worldObj, "fire", posX, posY + getEyeHeight(), posZ);
if (effect != null) {
effect.setIgnoreMaxAge(true);
effect.AddParticleController(new ParticleApproachPoint(effect, inanimate.posX + (rand.nextFloat() - 0.5), inanimate.posY + (rand.nextFloat() - 0.5), inanimate.posZ + (rand.nextFloat() - 0.5), 0.1f, 0.1f, 1, false).setKillParticleOnFinish(true));
}
}
}
if (worldObj.isRemote && rand.nextInt(100) > 75 && !isBurning())
for (int i = 0; i < AMCore.config.getGFXLevel(); i++) worldObj.spawnParticle("largesmoke", posX + (rand.nextDouble() - 0.5D) * width, posY + rand.nextDouble() * height, posZ + (rand.nextDouble() - 0.5D) * width, 0.0D, 0.0D, 0.0D);
super.onUpdate();
}
use of am2.particles.AMParticle in project ArsMagica2 by Mithion.
the class EntityBroom method interact.
@Override
protected boolean interact(EntityPlayer par1EntityPlayer) {
if (par1EntityPlayer.getCurrentEquippedItem() != null && par1EntityPlayer.getCurrentEquippedItem().getItem() == ItemsCommonProxy.spellStaffMagitech) {
if (this.worldObj.isRemote) {
for (int i = 0; i < AMCore.config.getGFXLevel() * 2; ++i) {
AMParticle particle = (AMParticle) AMCore.proxy.particleManager.spawn(worldObj, "smoke", posX, posY, posZ);
if (particle != null) {
particle.AddParticleController(new ParticleFloatUpward(particle, 0.1f, 0.3f, 1, false));
particle.addRandomOffset(0.3, 1, 0.3);
particle.setMaxAge(10);
}
}
} else {
this.entityDropItem(new ItemStack(ItemsCommonProxy.magicBroom), 0);
dropInventoryItems();
this.setDead();
}
return true;
}
return false;
}
use of am2.particles.AMParticle in project ArsMagica2 by Mithion.
the class EntityBroom method onUpdate.
@Override
public void onUpdate() {
if (worldObj.isRemote) {
updateRotations();
if (isMoving()) {
AMParticle particle = (AMParticle) AMCore.proxy.particleManager.spawn(worldObj, "smoke", posX, posY, posZ);
if (particle != null) {
particle.addRandomOffset(0.5, 0.5, 0.5);
particle.setRGBColorF(0.8f, 0.6f, 0.4f);
particle.AddParticleController(new ParticleFadeOut(particle, 1, false).setFadeSpeed(0.03f).setKillParticleOnFinish(true));
}
}
}
super.onUpdate();
}
use of am2.particles.AMParticle in project ArsMagica2 by Mithion.
the class ItemCrystalWrench method spawnLinkParticles.
private void spawnLinkParticles(World world, double hitX, double hitY, double hitZ, boolean disconnect) {
for (int i = 0; i < 10; ++i) {
AMParticle particle = (AMParticle) AMCore.proxy.particleManager.spawn(world, "none_hand", hitX, hitY, hitZ);
if (particle != null) {
if (disconnect) {
particle.setRGBColorF(1, 0, 0);
particle.addRandomOffset(0.5f, 0.5f, 0.5f);
}
particle.setMaxAge(10);
particle.setParticleScale(0.1f);
particle.AddParticleController(new ParticleMoveOnHeading(particle, world.rand.nextInt(360), world.rand.nextInt(360), world.rand.nextDouble() * 0.2, 1, false));
particle.AddParticleController(new ParticleFadeOut(particle, 1, false).setFadeSpeed(0.1f));
}
}
}
Aggregations