Example #1
0
  private void func_82567_a(
      int par1, World par2World, String par3Str, double par4, double par6, double par8) {
    int var10 = 1 << this.scale;
    float var11 = (float) (par4 - (double) this.xCenter) / (float) var10;
    float var12 = (float) (par6 - (double) this.zCenter) / (float) var10;
    byte var13 = (byte) ((int) ((double) (var11 * 2.0F) + 0.5D));
    byte var14 = (byte) ((int) ((double) (var12 * 2.0F) + 0.5D));
    byte var16 = 63;
    byte var15;

    if (var11 >= (float) (-var16)
        && var12 >= (float) (-var16)
        && var11 <= (float) var16
        && var12 <= (float) var16) {
      par8 += par8 < 0.0D ? -8.0D : 8.0D;
      var15 = (byte) ((int) (par8 * 16.0D / 360.0D));

      if (par2World.provider.shouldMapSpin(par3Str, par4, par6, par8)) {
        int var17 = (int) (par2World.getWorldInfo().getWorldTime() / 10L);
        var15 = (byte) (var17 * var17 * 34187121 + var17 * 121 >> 15 & 15);
      }
    } else {
      if (Math.abs(var11) >= 320.0F || Math.abs(var12) >= 320.0F) {
        this.playersVisibleOnMap.remove(par3Str);
        return;
      }

      par1 = 6;
      var15 = 0;

      if (var11 <= (float) (-var16)) {
        var13 = (byte) ((int) ((double) (var16 * 2) + 2.5D));
      }

      if (var12 <= (float) (-var16)) {
        var14 = (byte) ((int) ((double) (var16 * 2) + 2.5D));
      }

      if (var11 >= (float) var16) {
        var13 = (byte) (var16 * 2 + 1);
      }

      if (var12 >= (float) var16) {
        var14 = (byte) (var16 * 2 + 1);
      }
    }

    this.playersVisibleOnMap.put(par3Str, new MapCoord(this, (byte) par1, var13, var14, var15));
  }
Example #2
0
  private void addToCost(DimletKey key) {
    DimletEntry dimletEntry = KnownDimletConfiguration.getEntry(key);
    int rfMaintainCost = dimletEntry.getRfMaintainCost();

    if (rfMaintainCost < 0) {
      int nominalCost = descriptor.calculateNominalCost();
      int rfMinimum = Math.max(10, nominalCost * DimletConfiguration.minimumCostPercentage / 100);

      actualRfCost = actualRfCost - (actualRfCost * (-rfMaintainCost) / 100);
      if (actualRfCost < rfMinimum) {
        actualRfCost = rfMinimum; // Never consume less then this
      }
    } else {
      actualRfCost += rfMaintainCost;
    }
  }
Example #3
0
  public DimensionInformation(String name, DimensionDescriptor descriptor, World world) {
    this.name = name;
    this.descriptor = descriptor;

    this.forcedDimensionSeed = descriptor.getForcedSeed();
    if (DimletConfiguration.randomizeSeed) {
      baseSeed = (long) (Math.random() * 10000 + 1);
    } else {
      baseSeed = world.getSeed();
    }

    worldVersion = VERSION_CORRECTSEED;

    setupFromDescriptor(world.getSeed());
    setupBiomeMapping();

    dump(null);
  }
Example #4
0
  private void func_82567_a(
      int par1, World par2World, String par3Str, double par4, double par6, double par8) {
    /*
    System.out.println("MapData.func_82567_a()");
    System.out.println("    Icons: " + this.customIcons.size());
    System.out.println("    Scale: " + this.scale);
    */

    int j = 1 << this.scale;
    float f = (float) (par4 - (double) this.xCenter) / (float) j;
    float f1 = (float) (par6 - (double) this.zCenter) / (float) j;
    byte b0 = (byte) ((int) ((double) (f * 2.0F) + 0.5D));
    byte b1 = (byte) ((int) ((double) (f1 * 2.0F) + 0.5D));
    byte b2 = 63;
    byte b3;

    System.out.println("MapData.func_82567_a()");
    System.out.println(
        "    Map center: " + this.xCenter + ", " + this.zCenter + ", scale " + this.scale);
    System.out.println("    Original: " + par4 + ", " + par6);
    System.out.println("    j: " + j);
    System.out.println("    f: " + f);
    System.out.println("    f1: " + f1);
    System.out.println("    b0: " + b0);
    System.out.println("    b1: " + b1);

    if (f >= (float) (-b2) && f1 >= (float) (-b2) && f <= (float) b2 && f1 <= (float) b2) {
      par8 += par8 < 0.0D ? -8.0D : 8.0D;
      b3 = (byte) ((int) (par8 * 16.0D / 360.0D));

      if (par2World.provider.shouldMapSpin(par3Str, par4, par6, par8)) {
        int k = (int) (par2World.getWorldInfo().getWorldTime() / 10L);
        b3 = (byte) (k * k * 34187121 + k * 121 >> 15 & 15);
      }
    } else {
      if (Math.abs(f) >= 320.0F || Math.abs(f1) >= 320.0F) {
        this.playersVisibleOnMap.remove(par3Str);
        return;
      }

      par1 = 6;
      b3 = 0;

      if (f <= (float) (-b2)) {
        b0 = (byte) ((int) ((double) (b2 * 2) + 2.5D));
      }

      if (f1 <= (float) (-b2)) {
        b1 = (byte) ((int) ((double) (b2 * 2) + 2.5D));
      }

      if (f >= (float) b2) {
        b0 = (byte) (b2 * 2 + 1);
      }

      if (f1 >= (float) b2) {
        b1 = (byte) (b2 * 2 + 1);
      }
    }

    // Debug
    /*
    System.out.println("func_82567_a(" +par1+ ", world, " + par3Str + ", " +par4+ ", " +par6+ ", " +par8+ ")");
    System.out.println("    playersVisibleOnMap.put | Size: " + par1 +  " - x: " + b0 + " - z: " +b1);
    */

    System.out.println("    b0 (2): " + b0);
    System.out.println("    b1 (2): " + b1);

    this.playersVisibleOnMap.put(par3Str, new MapCoord(this, (byte) par1, b0, b1, b3));
  }