use of net.minecraft.client.particle.Particle in project Railcraft by Railcraft.
the class ClientEffectProxy method chunkLoaderEffect.
@Override
public void chunkLoaderEffect(World world, Object source, Set<ChunkPos> chunks) {
if (!isGoggleAuraActive(GoggleAura.WORLDSPIKE))
return;
IEffectSource es = EffectManager.getEffectSource(source);
Vec3d sourcePos = es.getPosF();
if (FMLClientHandler.instance().getClient().thePlayer.getDistanceSq(sourcePos.xCoord, sourcePos.yCoord, sourcePos.zCoord) > 25600)
return;
for (ChunkPos chunk : chunks) {
int xCorner = chunk.chunkXPos * 16;
int zCorner = chunk.chunkZPos * 16;
double yCorner = sourcePos.yCoord - 8;
// System.out.println(xCorner + ", " + zCorner);
if (rand.nextInt(3) == 0) {
if (thinParticles(false))
continue;
double xParticle = xCorner + rand.nextFloat() * 16;
double yParticle = yCorner + rand.nextFloat() * 16;
double zParticle = zCorner + rand.nextFloat() * 16;
Particle particle = new ParticleChunkLoader(world, new Vec3d(xParticle, yParticle, zParticle), es);
spawnParticle(particle);
}
}
}
use of net.minecraft.client.particle.Particle in project Railcraft by Railcraft.
the class ClientEffectProxy method fireSparkEffect.
@Override
public void fireSparkEffect(World world, Vec3d start, Vec3d end) {
if (thinParticles(false))
return;
IEffectSource es = EffectManager.getEffectSource(start);
Particle particle = new ParticleFireSpark(world, start, end);
spawnParticle(particle);
SoundHelper.playSoundClient(world, es.getPos(), SoundEvents.BLOCK_LAVA_POP, SoundCategory.BLOCKS, .2F + rand.nextFloat() * .2F, .9F + rand.nextFloat() * .15F);
}
use of net.minecraft.client.particle.Particle in project Charset by CharsetMC.
the class UtilProxyClient method addRunningParticles.
@Override
public boolean addRunningParticles(IBlockState state, World world, BlockPos pos, Entity entity) {
IBakedModel model = Minecraft.getMinecraft().getBlockRendererDispatcher().getModelForState(state);
if (model instanceof IStateParticleBakedModel) {
state = state.getBlock().getExtendedState(state.getActualState(world, pos), world, pos);
TextureAtlasSprite sprite = ((IStateParticleBakedModel) model).getParticleTexture(state, EnumFacing.UP);
Particle particle = new ParticleDiggingCharset(world, entity.posX + ((double) PacketCustomBlockDust.rand.nextFloat() - 0.5D) * (double) entity.width, entity.getEntityBoundingBox().minY + 0.1D, entity.posZ + ((double) PacketCustomBlockDust.rand.nextFloat() - 0.5D) * (double) entity.width, -entity.motionX * 4.0D, 1.5D, -entity.motionZ * 4.0D, state, pos, sprite, ((BlockBase) state.getBlock()).getParticleTintIndex());
Minecraft.getMinecraft().effectRenderer.addEffect(particle);
return true;
} else {
return false;
}
}
use of net.minecraft.client.particle.Particle in project Charset by CharsetMC.
the class UtilProxyClient method spawnBlockDustClient.
@Override
public void spawnBlockDustClient(World world, BlockPos pos, Random rand, float posX, float posY, float posZ, int numberOfParticles, float particleSpeed, EnumFacing facing) {
TextureAtlasSprite sprite;
int tintIndex = -1;
IBlockState state = world.getBlockState(pos);
if (state.getBlock() instanceof BlockBase) {
tintIndex = ((BlockBase) state.getBlock()).getParticleTintIndex();
}
IBakedModel model = Minecraft.getMinecraft().getBlockRendererDispatcher().getModelForState(state);
if (model instanceof IStateParticleBakedModel) {
state = state.getBlock().getExtendedState(state.getActualState(world, pos), world, pos);
sprite = ((IStateParticleBakedModel) model).getParticleTexture(state, facing);
} else {
sprite = model.getParticleTexture();
}
ParticleManager manager = Minecraft.getMinecraft().effectRenderer;
for (int i = 0; i < numberOfParticles; i++) {
double xSpeed = rand.nextGaussian() * particleSpeed;
double ySpeed = rand.nextGaussian() * particleSpeed;
double zSpeed = rand.nextGaussian() * particleSpeed;
try {
Particle particle = new ParticleBlockDustCharset(world, posX, posY, posZ, xSpeed, ySpeed, zSpeed, state, pos, sprite, tintIndex);
manager.addEffect(particle);
} catch (Throwable var16) {
ModCharset.logger.warn("Could not spawn block particle!");
return;
}
}
}
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);
}
Aggregations