-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathConfig.java
89 lines (73 loc) · 2.76 KB
/
Config.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
package net.powerscale.config;
import java.util.Random;
public class Config {
public Dimension[] dimensions;
public static class Dimension {
public static class Filters {
public String dimension_regex = ".*";
}
public Filters world_matches = new Filters();
public EntityModifier[] entities = new EntityModifier[]{};
public Rewards rewards = new Rewards();
public Zone[] zones = new Zone[]{};
}
public static class Zone {
public static class Filters {
public String biome_regex = ".*";
}
public Filters zone_matches = new Filters();
public EntityModifier[] entities = new EntityModifier[]{};
public Rewards rewards = new Rewards();
}
public enum Operation { ADD, MULTIPLY }
public static class EntityModifier {
public static class Filters {
public enum Attitude {
FRIENDLY, HOSTILE, ANY
}
public Attitude attitude = Attitude.ANY;
public String entity_id_regex = ".*";
}
public Filters entity_matches = new Filters();
public AttributeModifier[] attributes = new AttributeModifier[]{};
public SpawnerModifier spawners = null;
}
public static class Rewards {
public ItemModifier[] armor = new ItemModifier[]{};
public ItemModifier[] weapons = new ItemModifier[]{};
}
public static class ItemModifier {
public static class Filters {
public String item_id_regex = ".*";
public String loot_table_regex = ".*";
public String rarity_regex = ".*";
}
public Filters item_matches = new Filters();
public AttributeModifier[] attributes = new AttributeModifier[]{};
}
public static class AttributeModifier {
public String attribute;
public Operation operation = Operation.MULTIPLY;
public float randomness = 0;
public float value = 1;
public AttributeModifier() {}
public AttributeModifier(String attribute, float value) {
this.attribute = attribute;
this.value = value;
}
private static Random rng = new Random();
public float randomizedValue() {
return (randomness > 0)
? rng.nextFloat(value - randomness, value + randomness)
: value;
}
}
public static class SpawnerModifier {
public float spawn_range_multiplier = 1;
public float spawn_count_multiplier = 1;
public float max_nearby_entities_multiplier = 1;
public float min_spawn_delay_multiplier = 1;
public float max_spawn_delay_multiplier = 1;
public float required_player_range_multiplier = 1;
}
}