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

[AntiBuild] Fix ender crystal breaking on 1.8 #6009

Open
wants to merge 1 commit into
base: 2.x
Choose a base branch
from

Conversation

JRoy
Copy link
Member

@JRoy JRoy commented Jan 13, 2025

Ugly fix but it works for now...

Fixes #4418

@JRoy JRoy added type: bugfix PRs that fix bugs in EssentialsX. module: antibuild Issues or PRs for the EssentialsAntiBuild module labels Jan 13, 2025
} else {
return;
}

if (prot.getSettingBool(AntiBuildConfig.disable_build) && !user.canBuild() && !user.isAuthorized("essentials.build") && !metaPermCheck(user, "break", type)) {
final boolean permCheck = type == null ? user.isAuthorized("essentials.build.break.END_CRYSTAL") : metaPermCheck(user, "break", type);
Copy link
Member

Choose a reason for hiding this comment

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

Relying on type being null feels iffy to me? Probably not an issue since the if/else above returns for any other entity though.

This also now performs the break perm check before the other perm checks and potentially after they've failed. Could maybe wrap in a lambda to avoid the early call?

@mdcfe mdcfe added this to the 2.21.0 milestone Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: antibuild Issues or PRs for the EssentialsAntiBuild module type: bugfix PRs that fix bugs in EssentialsX.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Essentials AntiBuild doesn't protect against player destruction of Ender Crystals
2 participants