Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lodestone compasses in containers cause chunk importing and pasting to fail #508

Open
Nervonment opened this issue Dec 2, 2024 · 2 comments · May be fixed by #509
Open

Lodestone compasses in containers cause chunk importing and pasting to fail #508

Nervonment opened this issue Dec 2, 2024 · 2 comments · May be fixed by #509

Comments

@Nervonment
Copy link

Nervonment commented Dec 2, 2024

Describe the bug
Situation: There is a lodestone and a container with a lodestone compass pointing to the lodestone in it in a chunk. You want to paste the chunk to another place or world.

  1. (For Minecraft version 1.21.x) The chunk cannot be pasted. The debug log is attached in the Additional context section.
  2. (For Minecraft version 1.20.x and data version >= 3819) The chunk can be pasted successfully, but when you paste it with an offset, the compass still points to its previous position (i.e. the offset fails to apply to the compass).
  3. (For Minecraft versions with data version < 3819) The chunk can be pasted successfully, and any offset successes to apply to the compass.

I suppose that the fix in #487 is not proper and causes this problem.

To Reproduce
You can try the following steps in different versions of Minecraft as mentioned above, and see the difference.

  1. Place a lodestone and a container in the same chunk.
  2. Get a compass and right click on the loadstone to make the compass point to it.
  3. Put the compass in the container.
  4. Save the world and exit.
  5. Paste or import the chunk to somewhere.

Expected behavior
The chunk should be pasted. And if pasted with an offset, the offset should be applied to the compass.

Environment (please complete the following information):

  • OS: Windows 11
  • Version of MCA Selector: 2.4.2

Additional context
Here is the debug log of a world of Minecraft 1.21:

12:10:59.027 [main] WARN Config: failed to load overlay config
java.lang.NullPointerException: null
at java.util.Objects.requireNonNull(Objects.java:233) ~[?:?]
at java.util.Arrays$ArrayList.(Arrays.java:4238) ~[?:?]
at java.util.Arrays.asList(Arrays.java:4223) ~[?:?]
at net.querz.mcaselector.config.OverlayConfig.load(OverlayConfig.java:48) ~[mcaselector-2.4.2.jar:?]
at net.querz.mcaselector.config.ConfigProvider.loadOverlayConfig(ConfigProvider.java:39) ~[mcaselector-2.4.2.jar:?]
at net.querz.mcaselector.Main.main(Main.java:40) ~[mcaselector-2.4.2.jar:?]
12:11:31.648 [processPool-thread-1] WARN ChunkImporter: failed to process chunk import for r.0.0.mca
java.lang.NullPointerException: Cannot invoke "net.querz.nbt.CompoundTag.getIntArrayTag(String)" because "lodestoneTarget" is null
at net.querz.mcaselector.version.anvil121.Anvil121ChunkRelocator.applyOffsetToItem(Anvil121ChunkRelocator.java:193) ~[mcaselector-2.4.2.jar:?]
at net.querz.mcaselector.version.anvil121.Anvil121ChunkRelocator.lambda$applyOffsetToTileEntity$6(Anvil121ChunkRelocator.java:175) ~[mcaselector-2.4.2.jar:?]
at java.lang.Iterable.forEach(Iterable.java:75) ~[?:?]
at net.querz.mcaselector.version.anvil121.Anvil121ChunkRelocator.applyOffsetToTileEntity(Anvil121ChunkRelocator.java:175) ~[mcaselector-2.4.2.jar:?]
at net.querz.mcaselector.version.anvil121.Anvil121ChunkRelocator.lambda$relocate$0(Anvil121ChunkRelocator.java:23) ~[mcaselector-2.4.2.jar:?]
at java.lang.Iterable.forEach(Iterable.java:75) ~[?:?]
at net.querz.mcaselector.version.anvil121.Anvil121ChunkRelocator.relocate(Anvil121ChunkRelocator.java:23) ~[mcaselector-2.4.2.jar:?]
at net.querz.mcaselector.io.mca.RegionChunk.relocate(RegionChunk.java:23) ~[mcaselector-2.4.2.jar:?]
at net.querz.mcaselector.io.mca.MCAFile.mergeChunksInto(MCAFile.java:450) ~[mcaselector-2.4.2.jar:?]
at net.querz.mcaselector.io.mca.RegionMCAFile.mergeChunksInto(RegionMCAFile.java:37) ~[mcaselector-2.4.2.jar:?]
at net.querz.mcaselector.io.job.ChunkImporter$MCAChunkImporterProcessJob.execute(ChunkImporter.java:358) ~[mcaselector-2.4.2.jar:?]
at net.querz.mcaselector.io.job.ProcessDataJob.run(ProcessDataJob.java:81) ~[mcaselector-2.4.2.jar:?]
at net.querz.mcaselector.io.JobHandler$WrapperJob.run(JobHandler.java:231) ~[mcaselector-2.4.2.jar:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
at java.lang.Thread.run(Thread.java:1583) ~[?:?]
12:11:42.538 [processPool-thread-1] WARN ChunkImporter: failed to process chunk import for r.0.-1.mca
java.lang.NullPointerException: Cannot invoke "net.querz.nbt.CompoundTag.getIntArrayTag(String)" because "lodestoneTarget" is null
at net.querz.mcaselector.version.anvil121.Anvil121ChunkRelocator.applyOffsetToItem(Anvil121ChunkRelocator.java:193) ~[mcaselector-2.4.2.jar:?]
at net.querz.mcaselector.version.anvil121.Anvil121ChunkRelocator.lambda$applyOffsetToTileEntity$6(Anvil121ChunkRelocator.java:175) ~[mcaselector-2.4.2.jar:?]
at java.lang.Iterable.forEach(Iterable.java:75) ~[?:?]
at net.querz.mcaselector.version.anvil121.Anvil121ChunkRelocator.applyOffsetToTileEntity(Anvil121ChunkRelocator.java:175) ~[mcaselector-2.4.2.jar:?]
at net.querz.mcaselector.version.anvil121.Anvil121ChunkRelocator.lambda$relocate$0(Anvil121ChunkRelocator.java:23) ~[mcaselector-2.4.2.jar:?]
at java.lang.Iterable.forEach(Iterable.java:75) ~[?:?]
at net.querz.mcaselector.version.anvil121.Anvil121ChunkRelocator.relocate(Anvil121ChunkRelocator.java:23) ~[mcaselector-2.4.2.jar:?]
at net.querz.mcaselector.io.mca.RegionChunk.relocate(RegionChunk.java:23) ~[mcaselector-2.4.2.jar:?]
at net.querz.mcaselector.io.mca.MCAFile.mergeChunksInto(MCAFile.java:450) ~[mcaselector-2.4.2.jar:?]
at net.querz.mcaselector.io.mca.RegionMCAFile.mergeChunksInto(RegionMCAFile.java:37) ~[mcaselector-2.4.2.jar:?]
at net.querz.mcaselector.io.job.ChunkImporter$MCAChunkImporterProcessJob.execute(ChunkImporter.java:358) ~[mcaselector-2.4.2.jar:?]
at net.querz.mcaselector.io.job.ProcessDataJob.run(ProcessDataJob.java:81) ~[mcaselector-2.4.2.jar:?]
at net.querz.mcaselector.io.JobHandler$WrapperJob.run(JobHandler.java:231) ~[mcaselector-2.4.2.jar:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
at java.lang.Thread.run(Thread.java:1583) ~[?:?]

Nervonment added a commit to Nervonment/mcaselector that referenced this issue Dec 3, 2024
@yqs112358
Copy link

Same issue 🫠

@yqs112358
Copy link

This PR #509 actually fixed my bug of failure chunk import. I have tested on my personal building map.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants