Examples of SoundType


Examples of com.mojang.minecraft.level.tile.Tile$SoundType

         this.walkDist = (float)((double)this.walkDist + (double)MathHelper.sqrt(var18 * var18 + var17 * var17) * 0.6D);
         if(this.makeStepSound) {
            int var19 = this.level.getTile((int)this.x, (int)(this.y - 0.2F - this.heightOffset), (int)this.z);
            if(this.walkDist > (float)this.nextStep && var19 > 0) {
               ++this.nextStep;
               Tile$SoundType var20;
               if((var20 = Block.blocks[var19].stepsound) != Tile$SoundType.none) {
                  this.playSound("step." + var20.name, var20.getVolume() * 0.75F, var20.getPitch());
               }
            }
         }

         this.ySlideOffset *= 0.4F;
View Full Code Here

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

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.func_150496_b(), stepsound.getVolume() * 0.5F, stepsound.getPitch() * 0.75F);
            }
        }
    }
View Full Code Here

Examples of net.minecraft.block.Block.SoundType

                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

Examples of net.minecraft.block.Block.SoundType

            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

Examples of net.minecraft.block.Block.SoundType

        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

Examples of net.minecraft.block.Block.SoundType

    }

    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

Examples of net.sourceforge.cardme.vcard.types.SoundType

    logo.setImageMediaType(ImageMediaType.PNG);
    byte[] tuxPicture2 = Util.getFileAsBytes(new File("test/images/smallTux.png"));
    logo.setLogo(tuxPicture2);
    vcard.addLogo(logo);
   
    SoundType sound = new SoundType();
    sound.setCompression(false);
    sound.setEncodingType(EncodingType.BINARY);
    sound.setAudioMediaType(AudioMediaType.OGG);
    sound.setSoundURI(new File("test/images/smallTux.png").toURI());
    vcard.addSound(sound);
   
    KeyType key = new KeyType();
    key.setKeyTextType(KeyTextType.GPG);
    key.setEncodingType(EncodingType.BINARY);
View Full Code Here

Examples of net.sourceforge.cardme.vcard.types.SoundType

   * @param vcard
   * @throws VCardParseException
   */
  private void parseSoundType(String group, String value, List<ParameterType> paramTypeList, VCardImpl vcard) throws VCardParseException {
    try {
      SoundType soundType = new SoundType();
      parseParamTypes(soundType, paramTypeList, value, VCardTypeName.SOUND);
     
      if(soundType.isBinary()) {
        byte[] soundBytes = Base64Wrapper.decode(value);
        soundType.setCompression(false);
        soundType.setSound(soundBytes);
      }
      else {
        URI soundUri = new URI(value);
        soundType.setSoundURI(soundUri);
      }
     
      if(group != null) {
        soundType.setGroup(group);
      }
     
      vcard.addSound(soundType);
    }
    catch(Exception ex) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.