Skip to content
Merged

3.9.1 #1236

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.volmit.iris.core.nms.datapack.v1192.DataFixerV1192;
import com.volmit.iris.core.nms.datapack.v1206.DataFixerV1206;
import com.volmit.iris.core.nms.datapack.v1213.DataFixerV1213;
import com.volmit.iris.core.nms.datapack.v1217.DataFixerV1217;
import com.volmit.iris.util.collection.KMap;
import lombok.AccessLevel;
import lombok.Getter;
Expand All @@ -17,7 +18,7 @@ public enum DataVersion {
V1_19_2("1.19.2", 10, DataFixerV1192::new),
V1_20_5("1.20.6", 41, DataFixerV1206::new),
V1_21_3("1.21.3", 57, DataFixerV1213::new),
V1_21_11("1.21.11", 75, DataFixerV1213::new);
V1_21_11("1.21.11", 75, DataFixerV1217::new);
private static final KMap<DataVersion, IDataFixer> cache = new KMap<>();
@Getter(AccessLevel.NONE)
private final Supplier<IDataFixer> constructor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ public JSONObject fixCustomBiome(IrisBiomeCustom biome, JSONObject json) {
.put(particle.getJSONObject("options")
.put("probability", particle.get("probability"))));
}
json.put("attributes", attributes);

return json;
}
Expand Down Expand Up @@ -154,10 +155,10 @@ public void fixDimension(Dimension dimension, JSONObject json) {

private void merge(JSONObject base, JSONObject override) {
for (String key : override.keySet()) {
switch (base.get(key)) {
case null -> base.put(key, override.get(key));
case JSONObject base1 when override.get(key) instanceof JSONObject override1 -> merge(base1, override1);
case JSONArray base1 when override.get(key) instanceof JSONArray override1 -> {
switch (base.opt(key)) {
case null -> base.put(key, override.opt(key));
case JSONObject base1 when override.opt(key) instanceof JSONObject override1 -> merge(base1, override1);
case JSONArray base1 when override.opt(key) instanceof JSONArray override1 -> {
for (Object o : override1) {
base1.put(o);
}
Expand Down