Anchor changes #456

Merged
ferriarnus merged 9 commits from anchorchanges into dev/1.20.1 2023-08-19 23:14:18 +00:00
ferriarnus commented 2023-08-12 14:29:49 +00:00 (Migrated from github.com)

Description

Resets the client collection of targets when changing a dimension
Fix syncing of the name to the server/client

Closes #454

Todo

  • Verify this is all that is needed

Checklist:

  • My code follows the style guidelines of this project (.editorconfig, most IDEs will use this for you).
  • I have performed a self-review of my own code.
  • I have commented my code in areas it may be challenging to understand.
  • I have made corresponding changes to the documentation.
  • My changes are ready for review from a contributor.
# Description Resets the client collection of targets when changing a dimension Fix syncing of the name to the server/client Closes #454 <!-- Follow this exact pattern for every issue you've fixed to help GitHub automatically link your PR to the relevant issues --> <!-- Remove this section if you're submitting an already-complete PR --> # Todo - [ ] Verify this is all that is needed <!-- For drafts, fill this in as you go; if you are leaving draft, make sure these are all done --> # Checklist: - [ ] My code follows the style guidelines of this project (.editorconfig, most IDEs will use this for you). - [ ] I have performed a self-review of my own code. - [ ] I have commented my code in areas it may be challenging to understand. <!-- (Although we prefer code that is readable instead of over-commented) --> - [ ] I have made corresponding changes to the documentation. - [ ] My changes are ready for review from a contributor. <!-- Thanks to: https://embeddedartistry.com/blog/2017/08/04/a-github-pull-request-template-for-your-projects/ for the building blocks of this template -->
thedarkcolour (Migrated from github.com) reviewed 2023-08-12 20:16:33 +00:00
@ -28,23 +38,27 @@ public class TravelSavedData extends SavedData {
}
public TravelSavedData(CompoundTag nbt) {
thedarkcolour (Migrated from github.com) commented 2023-08-12 20:16:19 +00:00

Since the client can only be in one dimension at a time, it might be better to keep just one TravelSaveData instance and clear it every time the player changes dimensions.

Since the client can only be in one dimension at a time, it might be better to keep just one TravelSaveData instance and clear it every time the player changes dimensions.
ferriarnus (Migrated from github.com) reviewed 2023-08-12 20:19:33 +00:00
ferriarnus (Migrated from github.com) commented 2023-08-12 20:19:33 +00:00

If the block is actually removed on the server, this method should also be called on the client?

If the block is actually removed on the server, this method should also be called on the client?
ferriarnus (Migrated from github.com) reviewed 2023-08-12 20:22:31 +00:00
@ -28,23 +38,27 @@ public class TravelSavedData extends SavedData {
}
public TravelSavedData(CompoundTag nbt) {
ferriarnus (Migrated from github.com) commented 2023-08-12 20:22:31 +00:00

This was done due to me thinking that there is a case where an anchor could still be loaded in one dimension while the player is in the other. While then rejoining the level, the anchor would not be readded to the client list. I am however now wondering if this behaviour can happen, as the client might actually have 1 world where blocks exist, while all the others are removed. I will verify this.

This was done due to me thinking that there is a case where an anchor could still be loaded in one dimension while the player is in the other. While then rejoining the level, the anchor would not be readded to the client list. I am however now wondering if this behaviour can happen, as the client might actually have 1 world where blocks exist, while all the others are removed. I will verify this.
thedarkcolour (Migrated from github.com) reviewed 2023-08-12 20:33:58 +00:00
thedarkcolour (Migrated from github.com) commented 2023-08-12 20:33:58 +00:00

To test this, I built a nether portal at spawn chunks and placed a beacon beside it. I had one player stay in the overworld and the other would travel to the nether. #setRemoved was not called on the Beacon for my nether player when they entered the nether. It was also not called when my overworld player destroyed the beacon while the nether player was still in the nether, and it was not called when the nether player returned to the overworld.
EDIT: The same thing happens outside of spawn chunks too.

To test this, I built a nether portal at spawn chunks and placed a beacon beside it. I had one player stay in the overworld and the other would travel to the nether. #setRemoved was not called on the Beacon for my nether player when they entered the nether. It was also not called when my overworld player destroyed the beacon while the nether player was still in the nether, and it was not called when the nether player returned to the overworld. EDIT: The same thing happens outside of spawn chunks too.
ferriarnus (Migrated from github.com) reviewed 2023-08-12 20:50:37 +00:00
ferriarnus (Migrated from github.com) commented 2023-08-12 20:50:37 +00:00

Seems this is indeed the case, I didn't expect that. I converted it back to a draft and will see to remove these oddities.

Seems this is indeed the case, I didn't expect that. I converted it back to a draft and will see to remove these oddities.
ferriarnus (Migrated from github.com) reviewed 2023-08-12 21:55:04 +00:00
ferriarnus (Migrated from github.com) commented 2023-08-12 21:55:04 +00:00

Hmm, it is called in singleplayer when leaving the dimension. Servers seem to react a bit differently, but there is an oddity I first need to deal with.

Hmm, it is called in singleplayer when leaving the dimension. Servers seem to react a bit differently, but there is an oddity I first need to deal with.
Rover656 (Migrated from github.com) requested changes 2023-08-18 21:34:11 +00:00
Rover656 (Migrated from github.com) left a comment

Looks like this is almost there, just need to fix the block item rendering (see discord)

Looks like this is almost there, just need to fix the block item rendering (see discord)
Rover656 (Migrated from github.com) approved these changes 2023-08-19 22:42:50 +00:00
Rover656 (Migrated from github.com) left a comment

Looking good, thanks a lot to both Ferri and chonky :)

Looking good, thanks a lot to both Ferri and chonky :)
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Team-EnderIO/EnderIO#456
No description provided.