Advertisement
Guest User

Untitled

a guest
Jan 20th, 2020
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.92 KB | None | 0 0
  1. public class Config {
  2.     private String name;
  3.     private int weight;
  4.     public double scale;
  5.     public double depth;
  6.     public int villageSize;
  7.     private BiomeDictionary.Type[] types;
  8.  
  9.     private ForgeConfigSpec.IntValue configWeight;
  10.  
  11.     public ForgeConfigSpec.DoubleValue configScale;
  12.  
  13.     public ForgeConfigSpec.DoubleValue configDepth;
  14.  
  15.     public ForgeConfigSpec.IntValue configVillageSize;
  16.  
  17.     public Config(String name, int weight, double scale, double depth, int villageSize) {
  18.         this.name = name;
  19.         this.weight = weight;
  20.         this.scale = scale;
  21.         this.depth = depth;
  22.         this.villageSize = villageSize;
  23.         //this.types = types;
  24.         ConfigManager.BIOMES.add(this);
  25.     }
  26.  
  27.     public String getName() {
  28.         return name;
  29.     }
  30.  
  31.     public int getWeight() {
  32.         return configWeight.get();
  33.     }
  34.  
  35.  
  36.     public double getScale() {
  37.         return configScale.get();
  38.     }
  39.     public int getVillageSize() {
  40.         return configVillageSize.get();
  41.     }
  42.  
  43.     public double getDepth() {
  44.         return configDepth.get();
  45.     }
  46.  
  47.     public boolean shouldSpawn() {
  48.         return configWeight.get() != 0;
  49.     }
  50.  
  51.     public void apply(ForgeConfigSpec.Builder builder) {
  52.         builder.comment(name + " biome generation").push(name + "_biome");
  53.         configScale = builder.comment("scale is height variation. \ndefault is 2.3").defineInRange("scale", scale, 1, 10);
  54.         configDepth = builder.comment("depth describes the height of the biome. \ndefault is 1.9").defineInRange("depth", depth, 1, 10);
  55.         configWeight = builder.comment("weight of the biome (set to 0 to disable generation). \ndefault is 3").defineInRange("weight", weight, 0, 256);
  56.         configVillageSize = builder.comment("set the size of villages within this biome (set to 0 to disable). \n default is 6").defineInRange("villagesize",villageSize,0,100);
  57.         builder.pop();
  58.     }
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement