Ejemplo n.º 1
0
 public void update() {
   MusicTicker.MusicType localMusicType = this.field_147677_b.func_147109_W();
   if (this.field_147678_c != null) {
     if (!localMusicType
         .getMusicTickerLocation()
         .equals(this.field_147678_c.getPositionedSoundLocation())) {
       this.field_147677_b.getSoundHandler().stopSound(this.field_147678_c);
       this.field_147676_d =
           MathHelper.getRandomIntegerInRange(
               this.field_147679_a, 0, localMusicType.func_148634_b() / 2);
     }
     if (!this.field_147677_b.getSoundHandler().isSoundPlaying(this.field_147678_c)) {
       this.field_147678_c = null;
       this.field_147676_d =
           Math.min(
               MathHelper.getRandomIntegerInRange(
                   this.field_147679_a,
                   localMusicType.func_148634_b(),
                   localMusicType.func_148633_c()),
               this.field_147676_d);
     }
   }
   if ((this.field_147678_c == null) && (this.field_147676_d-- <= 0)) {
     this.field_147678_c =
         PositionedSoundRecord.func_147673_a(localMusicType.getMusicTickerLocation());
     this.field_147677_b.getSoundHandler().playSound(this.field_147678_c);
     this.field_147676_d = 2147483647;
   }
 }
Ejemplo n.º 2
0
    public void update() {
      MusicTicker.MusicType musictype = this.field_147677_b.func_147109_W();

      if (FMLClientHandler.instance().getWorldClient() != null
          && FMLClientHandler.instance().getWorldClient().provider
              instanceof IGalacticraftWorldProvider) {
        musictype = MUSIC_TYPE_MARS;
      }

      if (this.field_147678_c != null) {
        if (!musictype
            .getMusicTickerLocation()
            .equals(this.field_147678_c.getPositionedSoundLocation())) {
          this.field_147677_b.getSoundHandler().stopSound(this.field_147678_c);
          this.field_147676_d =
              MathHelper.getRandomIntegerInRange(
                  this.field_147679_a, 0, musictype.func_148634_b() / 2);
        }

        if (!this.field_147677_b.getSoundHandler().isSoundPlaying(this.field_147678_c)) {
          this.field_147678_c = null;
          this.field_147676_d =
              Math.min(
                  MathHelper.getRandomIntegerInRange(
                      this.field_147679_a, musictype.func_148634_b(), musictype.func_148633_c()),
                  this.field_147676_d);
        }
      }

      if (this.field_147678_c == null && this.field_147676_d-- <= 0) {
        this.field_147678_c =
            PositionedSoundRecord.func_147673_a(musictype.getMusicTickerLocation());
        this.field_147677_b.getSoundHandler().playSound(this.field_147678_c);
        this.field_147676_d = Integer.MAX_VALUE;
      }
    }