-
-
Notifications
You must be signed in to change notification settings - Fork 1k
fix: essentials.home.bed & essentials.sethome.bed permissions #5991
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -823,12 +823,15 @@ public void onPlayerInteract(final PlayerInteractEvent event) { | |
| break; | ||
| } | ||
| final User player = ess.getUser(event.getPlayer()); | ||
| if (player.isAuthorized("essentials.sethome.bed") && player.getWorld().getEnvironment().equals(World.Environment.NORMAL)) { | ||
| final boolean isAuthorized = player.isAuthorized("essentials.sethome.bed"); | ||
| if (isAuthorized && player.getWorld().getEnvironment().equals(World.Environment.NORMAL)) { | ||
| player.getBase().setBedSpawnLocation(event.getClickedBlock().getLocation()); | ||
| // In 1.15 and above, vanilla sends its own bed spawn message. | ||
| if (VersionUtil.getServerBukkitVersion().isLowerThan(VersionUtil.v1_15_R01)) { | ||
| player.sendTl("bedSet", player.getLocation().getWorld().getName(), player.getLocation().getBlockX(), player.getLocation().getBlockY(), player.getLocation().getBlockZ()); | ||
| } | ||
| } else if (!isAuthorized) { | ||
| event.setCancelled(true); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This prevents people interacting with the bed. Why was this changed?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was because if someone interact with a bed, they automatically set the bed home even if they don't have the permission |
||
| } | ||
| } | ||
| break; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.