public void updateAnimation() { if (!this.framesTextureData.isEmpty()) { Minecraft minecraft = Minecraft.getMinecraft(); double d0 = 0.0D; if (minecraft.theWorld != null && minecraft.thePlayer != null) { float f = minecraft.theWorld.getCelestialAngle(1.0F); d0 = (double) f; if (!minecraft.theWorld.provider.isSurfaceWorld()) { d0 = Math.random(); } } double d1; for (d1 = d0 - this.field_94239_h; d1 < -0.5D; ++d1) {; } while (d1 >= 0.5D) { --d1; } if (d1 < -1.0D) { d1 = -1.0D; } if (d1 > 1.0D) { d1 = 1.0D; } this.field_94240_i += d1 * 0.1D; this.field_94240_i *= 0.8D; this.field_94239_h += this.field_94240_i; int i; for (i = (int) ((this.field_94239_h + 1.0D) * (double) this.framesTextureData.size()) % this.framesTextureData.size(); i < 0; i = (i + this.framesTextureData.size()) % this.framesTextureData.size()) {; } if (i != this.frameCounter) { this.frameCounter = i; TextureUtil.uploadTextureMipmap( (int[][]) this.framesTextureData.get(this.frameCounter), this.width, this.height, this.originX, this.originY, false, false); } } }
public void updateAnimation() { if (!this.framesTextureData.isEmpty()) { Minecraft var1 = Minecraft.getMinecraft(); double var2 = 0.0D; if (var1.world != null && var1.player != null) { float var4 = var1.world.getCelestialAngle(1.0F); var2 = (double) var4; if (!var1.world.provider.isOverworld()) { var2 = Math.random(); } } double var7; for (var7 = var2 - this.field_94239_h; var7 < -0.5D; ++var7) {; } while (var7 >= 0.5D) { --var7; } var7 = M.clamp(var7, -1.0D, 1.0D); this.field_94240_i += var7 * 0.1D; this.field_94240_i *= 0.8D; this.field_94239_h += this.field_94240_i; int var6; for (var6 = (int) ((this.field_94239_h + 1.0D) * (double) this.framesTextureData.size()) % this.framesTextureData.size(); var6 < 0; var6 = (var6 + this.framesTextureData.size()) % this.framesTextureData.size()) {; } if (var6 != this.frameCounter) { this.frameCounter = var6; TextureUtil.uploadTextureMipmap( (int[][]) this.framesTextureData.get(this.frameCounter), this.width, this.height, this.originX, this.originY, false, false); } } }