Java Code Examples for org.spongepowered.api.world.World#spawnParticles()

The following examples show how to use org.spongepowered.api.world.World#spawnParticles() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ParticlesUtil.java    From EagleFactions with MIT License 5 votes vote down vote up
public static void spawnAddAccessParticles(final Claim claim)
{
	final Optional<World> optionalWorld = Sponge.getServer().getWorld(claim.getWorldUUID());
	if(!optionalWorld.isPresent())
		return;

	final World world = optionalWorld.get();
	final Vector3d position = getChunkCenter(world, claim.getChunkPosition());
	world.spawnParticles(ParticleEffect.builder().type(ParticleTypes.FIREWORKS_SPARK).option(ParticleOptions.VELOCITY, new Vector3d(0, 0.15, 0)).quantity(400).offset(new Vector3d(8, 2, 8)).build(), position);
	world.playSound(SoundTypes.ENTITY_EXPERIENCE_ORB_PICKUP, position, 5, 10);
}
 
Example 2
Source File: ParticlesUtil.java    From EagleFactions with MIT License 5 votes vote down vote up
public static void spawnRemoveAccessParticles(final Claim claim)
{
	final Optional<World> optionalWorld = Sponge.getServer().getWorld(claim.getWorldUUID());
	if(!optionalWorld.isPresent())
		return;

	final World world = optionalWorld.get();
	final Vector3d position = getChunkCenter(world, claim.getChunkPosition());
	world.spawnParticles(ParticleEffect.builder().type(ParticleTypes.LARGE_SMOKE).option(ParticleOptions.VELOCITY, new Vector3d(0, 0.15, 0)).quantity(400).offset(new Vector3d(8, 1, 8)).build(), position);
	world.playSound(SoundTypes.ITEM_FIRECHARGE_USE, position, 5, -10);
}
 
Example 3
Source File: ParticlesUtil.java    From EagleFactions with MIT License 5 votes vote down vote up
public static void spawnClaimParticles(final Claim claim)
{
	final Optional<World> optionalWorld = Sponge.getServer().getWorld(claim.getWorldUUID());
	if(!optionalWorld.isPresent())
		return;

	final World world = optionalWorld.get();
	final Vector3d position = getChunkCenter(world, claim.getChunkPosition());
	world.spawnParticles(ParticleEffect.builder().type(ParticleTypes.END_ROD).option(ParticleOptions.VELOCITY, new Vector3d(0, 0.15, 0)).quantity(400).offset(new Vector3d(8, 1, 8)).build(), position);
	world.playSound(SoundTypes.BLOCK_ENDERCHEST_OPEN, position, 5, -20);
}
 
Example 4
Source File: ParticlesUtil.java    From EagleFactions with MIT License 5 votes vote down vote up
public static void spawnUnclaimParticles(final Claim claim)
{
	final Optional<World> optionalWorld = Sponge.getServer().getWorld(claim.getWorldUUID());
	if(!optionalWorld.isPresent())
		return;

	final World world = optionalWorld.get();
	final Vector3d position = getChunkCenter(world, claim.getChunkPosition());
	world.spawnParticles(ParticleEffect.builder().type(ParticleTypes.CLOUD).option(ParticleOptions.VELOCITY, new Vector3d(0, 0.15, 0)).quantity(800).offset(new Vector3d(8, 1, 8)).build(), position);
	world.playSound(SoundTypes.ENTITY_SHULKER_SHOOT, position, 5, -20);
}
 
Example 5
Source File: ParticlesUtil.java    From EagleFactions with MIT License 5 votes vote down vote up
public static void spawnDestroyClaimParticles(final Claim claim)
{
	final Optional<World> optionalWorld = Sponge.getServer().getWorld(claim.getWorldUUID());
	if(!optionalWorld.isPresent())
		return;

	final World world = optionalWorld.get();
	final Vector3d position = getChunkCenter(world, claim.getChunkPosition());
	world.spawnParticles(ParticleEffect.builder().type(ParticleTypes.FLAME).option(ParticleOptions.VELOCITY, new Vector3d(0, 0.15, 0)).quantity(800).offset(new Vector3d(8, 1, 8)).build(), position);
	world.playSound(SoundTypes.ENTITY_BLAZE_SHOOT, position, 5, -20);
}