Small refactor

This commit is contained in:
Shevchik 2013-09-03 21:35:54 +04:00
parent 4d9ae43d0c
commit b88af8e96f
2 changed files with 3 additions and 2 deletions

View File

@ -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.