9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2025-12-28 19:39:11 +00:00

Merge branch 'Xiao-MoMi:dev' into dev

This commit is contained in:
jhqwqmc
2025-06-25 19:01:34 +08:00
committed by GitHub
6 changed files with 7 additions and 7 deletions

View File

@@ -167,11 +167,11 @@ public class SelectItemModel implements ItemModel {
if (whenObj instanceof JsonArray array) {
List<String> whens = new ArrayList<>(array.size());
for (JsonElement o : array) {
whens.add(o.toString());
whens.add(o.getAsString());
}
either = Either.ofFallback(whens);
} else if (whenObj instanceof JsonPrimitive primitive) {
either = Either.ofPrimary(primitive.toString());
either = Either.ofPrimary(primitive.getAsString());
} else {
throw new IllegalArgumentException("when is expected to be either JsonPrimitive or JsonArray");
}

View File

@@ -35,7 +35,7 @@ public class SimpleConditionProperty implements ConditionProperty {
public static class Reader implements ConditionPropertyReader {
@Override
public ConditionProperty read(JsonObject json) {
return new SimpleConditionProperty(Key.of(json.get("property").toString()));
return new SimpleConditionProperty(Key.of(json.get("property").getAsString()));
}
}
}

View File

@@ -35,7 +35,7 @@ public class SimpleRangeDispatchProperty implements RangeDispatchProperty {
public static class Reader implements RangeDispatchPropertyReader {
@Override
public RangeDispatchProperty read(JsonObject json) {
Key type = Key.of(json.get("property").toString());
Key type = Key.of(json.get("property").getAsString());
return new SimpleRangeDispatchProperty(type);
}
}

View File

@@ -35,7 +35,7 @@ public class SimpleSelectProperty implements SelectProperty {
public static class Reader implements SelectPropertyReader {
@Override
public SelectProperty read(JsonObject json) {
Key type = Key.of(json.get("property").toString());
Key type = Key.of(json.get("property").getAsString());
return new SimpleSelectProperty(type);
}
}

View File

@@ -45,7 +45,7 @@ public class SimpleSpecialModel implements SpecialModel {
public static class Reader implements SpecialModelReader {
@Override
public SpecialModel read(JsonObject json) {
Key type = Key.of(json.get("type").toString());
Key type = Key.of(json.get("type").getAsString());
return new SimpleSpecialModel(type);
}
}