Package org.terasology.world.block

Examples of org.terasology.world.block.BlockSounds


        return blockSounds.get(uri);
    }

    @Override
    public BlockSounds getDefaultBlockSounds() {
        BlockSounds sounds = getBlockSounds(BlockSounds.DEFAULT_ID);
        if (sounds == null) {
            throw new IllegalStateException("Default block sounds are missing from engine module: "
                + BlockSounds.DEFAULT_ID);
        }
        return sounds;
View Full Code Here


        entity.send(new CreateBlockDropsEvent(event.getInstigator(), event.getDirectCause(), event.getDamageType()));

        BlockDamageModifierComponent blockDamageModifierComponent = event.getDamageType().getComponent(BlockDamageModifierComponent.class);
        // TODO: Configurable via block definition
        if (blockDamageModifierComponent == null || !blockDamageModifierComponent.skipPerBlockEffects) {
            BlockSounds sounds = block.getSounds();
            if (!sounds.getDestroySounds().isEmpty()) {
                StaticSound sound = random.nextItem(sounds.getDestroySounds());
                entity.send(new PlaySoundEvent(sound, 0.6f));
            }
        }
    }
View Full Code Here

            EntityBuilder dustBuilder = entityManager.newBuilder("engine:dustEffect");
            dustBuilder.getComponent(LocationComponent.class).setWorldPosition(location);
            dustBuilder.build();
        }

        BlockSounds sounds = family.getArchetypeBlock().getSounds();
        if (!sounds.getDigSounds().isEmpty()) {
            StaticSound sound = random.nextItem(sounds.getDigSounds());
            audioManager.playSound(sound, location);
        }
    }
View Full Code Here

    public BlockSounds create(AssetUri assetUri, BlockSoundsDefinition soundsDefinition) {

        String uri = assetUri.toSimpleString();

        return new BlockSounds(
            uri,
            resolveSounds(uri, soundsDefinition.getStepSounds()),
            resolveSounds(uri, soundsDefinition.getDestroySounds()),
            resolveSounds(uri, soundsDefinition.getDigSounds())
        );
View Full Code Here

TOP

Related Classes of org.terasology.world.block.BlockSounds

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.