tangled
alpha
login
or
join now
codexarchonic.nekoweb.org
/
ProjectInfinity
0
fork
atom
Inspired by 2020's April Fools' 20w14infinite Snapshot, this mod brings endless randomly generated dimensions into Minecraft.
0
fork
atom
overview
issues
6
pulls
pipelines
config factory respects inf version of amendments file
Lera
1 month ago
5f8173ed
a1cbd67d
+5
-1
1 changed file
expand all
collapse all
unified
split
src
main
java
net
lerariemann
infinity
compat
cloth
AmendmentConfigFactory.java
+5
-1
src/main/java/net/lerariemann/infinity/compat/cloth/AmendmentConfigFactory.java
···
31
31
}
32
32
33
33
Map<Integer, CompoundTag> amendments = new HashMap<>();
34
34
+
int infinityVersion = 0;
34
35
boolean edited = false;
35
36
ConfigCategory amendmentCategory;
36
37
ConfigBuilder builder;
···
39
40
AmendmentConfigFactory(ConfigBuilder builder) {
40
41
this.builder = builder;
41
42
42
42
-
ListTag list = readNbt(configPath()+"/amendments.json")
43
43
+
CompoundTag cmp = readNbt(configPath()+"/amendments.json");
44
44
+
ListTag list = cmp
43
45
//? if <1.21.2 {
44
46
/*.getList("elements" , 10
45
47
*///?} else {
46
48
.getListOrEmpty("elements"
47
49
//?}
48
50
);
51
51
+
infinityVersion = NbtUtils.getInt(cmp, "infinity_version", 0);
49
52
int N = list.size();
50
53
for (int i = 0; i < N; i++) if (list.get(i) instanceof CompoundTag e) {
51
54
amendments.put(i, e);
···
81
84
if (!value.isEmpty()) elements.add(value);
82
85
}
83
86
CompoundTag res = new CompoundTag();
87
87
+
res.putInt("infinity_version", infinityVersion);
84
88
res.putInt("amendment_version", (int)((System.currentTimeMillis() - 1754769333185L)/1000));
85
89
res.put("elements", elements);
86
90
CommonIO.write(res, configPath(), "amendments.json");