public void setTileWidth(int var1) {
    if (var1 > Config.getMaxDynamicTileWidth()) {
      var1 = Config.getMaxDynamicTileWidth();
    }

    this.tileWidth = var1;
    this.setup();
    this.tickCounter = 0;
  }
 public void setTileWidth(int i) {
   if (i > Config.getMaxDynamicTileWidth()) {
     i = Config.getMaxDynamicTileWidth();
   }
   tileWidth = i;
   fireHeight = i + i / 4;
   imageData = new byte[i * i * 4];
   buf1 = new float[i * fireHeight];
   buf2 = new float[i * fireHeight];
 }
  private static void dbgCallVoid(boolean var0, String var1, ReflectorMethod var2, Object[] var3) {
    String var4 = var2.getTargetMethod().getDeclaringClass().getName();
    String var5 = var2.getTargetMethod().getName();
    String var6 = "";

    if (var0) {
      var6 = " static";
    }

    Config.dbg(var1 + var6 + " " + var4 + "." + var5 + "(" + Config.arrayToString(var3) + ")");
  }
Example #4
0
 public void setRenderingChunk(boolean flag) {
   if (renderingChunk != flag) {
     for (int i = 0; i < subTextures.length; i++) {
       subTextures[i] = 0;
     }
   }
   renderingChunk = flag;
   if (textureUpdateTime != Config.getTextureUpdateTime()) {
     terrainTexture = 0;
     textureUpdateTime = Config.getTextureUpdateTime();
   }
 }
  public void func_76846_a() {
    if (!Config.isAnimatedPortal()) {
      this.field_76852_a = null;
    }

    if (this.field_76852_a != null) {
      ++this.tickCounter;
      byte[] var1 = this.buffer[this.tickCounter & 31];

      for (int var2 = 0; var2 < this.tileWidth * this.tileWidth; ++var2) {
        int var3 = var1[var2 * 4 + 0] & 255;
        int var4 = var1[var2 * 4 + 1] & 255;
        int var5 = var1[var2 * 4 + 2] & 255;
        int var6 = var1[var2 * 4 + 3] & 255;
        if (this.field_76851_c) {
          int var7 = (var3 * 30 + var4 * 59 + var5 * 11) / 100;
          int var8 = (var3 * 30 + var4 * 70) / 100;
          int var9 = (var3 * 30 + var5 * 70) / 100;
          var3 = var7;
          var4 = var8;
          var5 = var9;
        }

        this.field_76852_a[var2 * 4 + 0] = (byte) var3;
        this.field_76852_a[var2 * 4 + 1] = (byte) var4;
        this.field_76852_a[var2 * 4 + 2] = (byte) var5;
        this.field_76852_a[var2 * 4 + 3] = (byte) var6;
      }
    }
  }
Example #6
0
  public Tessellator getSubTessellatorImpl(int i) {
    for (int j = 0; j < subTextures.length; j++) {
      int l = subTextures[j];
      if (l == i) {
        Tessellator tessellator1 = subTessellators[j];
        return tessellator1;
      }
    }

    for (int k = 0; k < subTextures.length; k++) {
      int i1 = subTextures[k];
      if (i1 <= 0) {
        Tessellator tessellator2 = subTessellators[k];
        subTextures[k] = i;
        return tessellator2;
      }
    }

    Tessellator tessellator = new Tessellator();
    Tessellator atessellator[] = subTessellators;
    int ai[] = subTextures;
    subTessellators = new Tessellator[atessellator.length + 1];
    subTextures = new int[ai.length + 1];
    System.arraycopy(atessellator, 0, subTessellators, 0, atessellator.length);
    System.arraycopy(ai, 0, subTextures, 0, ai.length);
    subTessellators[atessellator.length] = tessellator;
    subTextures[ai.length] = i;
    Config.dbg(
        (new StringBuilder())
            .append("Allocated subtessellator, count: ")
            .append(subTessellators.length)
            .toString());
    return tessellator;
  }
Example #7
0
 private RenderEnv(IBlockAccess blockAccess, IBlockState blockState, BlockPos blockPos) {
   this.quadBounds = new float[EnumFacing.VALUES.length * 2];
   this.boundsFlags = new BitSet(3);
   this.aoFace = new BlockModelRenderer.AmbientOcclusionFace();
   this.colorizerBlockPos = null;
   this.borderFlags = null;
   this.blockAccess = blockAccess;
   this.blockState = blockState;
   this.blockPos = blockPos;
   this.gameSettings = Config.getGameSettings();
 }
  private static void dbgFieldValue(boolean var0, String var1, ReflectorField var2, Object var3) {
    String var4 = var2.getTargetField().getDeclaringClass().getName();
    String var5 = var2.getTargetField().getName();
    String var6 = "";

    if (var0) {
      var6 = " static";
    }

    Config.dbg(var1 + var6 + " " + var4 + "." + var5 + " => " + var3);
  }
  public void unpause() {
    Object var1 = this.lock;
    synchronized (this.lock) {
      if (this.working) {
        Config.dbg("UpdateThread still working in unpause()!!!");
      }

      this.canWork = true;
      this.canWorkToEndOfUpdate = false;
      this.lock.notifyAll();
    }
  }
  private static void handleException(
      Throwable var0, Object var1, ReflectorMethod var2, Object[] var3) {
    if (var0 instanceof InvocationTargetException) {
      var0.printStackTrace();
    } else {
      if (var0 instanceof IllegalArgumentException) {
        Config.dbg("*** IllegalArgumentException ***");
        Config.dbg("Method: " + var2.getTargetMethod());
        Config.dbg("Object: " + var1);
        Config.dbg("Parameter classes: " + Config.arrayToString(getClasses(var3)));
        Config.dbg("Parameters: " + Config.arrayToString(var3));
      }

      Config.dbg("*** Exception outside of method ***");
      Config.dbg("Method deactivated: " + var2.getTargetMethod());
      var2.deactivate();
      var0.printStackTrace();
    }
  }
Example #11
0
  public void unpauseToEndOfUpdate() {
    Object var1 = this.lock;
    synchronized (this.lock) {
      if (this.working) {
        Config.dbg("UpdateThread still working in unpause()!!!");
      }

      if (this.currentRenderer != null) {
        while (this.currentRenderer != null) {
          this.canWork = false;
          this.canWorkToEndOfUpdate = true;
          this.lock.notifyAll();

          try {
            this.lock.wait();
          } catch (InterruptedException var4) {;
          }
        }

        this.pause();
      }
    }
  }
  public void onTick() {
    if (!Config.isAnimatedFire()) {
      imageData = null;
    }
    if (imageData == null) {
      return;
    }
    float f = 1.01F + 0.8F / (float) tileWidth;
    float f1 = 3F + (float) tileWidth / 16F;
    for (int i = 0; i < tileWidth; i++) {
      for (int j = 0; j < fireHeight; j++) {
        int l = fireHeight - tileWidth / 8;
        float f2 = buf1[i + ((j + 1) % fireHeight) * tileWidth] * (float) l;
        for (int j1 = i - 1; j1 <= i + 1; j1++) {
          for (int k1 = j; k1 <= j + 1; k1++) {
            int i2 = j1;
            int k2 = k1;
            if (i2 >= 0 && k2 >= 0 && i2 < tileWidth && k2 < fireHeight) {
              f2 += buf1[i2 + k2 * tileWidth];
            }
            l++;
          }
        }

        buf2[i + j * tileWidth] = f2 / ((float) l * f);
        if (j >= fireHeight - tileWidth / 16) {
          buf2[i + j * tileWidth] =
              random.nextFloat() * random.nextFloat() * random.nextFloat() * f1
                  + random.nextFloat() * 0.1F
                  + 0.2F;
        }
      }
    }

    float af[] = buf2;
    buf2 = buf1;
    buf1 = af;
    int k = tileWidth * tileWidth;
    for (int i1 = 0; i1 < k; i1++) {
      float f3 = buf1[i1] * 1.8F;
      if (f3 > 1.0F) {
        f3 = 1.0F;
      }
      if (f3 < 0.0F) {
        f3 = 0.0F;
      }
      float f4 = f3;
      int l1 = (int) (f4 * 155F + 100F);
      int j2 = (int) (f4 * f4 * 255F);
      int l2 = (int) (f4 * f4 * f4 * f4 * f4 * f4 * f4 * f4 * f4 * f4 * 255F);
      char c = '\377';
      if (f4 < 0.5F) {
        c = '\0';
      }
      f4 = (f4 - 0.5F) * 2.0F;
      if (anaglyphEnabled) {
        int i3 = (l1 * 30 + j2 * 59 + l2 * 11) / 100;
        int k3 = (l1 * 30 + j2 * 70) / 100;
        int l3 = (l1 * 30 + l2 * 70) / 100;
        l1 = i3;
        j2 = k3;
        l2 = l3;
      }
      int j3 = i1 * 4;
      imageData[j3 + 0] = (byte) l1;
      imageData[j3 + 1] = (byte) j2;
      imageData[j3 + 2] = (byte) l2;
      imageData[j3 + 3] = (byte) c;
    }
  }
 public static void addAtlasName(String var0) {
   if (var0 != null) {
     atlasNames.add(var0);
     Config.dbg("TextureAtlas: " + var0);
   }
 }
Example #14
0
 private int getTerrainTexture() {
   if (terrainTexture == 0) {
     terrainTexture = Config.getMinecraft().field_6315_n.func_1070_a("/terrain.png");
   }
   return terrainTexture;
 }
Example #15
0
 public void func_991_a(double p_991_1_, double p_991_3_, double p_991_5_) {
   if (autoGrow && field_1498_o >= field_1494_B - 32) {
     Config.dbg(
         (new StringBuilder())
             .append("Expand tessellator buffer, old: ")
             .append(field_1494_B)
             .append(", new: ")
             .append(field_1494_B * 2)
             .toString());
     field_1494_B *= 2;
     int ai[] = new int[field_1494_B];
     System.arraycopy(field_1506_g, 0, ai, 0, field_1506_g.length);
     field_1506_g = ai;
     field_1509_d = GLAllocation.func_1127_b(field_1494_B * 4);
     field_1508_e = field_1509_d.asIntBuffer();
     field_1507_f = field_1509_d.asFloatBuffer();
     field_35836_g = field_1509_d.asShortBuffer();
   }
   field_1497_p++;
   if (field_1493_r == 7 && field_1511_b && field_1497_p % 4 == 0) {
     for (int i = 0; i < 2; i++) {
       int j = 8 * (3 - i);
       if (field_1500_m) {
         field_1506_g[field_1498_o + 3] = field_1506_g[(field_1498_o - j) + 3];
         field_1506_g[field_1498_o + 4] = field_1506_g[(field_1498_o - j) + 4];
       }
       if (field_35838_p) {
         field_1506_g[field_1498_o + 7] = field_1506_g[(field_1498_o - j) + 7];
       }
       if (field_1501_l) {
         field_1506_g[field_1498_o + 5] = field_1506_g[(field_1498_o - j) + 5];
       }
       field_1506_g[field_1498_o + 0] = field_1506_g[(field_1498_o - j) + 0];
       field_1506_g[field_1498_o + 1] = field_1506_g[(field_1498_o - j) + 1];
       field_1506_g[field_1498_o + 2] = field_1506_g[(field_1498_o - j) + 2];
       field_1505_h++;
       field_1498_o += 8;
     }
   }
   if (field_1500_m) {
     field_1506_g[field_1498_o + 3] = Float.floatToRawIntBits((float) field_1504_i);
     field_1506_g[field_1498_o + 4] = Float.floatToRawIntBits((float) field_1503_j);
   }
   if (field_35838_p) {
     field_1506_g[field_1498_o + 7] = field_35837_l;
   }
   if (field_1501_l) {
     field_1506_g[field_1498_o + 5] = field_1502_k;
   }
   if (field_1499_n) {
     field_1506_g[field_1498_o + 6] = field_1489_v;
   }
   field_1506_g[field_1498_o + 0] = Float.floatToRawIntBits((float) (p_991_1_ + field_1492_s));
   field_1506_g[field_1498_o + 1] = Float.floatToRawIntBits((float) (p_991_3_ + field_1491_t));
   field_1506_g[field_1498_o + 2] = Float.floatToRawIntBits((float) (p_991_5_ + field_1490_u));
   field_1498_o += 8;
   field_1505_h++;
   if (!autoGrow && field_1497_p % 4 == 0 && field_1498_o >= field_1494_B - 32) {
     func_982_a();
     field_1488_w = true;
   }
 }