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

Attribute rework #1587

Merged
merged 11 commits into from
Aug 13, 2024
Merged

Attribute rework #1587

merged 11 commits into from
Aug 13, 2024

Conversation

SamB440
Copy link
Collaborator

@SamB440 SamB440 commented Jul 10, 2024

This rewrites the attribute system and also moves Grim towards using the attribute system more widely instead of manually checking client versions everywhere.

Attributes have a version requirement, if the player is below a version where that attribute exists then changes sent by the server will be ignored. They also have a get rewriter, this allows modification of the attribute value before being returned, which allows for contextual stuff like checking the player's version.

Fixes #1583

Tested on 1.20.6 and 1.21 server and clients with via.

Latest build: https://github.com/GrimAnticheat/Grim/actions/runs/10333304179/artifacts/1798102852

@Incluuu
Copy link

Incluuu commented Jul 10, 2024

I use new build of grimAC

client version: 1.20.4

edit: all clients below <1.20.4 do not work

image

@SamB440
Copy link
Collaborator Author

SamB440 commented Jul 10, 2024

It seems to be a packetevents issue, it is not reading itemstacks properly, getting the efficiency enchant is returning 0

@Miyli
Copy link

Miyli commented Jul 11, 2024

Trying this out, trident with riptide still gives false positives, depth strider and efficiency seem to work fine.

unknown_2024.07.11-17.29_clip_1.mp4
  • Simulation check when using a trident in the water
  • NoSlowA check when right clicking trident when on land

@SamB440
Copy link
Collaborator Author

SamB440 commented Jul 11, 2024

Read my comment above

}

public Optional<ValuedAttribute> getAttribute(Attribute attribute) {
if (attribute == null) return Optional.empty();
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We should warn once if this happens, that either there is a bug or they are running a modded server

@Dg32z
Copy link
Contributor

Dg32z commented Jul 15, 2024

https://paste.grim.ac/f441ex2
After the player dies, they will be unable to move

GrimAC: https://github.com/GrimAnticheat/Grim/actions/runs/9928479692/artifacts/1699378021
ServerVersion: Paper version 1.21-54-master@f250ec0

@SamB440
Copy link
Collaborator Author

SamB440 commented Jul 15, 2024

https://paste.grim.ac/f441ex2 After the player dies, they will be unable to move

GrimAC: https://github.com/GrimAnticheat/Grim/actions/runs/9928479692/artifacts/1699378021 ServerVersion: Paper version 1.21-54-master@f250ec0

Try the latest commit

@Dg32z
Copy link
Contributor

Dg32z commented Jul 15, 2024

https://paste.grim.ac/f441ex2 After the player dies, they will be unable to move
GrimAC: https://github.com/GrimAnticheat/Grim/actions/runs/9928479692/artifacts/1699378021 ServerVersion: Paper version 1.21-54-master@f250ec0

Try the latest commit

it working

@Dg32z
Copy link
Contributor

Dg32z commented Jul 15, 2024

riptide

movement after respawn may also cause false
https://paste.grim.ac/ug62u3c
QQ截图20240715231304

@Dg32z
Copy link
Contributor

Dg32z commented Jul 15, 2024

riptide

movement after respawn may also cause false https://paste.grim.ac/ug62u3c QQ截图20240715231304

This is probabilistic and only exists during the first movement upon respawn

@Anthony01M Anthony01M mentioned this pull request Jul 21, 2024
@SergioK29
Copy link

Is this ready for production? what other features need added?

@EarthCow
Copy link

EarthCow commented Jul 27, 2024

Still getting fastbreak false positives for players using lunar client on 1.21.

@CatBang
Copy link
Contributor

CatBang commented Jul 27, 2024

The "Soul_speed" Enchantment triggers false positives when walking on "soul_sand", but "soul_soil" seems not to trigger false positives.

@SamB440
Copy link
Collaborator Author

SamB440 commented Jul 27, 2024

Still getting fastbreak false positives for for players using lunar client on 1.21.

Lunar client is not vanilla

@EarthCow
Copy link

Still getting fastbreak false positives for for players using lunar client on 1.21.

Lunar client is not vanilla

I'm aware. I was simply reporting that, after testing on my server, players using lunar client will still get fastbreak falses. I fail to see how that isn't appropriate to mention on this PR as this PR should fix the issue for all clients and not just vanilla. It is never mentioned that this PR is only for vanilla clients.

@SamB440
Copy link
Collaborator Author

SamB440 commented Jul 27, 2024

If Lunar is falsing and vanilla is not, what is there to fix? That should be reported to the Lunar developers.

@Huge-mistake
Copy link

Hello, I found in version 1.21 that when the Helmet is enchanted with aqua_affinity, mining blocks underwater will trigger a false alarm.
Attribute rework" seems not to be completed yet, but I'm looking forward to having it fixed.
I've observed the comments that packetevents are not correctly reading itemstacks. I use the game client version 1.21, and I don't need compatibility with lower versions. Is there any solution available now to resolve this issue?

@SamB440
Copy link
Collaborator Author

SamB440 commented Aug 10, 2024

Hello, I found in version 1.21 that when the Helmet is enchanted with aqua_affinity, mining blocks underwater will trigger a false alarm. Attribute rework" seems not to be completed yet, but I'm looking forward to having it fixed. I've observed the comments that packetevents are not correctly reading itemstacks. I use the game client version 1.21, and I don't need compatibility with lower versions. Is there any solution available now to resolve this issue?

Please retry on the latest commit

@SamB440 SamB440 marked this pull request as ready for review August 10, 2024 16:30
@Huge-mistake
Copy link

Hello, I found in version 1.21 that when the Helmet is enchanted with aqua_affinity, mining blocks underwater will trigger a false alarm. Attribute rework" seems not to be completed yet, but I'm looking forward to having it fixed. I've observed the comments that packetevents are not correctly reading itemstacks. I use the game client version 1.21, and I don't need compatibility with lower versions. Is there any solution available now to resolve this issue?

Please retry on the latest commit

yes, Latest build version, has resolved the issues I am currently encountering.

@SamB440 SamB440 merged commit 5019dfb into 2.0 Aug 13, 2024
1 check passed
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.

Enchantments cause falses due to new 1.21 attributes and PacketEvents unable to read enchants
8 participants