ListTag -> IntArrayTag

Changes to be committed:
	modified:   src/main/java/org/dimdev/dimcore/schematic/v2/SchematicPlacer.java
This commit is contained in:
SD 2020-09-19 10:41:33 +05:30
parent cc99080753
commit f4a3d200d3
No known key found for this signature in database
GPG key ID: E36B57EE08544BC5

View file

@ -119,13 +119,12 @@ public final class SchematicPlacer {
private static boolean fixPos(CompoundTag tag) {
if (!tag.contains("Pos") && tag.contains("x") && tag.contains("y") && tag.contains("z")) {
tag.put("Pos", ListTagAccessor.of(
tag.put("Pos", new IntArrayTag(
ImmutableList.of(
DoubleTag.of(tag.getDouble("x")),
DoubleTag.of(tag.getDouble("y")),
DoubleTag.of(tag.getDouble("z"))
),
(byte) 6
((Number) tag.getDouble("x")).intValue(),
((Number) tag.getDouble("y")).intValue(),
((Number) tag.getDouble("z")).intValue()
)
));
} else if (tag.contains("Pos") && !tag.contains("x") && !tag.contains("y") && !tag.contains("z")) {
tag.put("x", ((IntArrayTag) Objects.requireNonNull(tag.get("Pos"))).get(0));