From 4e36b56fa1c0f6c38336cdbe119a60a96795abcf Mon Sep 17 00:00:00 2001 From: nervonment Date: Tue, 3 Dec 2024 16:36:12 +0800 Subject: [PATCH] Fix #508 by update `lodestone_target` to `lodestone_tracker` --- .../version/anvil120/Anvil120ChunkRelocator.java | 7 ++++--- .../version/anvil121/Anvil121ChunkRelocator.java | 11 +++++++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/main/java/net/querz/mcaselector/version/anvil120/Anvil120ChunkRelocator.java b/src/main/java/net/querz/mcaselector/version/anvil120/Anvil120ChunkRelocator.java index dbb80efa..425728e9 100644 --- a/src/main/java/net/querz/mcaselector/version/anvil120/Anvil120ChunkRelocator.java +++ b/src/main/java/net/querz/mcaselector/version/anvil120/Anvil120ChunkRelocator.java @@ -196,9 +196,10 @@ static void applyOffsetToItem(CompoundTag item, Point3i offset, int dataVersion) String id = Helper.stringFromCompound(item, "id", ""); switch (id) { case "minecraft:compass": - CompoundTag lodestoneTarget = Helper.tagFromCompound(components, "minecraft:lodestone_target"); - if (lodestoneTarget != null) { - IntArrayTag pos = lodestoneTarget.getIntArrayTag("pos"); + CompoundTag lodestoneTracker = Helper.tagFromCompound(components, "minecraft:lodestone_tracker"); + if (lodestoneTracker != null) { + CompoundTag target = Helper.tagFromCompound(lodestoneTracker, "target"); + IntArrayTag pos = target.getIntArrayTag("pos"); if (pos != null) { Helper.applyOffsetToIntArrayPos(pos, offset); } diff --git a/src/main/java/net/querz/mcaselector/version/anvil121/Anvil121ChunkRelocator.java b/src/main/java/net/querz/mcaselector/version/anvil121/Anvil121ChunkRelocator.java index 1823d73e..f4222a99 100644 --- a/src/main/java/net/querz/mcaselector/version/anvil121/Anvil121ChunkRelocator.java +++ b/src/main/java/net/querz/mcaselector/version/anvil121/Anvil121ChunkRelocator.java @@ -189,10 +189,13 @@ static void applyOffsetToItem(CompoundTag item, Point3i offset) { String id = Helper.stringFromCompound(item, "id", ""); switch (id) { case "minecraft:compass": - CompoundTag lodestoneTarget = Helper.tagFromCompound(components, "minecraft:lodestone_target"); - IntArrayTag pos = lodestoneTarget.getIntArrayTag("pos"); - if (pos != null) { - Helper.applyOffsetToIntArrayPos(pos, offset); + CompoundTag lodestoneTracker = Helper.tagFromCompound(components, "minecraft:lodestone_tracker"); + if (lodestoneTracker != null) { + CompoundTag target = Helper.tagFromCompound(lodestoneTracker, "target"); + IntArrayTag pos = target.getIntArrayTag("pos"); + if (pos != null) { + Helper.applyOffsetToIntArrayPos(pos, offset); + } } break; }