-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Reimplement ItemStack Obfuscation #11817
Open
Owen1212055
wants to merge
18
commits into
main
Choose a base branch
from
feat/component-obfuscation
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+521
−77
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Owen1212055
added
the
build-pr-jar
Enables a workflow to build Paperclip jars on the pull request.
label
Dec 25, 2024
(needs docs PR) |
This implementation has been dramatically simplified, and now supports dropping components. So for example, unbreaking is now hidden. |
lynxplay
force-pushed
the
feat/component-obfuscation
branch
2 times, most recently
from
January 3, 2025 19:29
96734a2
to
4dd11f8
Compare
lynxplay
approved these changes
Jan 4, 2025
Machine-Maker
approved these changes
Jan 4, 2025
This general principal is that there is no mutation of the patched map, only swapping of the valid values. Additional work will need to be done to support hiding enchantments whilst keeping the glint, as we either have to append an enchantment, or need to add a glint override.. which kinda defeats the purpose above. Cant add a vanilla enchantment because those can be removed! Further investigation needed.
lynxplay
force-pushed
the
feat/component-obfuscation
branch
from
January 7, 2025 20:25
16dbb25
to
99aedfe
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
build-pr-jar
Enables a workflow to build Paperclip jars on the pull request.
type: feature
Request for a new Feature.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Due to the amount of changes to items in the past updates, the previous configuration for obfuscation does not really fit today's representation of items.
This reimplements ItemStack obfuscation in a way that is built in mind to support the new 1.21.4 ItemModel format.
The following data components are obfuscated by default when enabled:
Unlike before, obfuscation for data components can now be configured on a per item model basis. So for example, items with the elytra item model will not obfuscate their damage component in order for their item model to properly read the damage value.
Default Obfuscation Behavior
Patched data component values are either DROPPED or SANITIZED.
Most values are dropped, unless certain behavior restricts them from being just dropped.
Dropping (standard)
Dropping occurs when the type can be freely removed from the item without any visual/behavioral changes.
Examples:
diamond_sword[max_damage=10]
->diamond_sword
dirt[max_damage=10]
->dirt
Sanitizing
Certain components have serious behavior changes when dropped. So these types are instead mutated.
For example:
minecraft:diamond_sword[enchantments={levels:{"minecraft:sharpness":1, "minecraft:unbreaking":1}}]
->minecraft:diamond_sword[enchantments={levels:{"minecraft:frost_walker":1}}]
(when configured)
minecraft:compass[lodestone_tracker={target: {dimension: "minecraft:overworld", pos: [I; 117, 160, -518]}}]
->minecraft:compass[lodestone_tracker={tracked: 0b}]
Tradeoff
The issue with this new system is that new types cannot be added, only removed/mutated.
Finally
Please provide any feedback on this new system, as this is a bit different and want to make sure that it is the best for people migrating from the old system. And additionally which new components people would like obfuscated by default.😄
Download the paperclip jar for this pull request: paper-11817.zip