Small refactor
This commit is contained in:
parent
4d9ae43d0c
commit
b88af8e96f
@ -105,7 +105,7 @@ public class EventListener implements Listener {
|
|||||||
if (sitAllowed(player, block))
|
if (sitAllowed(player, block))
|
||||||
{
|
{
|
||||||
Location sitLocation = getSitLocation(block, player.getLocation().getYaw());
|
Location sitLocation = getSitLocation(block, player.getLocation().getYaw());
|
||||||
sitPlayer(player, block, sitLocation);
|
sitPlayer(player, sitLocation);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -308,11 +308,12 @@ public class EventListener implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void sitPlayer(Player player, Block block, Location sitlocation)
|
private void sitPlayer(Player player, Location sitlocation)
|
||||||
{
|
{
|
||||||
if (plugin.notifyplayer && !plugin.msgSitting.isEmpty()) {
|
if (plugin.notifyplayer && !plugin.msgSitting.isEmpty()) {
|
||||||
player.sendMessage(plugin.msgSitting);
|
player.sendMessage(plugin.msgSitting);
|
||||||
}
|
}
|
||||||
|
Block block = sitlocation.getBlock();
|
||||||
plugin.sitstopteleportloc.put(player.getName(), player.getLocation());
|
plugin.sitstopteleportloc.put(player.getName(), player.getLocation());
|
||||||
player.teleport(sitlocation);
|
player.teleport(sitlocation);
|
||||||
player.setSneaking(false);
|
player.setSneaking(false);
|
||||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user