Example #1
0
  private void setupFromDescriptor(long seed) {
    List<Pair<DimletKey, List<DimletKey>>> dimlets = descriptor.getDimletsWithModifiers();

    Random random = new Random(descriptor.calculateSeed(seed));

    actualRfCost = 0;

    DimletType.DIMLET_PATREON.dimletType.constructDimension(dimlets, random, this);

    DimletType.DIMLET_TERRAIN.dimletType.constructDimension(dimlets, random, this);
    DimletType.DIMLET_FEATURE.dimletType.constructDimension(dimlets, random, this);

    DimletType.DIMLET_STRUCTURE.dimletType.constructDimension(dimlets, random, this);
    DimletType.DIMLET_BIOME.dimletType.constructDimension(dimlets, random, this);
    DimletType.DIMLET_DIGIT.dimletType.constructDimension(dimlets, random, this);

    DimletType.DIMLET_SKY.dimletType.constructDimension(dimlets, random, this);

    DimletType.DIMLET_MOBS.dimletType.constructDimension(dimlets, random, this);
    DimletType.DIMLET_SPECIAL.dimletType.constructDimension(dimlets, random, this);
    DimletType.DIMLET_TIME.dimletType.constructDimension(dimlets, random, this);
    DimletType.DIMLET_EFFECT.dimletType.constructDimension(dimlets, random, this);
    DimletType.DIMLET_WEATHER.dimletType.constructDimension(dimlets, random, this);

    actualRfCost += descriptor.getRfMaintainCost();
  }
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);
  }