Skip to content

1.21.11 by Sheepy-9#114

Merged
Gjum merged 25 commits intoCivPlatform:mainfrom
Sheepy-9:1.21.11
Mar 7, 2026
Merged

1.21.11 by Sheepy-9#114
Gjum merged 25 commits intoCivPlatform:mainfrom
Sheepy-9:1.21.11

Conversation

@Gjum
Copy link
Member

@Gjum Gjum commented Mar 7, 2026

No description provided.

Protonull and others added 25 commits October 16, 2024 07:15
This is required by Architectury Loom 1.7+
There are some *changes* changes, such as the removal of the "handleBlockBreakAck" packet handler as the packet no longer contains the block position. It probably doesn't matter though as block updates should be handled by the other packets.

Another thing is the TODO now in the Cartography class as I am not certain that the behaviour is the same. May need some testing.

Also removed the "xaeros-minimap" dependency as it's not used.

There's a problem with the Forge client that I haven't been able to fix. It errors saying that the same package is being exported: "Modules MapSync.dev and generated_a20f2c1 export package gjum.minecraft.mapsync.common.data to module mixin.synthetic". No idea how to fix. Tempted to just switch to NeoForge.
- Packet size 2^15 -> 2^20 / 21 (~1MB)

WORKING with VoxelMap
Updated README to include new features and clarify usage instructions.

/** prevent Out of Memory when client sends a large packet */
maxFrameSize = 2 ** 15;
maxFrameSize = 2 ** 21;
Copy link
Member Author

Choose a reason for hiding this comment

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

does this match the packet field? it used to be a 16 integer, not sure what it is now

Copy link
Contributor

Choose a reason for hiding this comment

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

Received packets were too big and I had a reasoning for them not to match that I don't remember, so it probably should be changed by someone with more knowledge about networking

Copy link
Contributor

Choose a reason for hiding this comment

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

While it may be somewhat outside the scope of a 1.21.11 update, it's something I aimed to fix with #110

"format": "prettier -w .",
"test": "true",
"start": "node -r source-map-support/register dist/main.js",
"start": "node --security-revert=CVE-2023-46809 -r source-map-support/register dist/main.js",
Copy link
Member Author

Choose a reason for hiding this comment

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

could you add a comment why this is necessary?
https://www.cve.news/cve-2023-46809/

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this is also highly dependent on the version of nodejs: iirc newer versions of nodejs will not revert this regardless of setting. This PR does update what versions of node the CI and docker uses, there's no engine restriction within this package.json itself for those who just clone and run.

Copy link
Contributor

Choose a reason for hiding this comment

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

It was a quick fix-up in the beginning and got left in due to lack of networking skills

@Gjum Gjum merged commit d45cfed into CivPlatform:main Mar 7, 2026
0 of 3 checks passed
@Gjum Gjum mentioned this pull request Mar 7, 2026
This was referenced Mar 7, 2026
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't add IDE-specific settings files

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, I've been learning how to use git for quite a while now, but I still have fights with it

Copy link
Contributor

Choose a reason for hiding this comment

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

I recommend using https://gitignore.io/ to create a gitignore file for your operating system and preferred IDEs, then setting this file as your global gitignore: https://git-scm.com/docs/git-config#Documentation/git-config.txt-coreexcludesFile

@Protonull
Copy link
Contributor

Many of the changes here also introduce changes to indentation. Maybe add an .editorconfig file?

Comment on lines 8 to +29
public static boolean isJourneyMapNotAvailable;

static {
try {
Class.forName("journeymap.client.JourneymapClient");
Class<?> jmClient = Class.forName("journeymap.client.JourneymapClient");
String version = null;
try {
// check it's a recent version
Class.forName("journeymap.client.model.NBTChunkMD");
isJourneyMapNotAvailable = false;
} catch (NoClassDefFoundError | ClassNotFoundException ignored2) {
isJourneyMapNotAvailable = true;
System.err.println("Please update JourneyMap to at least 5.8.3");
}
// Try to get a version field or method
try {
version = (String) jmClient.getDeclaredField("FULL_VERSION").get(null);
} catch (NoSuchFieldException e) { }
} catch (Exception ignored) {}

if (version != null) {
// Compare version strings as needed, e.g., "6.0.0"
if (!Pattern.compile("6\\.\\d+\\.\\d+").matcher(version).find()) {
isJourneyMapNotAvailable = true;
System.err.println("Please update JourneyMap to at least 6.0.0 (found " + version + ")");
} else {
isJourneyMapNotAvailable = false;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be replaced with a call to the modloader to check if journeymap is loaded: the class check for NBTChunkMD seems to be because it was a new class in a new version. That was on 1.18.2. Now this is 1.21.11. Such a check is no longer necessary.


static {
try {
// TODO: update when found needed
Copy link
Contributor

Choose a reason for hiding this comment

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

huh?

Copy link
Contributor

Choose a reason for hiding this comment

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

This was a self note
Forgot to delete after figuring out how to find the right class

ch.pipeline().addLast(
new LengthFieldPrepender(4),
new LengthFieldBasedFrameDecoder(1 << 15, 0, 4, 0, 4),
new LengthFieldBasedFrameDecoder(1 << 20, 0, 4, 0, 4),
Copy link
Contributor

@Protonull Protonull Mar 7, 2026

Choose a reason for hiding this comment

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

You've set the frame size here to be 2^20, but in server.ts it's now 2^21.

InputConstants.Type.KEYSYM,
GLFW.GLFW_KEY_COMMA,
"category.map-sync"
CATEGORY
Copy link
Contributor

Choose a reason for hiding this comment

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

You'll need to update the lang file. I made the same mistake: https://codeberg.org/netherwart/CivianMods/commit/56aa0e8adc520264428f3a5a79ba073ef9c97fd2

runtimeClasspath.extendsFrom common
developmentForge.extendsFrom common

// Weird fix: https://discord.com/channels/792699517631594506/792701725106634783/1272848116864909314
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this still necessary?

world: pkt.world,
chunk_x: req.chunkX,
chunk_z: req.chunkX,
chunk_z: req.chunkZ,
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice catch

Copy link
Contributor

@Sheepy-9 Sheepy-9 Mar 8, 2026

Choose a reason for hiding this comment

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

Caused the whole sync to sync every chunk into a diagonal line hehe

Copy link
Contributor

Choose a reason for hiding this comment

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

Not against anyone using pnpm, but now there are two lockfiles (yarn.lock and pnpm-lock.yaml), which is bad.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd support switching to pnpm fully. (Or to bun ...)

Copy link
Contributor

@Protonull Protonull Mar 7, 2026

Choose a reason for hiding this comment

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

Bun would be preferable, but Bun has also completely rejects that CVE revert: you'd need to switch to a different encryption algorithm or bite the bullet and switch to websockets :P (see: #106)

Copy link
Contributor

Choose a reason for hiding this comment

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

npm just straight up didn't work, so I tried pnpm
Haven't noticed that it got added to version control
At first I wasn't planning on submitting for a pull request, so sorry for it being a bit messy
Learning is a journey :)

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.

4 participants