Skip to content

Commit

Permalink
Adjusted generation configs
Browse files Browse the repository at this point in the history
  • Loading branch information
HyCraftHD committed Jul 10, 2019
1 parent 7072049 commit 3f473e9
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ public class DefaultConfig {
private final GeneratableConfig netherOreConfig;

public DefaultConfig(float oreHardness, float oreResistance, float netherOreHardness, float netherOreResistance, float blockHardness, float blockResistance, GeneratableConfig oreConfig, GeneratableConfig netherOreConfig) {
super();
this.oreHardness = oreHardness;
this.oreResistance = oreResistance;
this.netherOreHardness = netherOreHardness;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,33 @@

public class GeneratableConfig implements IGeneratable {

private final static Category[] OVERWORLD_BLACKLIST = new Category[] { Category.NETHER, Category.THEEND }; // Blacklist
private final static Category[] NETHER_WHITELIST = new Category[] { Category.NETHER }; // Whitelist

public static GeneratableConfig createRangeOverworld(int veinSize, int count, int bottomOffset, int topOffset, int maximum) {
return createRange(ListType.BLACKLIST, OVERWORLD_BLACKLIST, veinSize, count, bottomOffset, topOffset, maximum);
}

public static GeneratableConfig createRangeNether(int veinSize, int count, int bottomOffset, int topOffset, int maximum) {
return createRange(ListType.WHITELIST, NETHER_WHITELIST, veinSize, count, bottomOffset, topOffset, maximum);
}

public static GeneratableConfig createRange(ListType biomeCategoryListType, Category[] biomeCategories, int veinSize, int count, int bottomOffset, int topOffset, int maximum) {
return new GeneratableConfig(true, biomeCategoryListType, biomeCategories, ListType.BLACKLIST, new Biome[] {}, veinSize, GenerationConfig.COUNT_RANGE, new CountRangeConfig(count, bottomOffset, topOffset, maximum), null);
}

public static GeneratableConfig createDepthAverageOverworld(int veinSize, int count, int baseline, int spread) {
return createDepthAverage(ListType.BLACKLIST, OVERWORLD_BLACKLIST, veinSize, count, baseline, spread);
}

public static GeneratableConfig createDepthAverageNether(int veinSize, int count, int baseline, int spread) {
return createDepthAverage(ListType.WHITELIST, NETHER_WHITELIST, veinSize, count, baseline, spread);
}

public static GeneratableConfig createDepthAverage(ListType biomeCategoryListType, Category[] biomeCategories, int veinSize, int count, int baseline, int spread) {
return new GeneratableConfig(true, biomeCategoryListType, biomeCategories, ListType.BLACKLIST, new Biome[] {}, veinSize, GenerationConfig.COUNT_DEPTH_AVERAGE, null, new DepthAverageConfig(count, baseline, spread));
}

private final boolean enabled;

private final ListType biomeCategoryListType;
Expand All @@ -29,14 +56,14 @@ public class GeneratableConfig implements IGeneratable {
private final CountRangeConfig countRangeConfig;
private final DepthAverageConfig depthAverageConfig;

public GeneratableConfig(boolean enabled, ListType biomeCategoryListType, Category[] biomeCategorys, ListType biomeListType, Biome[] biomes, int veinSize, GenerationConfig type, CountRangeConfig countRangeConfig, DepthAverageConfig depthAverageConfig) {
this(enabled, biomeCategoryListType, Arrays.asList(biomeCategorys), biomeListType, Arrays.asList(biomes), veinSize, type, countRangeConfig, depthAverageConfig);
public GeneratableConfig(boolean enabled, ListType biomeCategoryListType, Category[] biomeCategories, ListType biomeListType, Biome[] biomes, int veinSize, GenerationConfig type, CountRangeConfig countRangeConfig, DepthAverageConfig depthAverageConfig) {
this(enabled, biomeCategoryListType, Arrays.asList(biomeCategories), biomeListType, Arrays.asList(biomes), veinSize, type, countRangeConfig, depthAverageConfig);
}

public GeneratableConfig(boolean enabled, ListType biomeCategoryListType, List<Category> biomeCategorys, ListType biomeListType, List<Biome> biomes, int veinSize, GenerationConfig type, CountRangeConfig countRangeConfig, DepthAverageConfig depthAverageConfig) {
public GeneratableConfig(boolean enabled, ListType biomeCategoryListType, List<Category> biomeCategories, ListType biomeListType, List<Biome> biomes, int veinSize, GenerationConfig type, CountRangeConfig countRangeConfig, DepthAverageConfig depthAverageConfig) {
this.enabled = enabled;
this.biomeCategoryListType = biomeCategoryListType;
this.biomeCategories = biomeCategorys;
this.biomeCategories = biomeCategories;
this.biomeListType = biomeListType;
this.biomes = biomes;
this.veinSize = veinSize;
Expand Down
14 changes: 5 additions & 9 deletions src/main/java/info/u_team/useful_resources/type/Resources.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,17 @@
import java.util.stream.Collectors;

import info.u_team.useful_resources.api.*;
import info.u_team.useful_resources.api.IGeneratable.*;
import info.u_team.useful_resources.config.*;
import info.u_team.useful_resources.resource.*;
import net.minecraft.util.IStringSerializable;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.Biome.Category;
import net.minecraft.world.gen.placement.CountRangeConfig;

public enum Resources implements IResource, IStringSerializable {

COPPER("copper", new DefaultConfig(3F, 3F, 3F, 3F, 3F, 6F, new GeneratableConfig(true, ListType.BLACKLIST, new Category[] { Category.NETHER, Category.THEEND }, ListType.BLACKLIST, new Biome[] {}, 9, GenerationConfig.COUNT_RANGE, new CountRangeConfig(20, 0, 0, 64), null), new GeneratableConfig(true, ListType.WHITELIST, new Category[] { Category.NETHER }, ListType.BLACKLIST, new Biome[] {}, 9, GenerationConfig.COUNT_RANGE, new CountRangeConfig(16, 10, 20, 128), null))),
TIN("tin", new DefaultConfig(3F, 3F, 3F, 3F, 3F, 6F, new GeneratableConfig(true, ListType.BLACKLIST, new Category[] { Category.NETHER, Category.THEEND }, ListType.BLACKLIST, new Biome[] {}, 9, GenerationConfig.COUNT_RANGE, new CountRangeConfig(20, 0, 0, 64), null), new GeneratableConfig(true, ListType.WHITELIST, new Category[] { Category.NETHER }, ListType.BLACKLIST, new Biome[] {}, 9, GenerationConfig.COUNT_RANGE, new CountRangeConfig(16, 10, 20, 128), null))),
ALUMINUM("aluminum", new DefaultConfig(3F, 3F, 3F, 3F, 3F, 6F, new GeneratableConfig(true, ListType.BLACKLIST, new Category[] { Category.NETHER, Category.THEEND }, ListType.BLACKLIST, new Biome[] {}, 9, GenerationConfig.COUNT_RANGE, new CountRangeConfig(20, 0, 0, 64), null), new GeneratableConfig(true, ListType.WHITELIST, new Category[] { Category.NETHER }, ListType.BLACKLIST, new Biome[] {}, 9, GenerationConfig.COUNT_RANGE, new CountRangeConfig(16, 10, 20, 128), null))),
SILVER("silver", new DefaultConfig(3F, 3F, 3F, 3F, 3F, 6F, new GeneratableConfig(true, ListType.BLACKLIST, new Category[] { Category.NETHER, Category.THEEND }, ListType.BLACKLIST, new Biome[] {}, 9, GenerationConfig.COUNT_RANGE, new CountRangeConfig(20, 0, 0, 64), null), new GeneratableConfig(true, ListType.WHITELIST, new Category[] { Category.NETHER }, ListType.BLACKLIST, new Biome[] {}, 9, GenerationConfig.COUNT_RANGE, new CountRangeConfig(16, 10, 20, 128), null))),
LEAD("lead", new DefaultConfig(3F, 3F, 3F, 3F, 3F, 6F, new GeneratableConfig(true, ListType.BLACKLIST, new Category[] { Category.NETHER, Category.THEEND }, ListType.BLACKLIST, new Biome[] {}, 9, GenerationConfig.COUNT_RANGE, new CountRangeConfig(20, 0, 0, 64), null), new GeneratableConfig(true, ListType.WHITELIST, new Category[] { Category.NETHER }, ListType.BLACKLIST, new Biome[] {}, 9, GenerationConfig.COUNT_RANGE, new CountRangeConfig(16, 10, 20, 128), null)));
COPPER("copper", new DefaultConfig(3F, 3F, 3F, 3F, 3F, 6F, GeneratableConfig.createRangeOverworld(9, 20, 0, 0, 64), GeneratableConfig.createRangeOverworld(9, 10, 10, 20, 128))),
TIN("tin", new DefaultConfig(3F, 3F, 3F, 3F, 3F, 6F, GeneratableConfig.createRangeOverworld(9, 20, 0, 0, 64), GeneratableConfig.createRangeOverworld(9, 10, 10, 20, 128))),
ALUMINUM("aluminum", new DefaultConfig(2.6F, 3F, 2.5F, 3F, 3F, 6F, GeneratableConfig.createRangeOverworld(9, 20, 0, 0, 64), GeneratableConfig.createRangeOverworld(9, 10, 10, 20, 128))),
SILVER("silver", new DefaultConfig(4F, 4F, 4F, 3F, 3F, 6F, GeneratableConfig.createRangeOverworld(9, 2, 0, 0, 32), GeneratableConfig.createRangeOverworld(9, 3, 10, 20, 128))),
LEAD("lead", new DefaultConfig(4F, 4F, 4F, 3F, 3F, 6F, GeneratableConfig.createRangeOverworld(10, 3, 0, 0, 32), GeneratableConfig.createRangeOverworld(9, 3, 10, 20, 128)));

public static final List<Resources> VALUES = Collections.unmodifiableList(Arrays.stream(values()).collect(Collectors.toList()));

Expand Down

0 comments on commit 3f473e9

Please sign in to comment.