-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathConfig.java
125 lines (107 loc) · 4.36 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
package net.dungeon_difficulty.config;
import java.util.List;
import java.util.Random;
public class Config {
public Meta meta = new Meta();
public class Meta { public Meta() { }
public String comment = "IMPORTANT! Make sure to set `allow_customization` to `true` to allow customization of the config";
public boolean allow_customization = false;
public boolean sanitize_config = true;
public Double rounding_unit = 0.5;
//public boolean entity_equipment_scaling = false;
}
public PerPlayerDifficulty perPlayerDifficulty;
public static class PerPlayerDifficulty { public PerPlayerDifficulty() { }
public boolean enabled = true;
public enum Counting { EVERYWHERE, DIMENSION }
public Counting counting = Counting.EVERYWHERE;
public EntityModifier[] entities = new EntityModifier[]{};
}
public DifficultyType[] difficulty_types;
public static class DifficultyType { public DifficultyType() { }
public String name;
public String parent;
public List<EntityModifier> entities = List.of();
public Rewards rewards = new Rewards();
public DifficultyType(String name) {
this.name = name;
}
}
public static class DifficultyReference { public DifficultyReference() { }
public String name;
public int level = 0;
public DifficultyReference(String name, int level) {
this.name = name;
this.level = level;
}
}
public Dimension[] dimensions;
public static class Dimension { public Dimension() { }
public static class Filters {
public String dimension_regex = Regex.ANY;
}
public Filters world_matches = new Filters();
public DifficultyReference difficulty;
public Zone[] zones = new Zone[]{};
}
public static class Zone { public Zone() { }
public static class Filters { public Filters() { }
public String biome = Regex.ANY;
public String structure = null;
}
public Filters zone_matches = new Filters();
public DifficultyReference difficulty;
}
public enum Operation { ADDITION, MULTIPLY_BASE }
public static class EntityModifier { public EntityModifier() { }
public static class Filters {
public enum Attitude {
FRIENDLY, HOSTILE, ANY
}
public Attitude attitude = Attitude.ANY;
public String entity_id_regex = Regex.ANY;
}
public Filters entity_matches = new Filters();
public AttributeModifier[] attributes = new AttributeModifier[]{};
public SpawnerModifier spawners = null;
public float experience_multiplier = 0;
}
public static class Rewards { public Rewards() { }
public List<ItemModifier> armor = List.of();
public List<ItemModifier> weapons = List.of();
}
public static class ItemModifier { public ItemModifier() { }
public static class Filters {
public String item_id_regex = Regex.ANY;
public String loot_table_regex = Regex.ANY;
public String rarity_regex = Regex.ANY;
}
public Filters item_matches = new Filters();
public AttributeModifier[] attributes = new AttributeModifier[]{};
}
public static class AttributeModifier { public AttributeModifier() { }
public String attribute;
public Operation operation = Operation.MULTIPLY_BASE;
public float randomness = 0;
public float value = 0;
public AttributeModifier(String attribute, float value) {
this.attribute = attribute;
this.value = value;
}
private static Random rng = new Random();
public float randomizedValue(int level) {
var value = this.value * level;
return (randomness > 0)
? rng.nextFloat(value - randomness, value + randomness)
: value;
}
}
public static class SpawnerModifier { public SpawnerModifier() { }
public float spawn_range_multiplier = 0;
public float spawn_count_multiplier = 0;
public float max_nearby_entities_multiplier = 0;
public float min_spawn_delay_multiplier = 0;
public float max_spawn_delay_multiplier = 0;
public float required_player_range_multiplier = 0;
}
}