Package net.minecraft.block.Block

Examples of net.minecraft.block.Block.SoundType


            this.attackEntityFrom(DamageSource.fall, i);
            Block j = this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY - 0.20000000298023224D - this.yOffset), MathHelper.floor_double(this.posZ));

            if (j != null)
            {
                SoundType stepsound = j.stepSound;
                this.playSound(stepsound.soundName, stepsound.getVolume() * 0.5F, stepsound.getPitch() * 0.75F);
            }
        }
    }
View Full Code Here


            this.attackEntityFrom(DamageSource.fall, i);
            Block j = this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY - 0.20000000298023224D - this.yOffset), MathHelper.floor_double(this.posZ));

            if (j != null)
            {
                SoundType stepsound = j.stepSound;
                this.playSound(stepsound.func_150496_b(), stepsound.getVolume() * 0.5F, stepsound.getPitch() * 0.75F);
            }
        }
    }
View Full Code Here

                float y = event.sound.getYPosF();
                float z = event.sound.getZPosF();
                int ix = MathHelper.floor_float(x);
                int iy = MathHelper.floor_float(y);
                int iz = MathHelper.floor_float(z);
                SoundType sound = getBlockSound(world, ix, iy, iz);
                if (sound != null) {
                    String newName = sound.getStepResourcePath();
                    if (soundName.contains("dig"))
                        newName = sound.getBreakSound();
                    else if (soundName.contains("place"))
                        newName = sound.func_150496_b();
                    event.result = new PositionedSoundRecord(new ResourceLocation(newName), event.sound.getVolume(), event.sound.getPitch() * sound.getPitch(), x, y, z);
                }
            }
        }
    }
View Full Code Here

            World world = entity.worldObj;
            if (world != null) {
                int ix = MathHelper.floor_double(entity.posX);
                int iy = MathHelper.floor_double(entity.posY - 0.2 - (double) entity.yOffset);
                int iz = MathHelper.floor_double(entity.posZ);
                SoundType sound = getBlockSound(world, ix, iy, iz);
                if (sound != null) {
                    world.playSoundAtEntity(entity, sound.getStepResourcePath(), event.volume, event.pitch * sound.getPitch());
                    event.setCanceled(true);
                }
            }
        }
    }
View Full Code Here

        return false;

      ForgeDirection mySide = host.addPart( held, side, player );
      if ( mySide != null )
      {
        SoundType ss = AEApi.instance().blocks().blockMultiPart.block().stepSound;

        // ss.getPlaceSound()
        world.playSoundEffect( 0.5 + x, 0.5 + y, 0.5 + z, ss.func_150496_b(), (ss.getVolume() + 1.0F) / 2.0F, ss.getPitch() * 0.8F );

        if ( !player.capabilities.isCreativeMode )
        {
          held.stackSize--;
          if ( held.stackSize == 0 )
View Full Code Here

    }

    public static void playBlockSound(World world, int x, int y, int z, String soundName, float volume, float pitch, Block block, int meta) {
        if (world != null && soundName != null) {
            if (soundName.contains("railcraft")) {
                SoundType sound = SoundRegistry.getSound(block, meta);
                if (sound != null) {
                    String newName = soundName.contains("dig") ? sound.getBreakSound() : soundName.contains("step") ? sound.getStepResourcePath() : sound.func_150496_b();
                    world.playSoundEffect(x, y, z, newName, volume, pitch * sound.getPitch());
                }
            }
            world.playSoundEffect(x, y, z, soundName, volume, pitch);
        }
    }
View Full Code Here

TOP

Related Classes of net.minecraft.block.Block.SoundType

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.