use of net.minecraft.client.particle.Particle in project ForestryMC by ForestryMC.
the class ParticleRender method addEntityExplodeFX.
public static void addEntityExplodeFX(World world, double x, double y, double z) {
if (!shouldSpawnParticle(world)) {
return;
}
ParticleManager effectRenderer = Minecraft.getMinecraft().effectRenderer;
Particle Particle = effectRenderer.spawnEffectParticle(EnumParticleTypes.EXPLOSION_NORMAL.getParticleID(), x, y, z, 0, 0, 0);
effectRenderer.addEffect(Particle);
}
use of net.minecraft.client.particle.Particle in project ForestryMC by ForestryMC.
the class ParticleRender method addEntityPotionFX.
public static void addEntityPotionFX(World world, double x, double y, double z, int color) {
if (!shouldSpawnParticle(world)) {
return;
}
float red = (color >> 16 & 255) / 255.0F;
float green = (color >> 8 & 255) / 255.0F;
float blue = (color & 255) / 255.0F;
ParticleManager effectRenderer = Minecraft.getMinecraft().effectRenderer;
Particle particle = effectRenderer.spawnEffectParticle(EnumParticleTypes.SPELL.getParticleID(), x, y, z, 0, 0, 0);
if (particle != null) {
particle.setRBGColorF(red, green, blue);
effectRenderer.addEffect(particle);
}
}
use of net.minecraft.client.particle.Particle in project ForestryMC by ForestryMC.
the class ParticleRender method addPortalFx.
public static void addPortalFx(World world, BlockPos pos, Random rand) {
if (!shouldSpawnParticle(world)) {
return;
}
int j = rand.nextInt(2) * 2 - 1;
int k = rand.nextInt(2) * 2 - 1;
double xPos = (double) pos.getX() + 0.5D + 0.25D * (double) j;
double yPos = (double) ((float) pos.getY() + rand.nextFloat());
double zPos = (double) pos.getZ() + 0.5D + 0.25D * (double) k;
double xSpeed = (double) (rand.nextFloat() * (float) j);
double ySpeed = ((double) rand.nextFloat() - 0.5D) * 0.125D;
double zSpeed = (double) (rand.nextFloat() * (float) k);
ParticleManager effectRenderer = Minecraft.getMinecraft().effectRenderer;
Particle particle = effectRenderer.spawnEffectParticle(EnumParticleTypes.PORTAL.getParticleID(), xPos, yPos, zPos, xSpeed, ySpeed, zSpeed);
if (particle != null) {
effectRenderer.addEffect(particle);
}
}
use of net.minecraft.client.particle.Particle in project ForestryMC by ForestryMC.
the class ParticleRender method addEntityBiodustFX.
public static void addEntityBiodustFX(World world, double x, double y, double z) {
if (!shouldSpawnParticle(world)) {
return;
}
ParticleManager effectRenderer = Minecraft.getMinecraft().effectRenderer;
Particle particle = effectRenderer.spawnEffectParticle(EnumParticleTypes.VILLAGER_HAPPY.ordinal(), x, y, z, 0, 0, 0);
if (particle != null) {
effectRenderer.addEffect(particle);
}
}
use of net.minecraft.client.particle.Particle in project EnderIO by SleepyTrousers.
the class ItemRodOfReturn method onUsingClient.
@SideOnly(Side.CLIENT)
private void onUsingClient(ItemStack stack, EntityLivingBase player, int timeLeft) {
if (timeLeft > (Config.rodOfReturnTicksToActivate - 2)) {
return;
}
float progress = 1 - ((float) timeLeft / Config.rodOfReturnTicksToActivate);
float spinSpeed = progress * 2;
if (activeSound != null) {
activeSound.setPitch(MathHelper.clamp(0.5f + (spinSpeed / 1.5f), 0.5f, 2));
}
if (activeSound == null) {
BlockPos p = player.getPosition();
activeSound = new MachineSound(ACTIVE_RES, p.getX(), p.getY(), p.getZ(), 0.3f, 1);
playSound();
}
double dist = 2 - (progress * 1.5);
Random rand = player.world.rand;
for (int i = 0; i < 6; i++) {
double xo = randomOffset(rand, dist);
double yo = randomOffset(rand, dist);
double zo = randomOffset(rand, dist);
double x = player.posX + xo;
double y = player.posY + yo + player.height / 2;
double z = player.posZ + zo;
Vector3d velocity = new Vector3d(xo, yo, zo);
velocity.normalize();
Particle fx = Minecraft.getMinecraft().effectRenderer.spawnEffectParticle(EnumParticleTypes.PORTAL.getParticleID(), x, y, z, 0, 0, 0, 0);
if (fx != null) {
// if(rand.nextInt(8) == 0) {
// fx.setRBGColorF((rand.nextFloat() * 0.1f), 0.6f + (rand.nextFloat() * 0.15f), 0.75f + (rand.nextFloat() * 0.2f));
// }
ClientUtil.setParticleVelocity(fx, velocity.x, velocity.y, velocity.z);
fx.setMaxAge(timeLeft + 2);
}
}
}
Aggregations