Fix dropped items looking like 1 item with item sanitation#12260
Fix dropped items looking like 1 item with item sanitation#12260Warriorrrr wants to merge 1 commit into
Conversation
|
Yeah so, this technically works. Has the consequence of causing ALL items to no longer have count "sanitized" (just converted like this), however. |
| if (GlobalConfiguration.get().anticheat.obfuscation.items.binding.getAssetObfuscation(itemStack).sanitizeCount()) { | ||
| return 1; | ||
| } else { | ||
| if (!GlobalConfiguration.get().anticheat.obfuscation.items.binding.getAssetObfuscation(itemStack).sanitizeCount() || count <= 1) { |
There was a problem hiding this comment.
Maybe first check count? Seems like a free performance gain for most equipment
There was a problem hiding this comment.
In reality, it most likely does not matter that much and honestly, branch prediction taking the wrong path might be worse.
There was a problem hiding this comment.
It's indeed not worth big discussion as the gain is minimal, so won't continue past this message explaining my thoughts. If someone could mark this as resolved would be glad
Since the check is already present, it makes sense to make the easy check first that already has all the data on stack instead of the pointer chasing through all the ram, especially since in current implementation the majority of items passing here will be from entiy equipment, which is mostly either 1 for unstackable items (armor) or 0 for empty slots, so since it's true it's not gonna even need to check the config
|
I wonder if it wouldn't be smarted to replace the codecs used by the entity data accessors that we actually want to sanitize and do the session starting there. |
|
I added a comment with additional info to #12252 (#12252 (comment)), so I don't think this entirely closes it anymore. |
|
That probably should've been in a separate issue, but I'll close this for now anyways |
Do you want me create a separate issue for it now? |
Closes #12252
This seems like the most readable approach to this, rather than cooking up some expression to do this in one line