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

Spectators are not excluded #27

Open
OrangeCatUnderscore opened this issue Oct 11, 2024 · 1 comment
Open

Spectators are not excluded #27

OrangeCatUnderscore opened this issue Oct 11, 2024 · 1 comment

Comments

@OrangeCatUnderscore
Copy link

Spectators should be excluded, or at least have different logic. Currently, things that spectators can see get obscured when clipping through blocks underground. Maybe this could be a config option?

2024-10-10_23 35 22
2024-10-10_23 35 27

@stonar96
Copy link
Owner

stonar96 commented Oct 12, 2024

Currently existing solutions

Thank's for your suggestion. RayTraceAntiXray makes use of Paper's built-in Anti-Xray, which already has a bypass permission. Using a permission plugin like LuckPerms you can assign permissions to players based on their gamemode context.

However, this solution doesn't work if you want to switch dynamically between gamemodes while being in the world. In order for the changes to take effect, you would have to reload (i.e. refresh or resend) all chunks that the player has currently loaded after switching between gamemodes. (Note that the linked project is outdated and won't work anymore.)

What I could implement in RayTraceAntiXray

The thing is, in your use case, you don't actually care about blocks that aren't exposed to air, I guess? You only want to reveal the blocks that you can possibly see as spectator. Those are exactly the blocks that are ray traced by RayTraceAntiXray. I can add a bypass for those blocks by just treating them as "seen by the player".

However, I wouldn't implement the bypass based on the player's gamemode, but more general using a permission (similar to the Anti-Xray bypass permission) that you can enable in the config. You can then still bind it to a gamemode using a permission plugin as explained above.

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

No branches or pull requests

2 participants