use of com.teamwizardry.librarianlib.features.utilities.client.ClientRunnable in project Wizardry by TeamWizardry.
the class EntityJumpPad method collideWithEntity.
@Override
public void collideWithEntity(Entity entity) {
if (!(entity instanceof EntityLivingBase))
return;
((EntityLivingBase) entity).motionY += 0.2;
entity.fallDistance = 0;
Color color1 = new Color(RandUtil.nextInt(100, 255), RandUtil.nextInt(100, 255), RandUtil.nextInt(100, 255), RandUtil.nextInt(100, 255));
Color color2 = new Color(RandUtil.nextInt(100, 255), RandUtil.nextInt(100, 255), RandUtil.nextInt(100, 255), RandUtil.nextInt(100, 255));
Vec3d normal = new Vec3d(entity.motionX, entity.motionY, entity.motionZ).normalize().scale(1 / 2.0);
ClientRunnable.run(new ClientRunnable() {
@Override
@SideOnly(Side.CLIENT)
public void runIfClient() {
LibParticles.AIR_THROTTLE(world, entity.getPositionVector(), normal, color1, color2, 0.5);
}
});
}
use of com.teamwizardry.librarianlib.features.utilities.client.ClientRunnable in project Wizardry by TeamWizardry.
the class EntitySpiritBlight method onDeath.
@Override
public void onDeath(DamageSource cause) {
ClientRunnable.run(new ClientRunnable() {
@Override
@SideOnly(Side.CLIENT)
public void runIfClient() {
ParticleBuilder glitter = new ParticleBuilder(RandUtil.nextInt(100, 150));
glitter.setColor(Color.WHITE);
glitter.setRender(new ResourceLocation(Wizardry.MODID, Constants.MISC.SPARKLE_BLURRED));
glitter.setAlphaFunction(new InterpFadeInOut(0.1f, 0.1f));
glitter.setAcceleration(Vec3d.ZERO);
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(getPositionVector().addVector(0, height, 0)), 1000, 0, (i, build) -> {
double radius = 0.2;
build.setDeceleration(new Vec3d(RandUtil.nextDouble(0.8, 0.95), RandUtil.nextDouble(0.8, 0.95), RandUtil.nextDouble(0.8, 0.95)));
build.addMotion(new Vec3d(RandUtil.nextDouble(-radius, radius), RandUtil.nextDouble(-radius, radius), RandUtil.nextDouble(-radius, radius)));
build.setLifetime(RandUtil.nextInt(200, 250));
build.setScaleFunction(new InterpScale(RandUtil.nextFloat(0.6f, 1.5f), 0));
if (RandUtil.nextBoolean())
build.setColor(Color.WHITE);
else
build.setColor(new Color(0xf404d4));
});
}
});
playSound(ModSounds.BASS_BOOM, 3, 0.5f);
playSound(ModSounds.BASS_BOOM, 1, RandUtil.nextFloat(1, 1.5f));
super.onDeath(cause);
}
use of com.teamwizardry.librarianlib.features.utilities.client.ClientRunnable in project Wizardry by TeamWizardry.
the class EntitySpiritBlight method attackEntityFrom.
@Override
public boolean attackEntityFrom(@Nonnull DamageSource source, float amount) {
if (source.isMagicDamage()) {
super.attackEntityFrom(source, amount);
ClientRunnable.run(new ClientRunnable() {
@Override
@SideOnly(Side.CLIENT)
public void runIfClient() {
LibParticles.SPIRIT_WIGHT_HURT(world, getPositionVector());
}
});
return true;
} else
return false;
}
use of com.teamwizardry.librarianlib.features.utilities.client.ClientRunnable in project Wizardry by TeamWizardry.
the class EntitySpiritWight method onDeath.
@Override
public void onDeath(DamageSource cause) {
ClientRunnable.run(new ClientRunnable() {
@Override
@SideOnly(Side.CLIENT)
public void runIfClient() {
ParticleBuilder glitter = new ParticleBuilder(RandUtil.nextInt(100, 150));
glitter.setColor(Color.WHITE);
glitter.setRender(new ResourceLocation(Wizardry.MODID, Constants.MISC.SPARKLE_BLURRED));
glitter.setAlphaFunction(new InterpFadeInOut(0.1f, 0.1f));
glitter.setAcceleration(Vec3d.ZERO);
ParticleSpawner.spawn(glitter, world, new StaticInterp<>(getPositionVector().addVector(0, height, 0)), 1000, 0, (i, build) -> {
double radius = 0.2;
build.setDeceleration(new Vec3d(RandUtil.nextDouble(0.8, 0.95), RandUtil.nextDouble(0.8, 0.95), RandUtil.nextDouble(0.8, 0.95)));
build.addMotion(new Vec3d(RandUtil.nextDouble(-radius, radius), RandUtil.nextDouble(-radius, radius), RandUtil.nextDouble(-radius, radius)));
build.setLifetime(RandUtil.nextInt(200, 250));
build.setScaleFunction(new InterpScale(RandUtil.nextFloat(0.6f, 1.5f), 0));
if (RandUtil.nextBoolean())
build.setColor(Color.WHITE);
else
build.setColor(Color.YELLOW);
});
}
});
playSound(ModSounds.BASS_BOOM, 3, 0.5f);
playSound(ModSounds.BASS_BOOM, 1, RandUtil.nextFloat(1, 1.5f));
super.onDeath(cause);
}
use of com.teamwizardry.librarianlib.features.utilities.client.ClientRunnable in project Wizardry by TeamWizardry.
the class EntitySpiritWight method collideWithEntity.
@Override
public void collideWithEntity(Entity entity) {
if (getHealth() > 0) {
if (entity.getName().equals(getName()))
return;
((EntityLivingBase) entity).motionY += 0.4;
((EntityLivingBase) entity).attackEntityAsMob(this);
((EntityLivingBase) entity).setRevengeTarget(this);
}
entity.fallDistance = 0;
Vec3d normal = new Vec3d(RandUtil.nextDouble(-0.01, 0.01), RandUtil.nextDouble(0.1, 0.4), RandUtil.nextDouble(-0.01, 0.01));
ClientRunnable.run(new ClientRunnable() {
@Override
@SideOnly(Side.CLIENT)
public void runIfClient() {
LibParticles.AIR_THROTTLE(world, getPositionVector().addVector(0, getEyeHeight(), 0), normal, Color.WHITE, Color.YELLOW, RandUtil.nextDouble(0.2, 1.0));
}
});
}
Aggregations