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

Fix colony map #10171

Merged
merged 6 commits into from
Oct 23, 2024
Merged

Fix colony map #10171

merged 6 commits into from
Oct 23, 2024

Conversation

Nightenom
Copy link
Member

@Nightenom Nightenom commented Aug 26, 2024

Changes proposed in this pull request:

  • fixes nbt checking for filled maps (1.21 only)
  • reworks how colony map works internally regarding mapData (background map texture) - fixes various weird issues with zooming (no more jumpy) or items outside zoomdrag component
  • actual changes: allow map of any scale (not just "normal" zero), center at player on open
    (will port after merging)

[x] Yes I tested this before submitting it.
[ ] I also did a multiplayer test.

Review please


public record MapEntry(MapId mapId, MapItemSavedData mapData)
{
public static final StreamCodec<RegistryFriendlyByteBuf, MapEntry> STREAM_CODEC =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need a custom codec for vanilla maps? shouldnt we be able to use the vanilla codec for them?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the first is item dataComp and has both codecs, the second is level savedData which doesnt have any codec

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then I dont see why we dont simply sent the int and nbt via buffer?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because in first comment you want to me to use vanilla codec? (for mapid)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we just do:
buf.writeNbt(data.save(new CompoundTag(), buf.registryAccess()))

  • Use the mapId codec from vanilla?

I think that was what Sam meant

@Nightenom Nightenom added the 1.21 label Aug 28, 2024
@@ -2485,7 +2485,7 @@
"com.minecolonies.coremod.gui.townhall.stats.items_delivered": "Delivered Items: %d",
"com.minecolonies.coremod.gui.townhall.stats.food_served": "Served Food: %d",
"com.minecolonies.coremod.gui.townHall.map": "Town Map",
"com.minecolonies.coremod.townhall.map.warning": "Drop-off a normal scale Minecraft map in the Town Hall inventory first to unlock the map.",
"com.minecolonies.coremod.townhall.map.warning": "Drop-off a Minecraft map(s) in the Town Hall inventory first to unlock the map.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to make sure they only drop the small ones off, not the big ones

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read the PR doc :D

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, but that was gameplay intentional to have maps only of a fixed size in there =D

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reminder

@Nightenom Nightenom linked an issue Sep 30, 2024 that may be closed by this pull request
5 tasks
@@ -2485,8 +2485,6 @@
"com.minecolonies.coremod.gui.interval.lastweek": "Last Week",
"com.minecolonies.coremod.gui.interval.100days": "Last 100 Days",
"com.minecolonies.coremod.gui.interval.alltime": "All Time",
"com.minecolonies.coremod.gui.townhall.stats.items_delivered": "Delivered Items: %d",
"com.minecolonies.coremod.gui.townhall.stats.food_served": "Served Food: %d",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

Copy link
Member Author

@Nightenom Nightenom Oct 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dupe keys same values, see few lines above

@Raycoms Raycoms merged commit 1d437d3 into version/1.21 Oct 23, 2024
5 checks passed
@Raycoms Raycoms deleted the fix/colony-map branch October 23, 2024 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Townmap will only display the last map in inventory
3 participants