9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2025-12-26 02:19:23 +00:00

修复部分资源包生成

This commit is contained in:
XiaoMoMi
2025-06-25 17:15:26 +08:00
parent 5f42dfd453
commit f4d1631f81
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);
}
}

View File

@@ -41,7 +41,7 @@ commons_io_version=2.18.0
commons_imaging_version=1.0.0-alpha6
commons_lang3_version=3.17.0
sparrow_nbt_version=0.9.1
sparrow_util_version=0.49.2
sparrow_util_version=0.50
fastutil_version=8.5.15
netty_version=4.1.121.Final
joml_version=1.10.8