mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-10-18 17:35:31 +02:00
New permission: essentials.sethome.bed
Players with this permission will force a bed home updating if daytime beds are enabled.
This commit is contained in:
parent
5c99eee0c0
commit
2d4a07b95b
@ -439,10 +439,13 @@ public class EssentialsPlayerListener implements Listener
|
|||||||
case RIGHT_CLICK_BLOCK:
|
case RIGHT_CLICK_BLOCK:
|
||||||
if (!event.isCancelled() && event.getClickedBlock().getTypeId() == BED && ess.getSettings().getUpdateBedAtDaytime())
|
if (!event.isCancelled() && event.getClickedBlock().getTypeId() == BED && ess.getSettings().getUpdateBedAtDaytime())
|
||||||
{
|
{
|
||||||
Player player = event.getPlayer();
|
User player = ess.getUser(event.getPlayer());
|
||||||
|
if (player.isAuthorized("essentials.sethome.bed"))
|
||||||
|
{
|
||||||
player.setBedSpawnLocation(event.getClickedBlock().getLocation());
|
player.setBedSpawnLocation(event.getClickedBlock().getLocation());
|
||||||
player.sendMessage(_("homeSet", player.getLocation().getWorld().getName(), player.getLocation().getBlockX(), player.getLocation().getBlockY(), player.getLocation().getBlockZ()));
|
player.sendMessage(_("homeSet", player.getLocation().getWorld().getName(), player.getLocation().getBlockX(), player.getLocation().getBlockY(), player.getLocation().getBlockZ()));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case LEFT_CLICK_AIR:
|
case LEFT_CLICK_AIR:
|
||||||
if (event.getPlayer().isFlying())
|
if (event.getPlayer().isFlying())
|
||||||
|
Loading…
Reference in New Issue
Block a user