use of net.minecraft.client.particle.Particle in project DynamicSurroundings by OreCruncher.
the class ParticleSteamJet method spawnJetParticle.
@Override
protected void spawnJetParticle() {
final Particle particle = new ParticleSteamCloud(this.world, this.posX, this.posY, this.posZ, 0.1D);
addParticle(particle);
}
use of net.minecraft.client.particle.Particle in project Railcraft by Railcraft.
the class ClientEffects method tuningEffect.
@Override
public void tuningEffect(TileEntity start, TileEntity dest) {
if (thinParticles(false))
return;
if (rand.nextInt(2) == 0) {
BlockPos pos = start.getPos();
double px = pos.getX() + getRandomParticleOffset();
double py = pos.getY() + getRandomParticleOffset();
double pz = pos.getZ() + getRandomParticleOffset();
TESRSignals.ColorProfile colorProfile = TESRSignals.ColorProfile.COORD_RAINBOW;
if (isGoggleAuraActive(GoggleAura.SIGNALLING))
colorProfile = TESRSignals.ColorProfile.CONTROLLER_ASPECT;
int color = colorProfile.getColor(start, start.getPos(), dest.getPos());
Particle particle = new ParticleTuningAura(start.getWorld(), new Vec3d(px, py, pz), EffectManager.getEffectSource(start), EffectManager.getEffectSource(dest), color);
spawnParticle(particle);
}
}
use of net.minecraft.client.particle.Particle in project LogisticsPipes by RS485.
the class LogisticsBlockGenericPipe method addHitEffects.
@SideOnly(Side.CLIENT)
@Override
public boolean addHitEffects(IBlockState state, World world, RayTraceResult target, ParticleManager effectRenderer) {
if (super.addHitEffects(state, world, target, effectRenderer))
return true;
BlockPos pos = target.getBlockPos();
CoreUnroutedPipe pipe = LogisticsBlockGenericPipe.getPipe(world, pos);
if (pipe == null) {
return false;
}
TextureAtlasSprite icon = pipe.getIconProvider().getIcon(pipe.getIconIndexForItem());
EnumFacing sideHit = target.sideHit;
Block block = LPBlocks.pipe;
float b = 0.1F;
double px = target.hitVec.x + rand.nextDouble() * (state.getBoundingBox(world, pos).maxX - state.getBoundingBox(world, pos).minX - (b * 2.0F)) + b + state.getBoundingBox(world, pos).minX;
double py = target.hitVec.y + rand.nextDouble() * (state.getBoundingBox(world, pos).maxY - state.getBoundingBox(world, pos).minY - (b * 2.0F)) + b + state.getBoundingBox(world, pos).minY;
double pz = target.hitVec.z + rand.nextDouble() * (state.getBoundingBox(world, pos).maxZ - state.getBoundingBox(world, pos).minZ - (b * 2.0F)) + b + state.getBoundingBox(world, pos).minZ;
if (sideHit == EnumFacing.DOWN) {
py = target.hitVec.y + state.getBoundingBox(world, pos).minY - b;
}
if (sideHit == EnumFacing.UP) {
py = target.hitVec.y + state.getBoundingBox(world, pos).maxY + b;
}
if (sideHit == EnumFacing.NORTH) {
pz = target.hitVec.z + state.getBoundingBox(world, pos).minZ - b;
}
if (sideHit == EnumFacing.SOUTH) {
pz = target.hitVec.z + state.getBoundingBox(world, pos).maxZ + b;
}
if (sideHit == EnumFacing.EAST) {
px = target.hitVec.x + state.getBoundingBox(world, pos).minX - b;
}
if (sideHit == EnumFacing.WEST) {
px = target.hitVec.x + state.getBoundingBox(world, pos).maxX + b;
}
Particle fx = effectRenderer.spawnEffectParticle(EnumParticleTypes.BLOCK_CRACK.getParticleID(), px, py, pz, 0.0D, 0.0D, 0.0D, Block.getStateId(world.getBlockState(target.getBlockPos())));
fx.setParticleTexture(icon);
effectRenderer.addEffect(fx.multiplyVelocity(0.2F).multipleParticleScaleBy(0.6F));
return true;
}
use of net.minecraft.client.particle.Particle in project LogisticsPipes by RS485.
the class PipeFXRenderHandler method spawnGenericParticle.
public static void spawnGenericParticle(Particles particle, double x, double y, double z, int amount) {
if (MainProxy.getClientMainWorld() == null) {
return;
}
try {
Minecraft mc = Minecraft.getMinecraft();
int var14 = mc.gameSettings.particleSetting;
double var15 = mc.getRenderViewEntity().posX - x;
double var17 = mc.getRenderViewEntity().posY - y;
double var19 = mc.getRenderViewEntity().posZ - z;
Particle effect;
double var22 = 16.0D;
if (var15 * var15 + var17 * var17 + var19 * var19 > var22 * var22) {
return;
} else if (var14 > 1) {
return;
}
ParticleProvider provider = PipeFXRenderHandler.particlemap[particle.ordinal()];
if (provider == null) {
return;
}
for (int i = 0; i < Math.sqrt(amount); i++) {
effect = provider.createGenericParticle(mc.world, x, y, z, amount);
if (effect != null) {
mc.effectRenderer.addEffect(effect);
}
}
} catch (NullPointerException ignored) {
}
}
use of net.minecraft.client.particle.Particle in project ImmersiveEngineering by BluSunrize.
the class ClientProxy method spawnSparkFX.
@Override
public void spawnSparkFX(World world, double x, double y, double z, double mx, double my, double mz) {
Particle particle = new ParticleSparks(world, x, y, z, mx, my, mz);
Minecraft.getMinecraft().effectRenderer.addEffect(particle);
}
Aggregations