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

A few *small* changes and a fix. #8

Open
wants to merge 2 commits into
base: 1.20.4
Choose a base branch
from

Conversation

Totobird-Creations
Copy link

@Totobird-Creations Totobird-Creations commented Nov 21, 2024

A few small changes and a fix (Definitely did not rewrite half of the mod). Here's what I did:


1.21

  • I switched the main branch over to 1.21.
  • Maintaining the 1.20.x branches is as simple as swapping the two uses of PlainTextContent.Literal in the CombinedFilter class with LiteralTextContent. Everything else is compatible.

Translation Key Source is Now Considered

  • Translation keys from vanilla resource packs (vanilla and realms) are unfiltered.
  • Translation keys in server resource packs are now unfiltered (and collision-safe). When resources reload, MDP will now collect all keys from server resource packs, as well as their values. When the server requests one, MDP will send back what the server sent in the pack, even if a different local (non-server) pack overrides it.
  • Modded translations and translations in local resource packs are still blocked.

Keybinds are Falsified

  • When a server uses this exploit to request a keybind, MDP will send back the factory setting key of the keybind. For example, if the server requests the key.sprint key, the player can have R as their sprint key, but MDP will respond with Left Control (localised).
  • This only applies to vanilla keybinds. Non-vanilla keybinds are still blocked.
  • Since the server has access to the client language through SyncedClientOptions, sending a different language than the one the server thinks the client is supposed to have loaded could potentially be detected. Thus, I decided to not make translations send back the default en_us value like the keybinds do.

De-hardcoding

  • I removed the hardcoded vanilla keybinds list, and the vanilla keybinds gzip file. They are now automatically detected when the game starts, or when the resource pack reloads.

Logging Messages

  • When MDP allows, blocks, or falsifies a keybind/translation key, it will print a warning in chat. This could be useful for probing certain servers.
    image

Compatability

  • I replaced the @Redirects with @WrapOperations, from LlamaLad7's MixinExtras library. @Redirect may collide with other mods, while @WrapOperation will not collide with other mods. This library pretty much just comes with fabric.

I have tested this on a server which I know has a system which can detect the previous version of MDP. They did not detect any mods I have installed, and can not detect MDP by introducing their own translation keys.

Totobird added 2 commits November 20, 2024 19:43
…ng them entirely, hopefully making MDP completely undetectable. Keybind requests from the server now return the factory setting value. Log messages added.
@Totobird-Creations
Copy link
Author

Just pushed a commit which fixes a bug causing keybinds from certain mods (Freecam for example) to be classified as vanilla, and allowed to pass through.

@JustAlittleWolf
Copy link
Owner

Hello,
thanks for the pr! Unfortunately I don't have that much time at the moment, I won't be able to merge it soon.

About the project itself: I am no longer interested in maintaining this mod (because I don't want to be responsible for people getting into trouble for using it). This means, your change won't be put on modrinth or curseforge by me. However, I am open to someone taking over the project.

Cheers!

@xCheezie
Copy link

xCheezie commented Dec 9, 2024

I still have the ressource pack failed kick message in Cytooxien server

@1zun4
Copy link

1zun4 commented Dec 29, 2024

Hello, thanks for the pr! Unfortunately I don't have that much time at the moment, I won't be able to merge it soon.

About the project itself: I am no longer interested in maintaining this mod (because I don't want to be responsible for people getting into trouble for using it). This means, your change won't be put on modrinth or curseforge by me. However, I am open to someone taking over the project.

Cheers!

It would be great if someone would take over the project if you decide not to update it. The implementation from the PR looks good to me, except for the very strange @Totobird-Creations code style. 😅

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