Skip to content

Port network to 26.1x#2598

Open
a6tumn wants to merge 3 commits into
TeamTwilight:26.1.xfrom
a6tumn:26.1.x
Open

Port network to 26.1x#2598
a6tumn wants to merge 3 commits into
TeamTwilight:26.1.xfrom
a6tumn:26.1.x

Conversation

@a6tumn

@a6tumn a6tumn commented May 8, 2026

Copy link
Copy Markdown

I updated the files under the network package to remove all of the compiler errors. I've left comments in areas where I am uncertain about actual behavior or where more work will need to be done in other parts of the mod. I would be happy to work on any edits here if requested or on updating other parts of the mod if it would be helpful. I have marked this PR as a draft due to the fact that the accuracy of a few of these changes somewhat depends on the rest of the mod being updated and tested in-game.

Here is a summary of the changes:

  • Removed unused imports across the package
  • Switched to playSound instead of playSoundSource
  • Added a possible implementation of the game rule enforcement handler as the previous method is no longer applicable
  • Added a possible implementation of the map data handler as the previous method is no longer applicable
  • Refactored ParticlePacket and QueuedParticle to reflect an addition parameter in addParticle
  • Added a getItem call in SpawnCharmPacket and unwrapped the optional sound event
  • Added a possible implementation of getting the block color in SpawnFallenLeafFromPacket
  • Removed inapplicable logic from StructureProtectionPacket, dimension effects in general will need a refactor

mapdata.conqueredStructures.addAll(message.conqueredStructures());

mapitemrenderer.update(message.inner.mapId(), mapdata);
ctx.enqueueWork(() -> {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just so you know, this was an anon class instead of a lambda to avoid client side class getting classloaded on the server side. I'm not 100% sure that's still going to be the case but in case you were wondering about it here.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks, I was a bit confused about why that was there. I understand Minecraft modding can get a bit hacky at times so I added it back.

@a6tumn a6tumn changed the title Updated network package to at least have no compiler errors Port network to 26.1x Jun 9, 2026
@a6tumn

a6tumn commented Jun 9, 2026

Copy link
Copy Markdown
Author

Going to mark this one as ready for review as well as I don't see any more changes being made without feedback. Will definitely revisit the StructureProtectionPacket once the dimension effects have been ported.

@a6tumn a6tumn marked this pull request as ready for review June 9, 2026 03:50
mapdata.conqueredStructures.addAll(message.conqueredStructures());

mapitemrenderer.update(message.inner.mapId(), mapdata);
// This may or may not be equivalent to updating the renderer directly, will need testing to verify

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

How so? I inspected ClientboundMapItemDataPacket and that also calls addClientSideDecorations. Is that also not safe?

@a6tumn a6tumn Jun 18, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

It's probably fine. This was the first mod I have updated which had custom maps so I am not very familiar with the system. If Mojang is doing the same thing that is reassuring. If there is any trouble with it I suppose we will be able to tell what changed through Git diffs.

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 this pull request may close these issues.

3 participants