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) { private static boolean fixPos(CompoundTag tag) {
if (!tag.contains("Pos") && tag.contains("x") && tag.contains("y") && tag.contains("z")) { 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( ImmutableList.of(
DoubleTag.of(tag.getDouble("x")), ((Number) tag.getDouble("x")).intValue(),
DoubleTag.of(tag.getDouble("y")), ((Number) tag.getDouble("y")).intValue(),
DoubleTag.of(tag.getDouble("z")) ((Number) tag.getDouble("z")).intValue()
), )
(byte) 6
)); ));
} else if (tag.contains("Pos") && !tag.contains("x") && !tag.contains("y") && !tag.contains("z")) { } 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)); tag.put("x", ((IntArrayTag) Objects.requireNonNull(tag.get("Pos"))).get(0));