Properly name methods

This commit is contained in:
Shevchik 2013-09-30 12:27:16 +04:00
parent 782af5a9da
commit 184ed22422
3 changed files with 10 additions and 10 deletions

View File

@ -147,7 +147,7 @@ public class Chairs extends JavaPlugin {
} }
},100); },100);
} }
protected void ejectPlayer(final Player player) protected void unSitPlayer(final Player player)
{ {
player.eject(); player.eject();
final Location tploc = sitstopteleportloc.get(player.getName()); final Location tploc = sitstopteleportloc.get(player.getName());
@ -161,14 +161,14 @@ public class Chairs extends JavaPlugin {
} }
},1); },1);
} }
unSit(player); clearSitInfo(player);
} }
private void ejectPlayerOnDisable(Player player) private void ejectPlayerOnDisable(Player player)
{ {
player.eject(); player.eject();
unSit(player); clearSitInfo(player);
} }
protected void unSit(Player player) { protected void clearSitInfo(Player player) {
if (sit.containsKey(player.getName())) if (sit.containsKey(player.getName()))
{ {
sit.get(player.getName()).remove(); sit.get(player.getName()).remove();

View File

@ -16,6 +16,7 @@ import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.event.player.PlayerTeleportEvent;
import org.bukkit.material.Stairs; import org.bukkit.material.Stairs;
import org.bukkit.material.Step; import org.bukkit.material.Step;
import org.bukkit.material.WoodenStep; import org.bukkit.material.WoodenStep;
@ -49,7 +50,7 @@ public class EventListener implements Listener {
if (plugin.sit.containsKey(player.getName())) if (plugin.sit.containsKey(player.getName()))
{ {
plugin.savePlayerSitstoploc(player.getName()); plugin.savePlayerSitstoploc(player.getName());
plugin.ejectPlayer(player); plugin.unSitPlayer(player);
} }
} }
@ -60,11 +61,10 @@ public class EventListener implements Listener {
if (plugin.sitblock.containsKey(b)) if (plugin.sitblock.containsKey(b))
{ {
Player player = Bukkit.getPlayerExact(plugin.sitblock.get(b)); Player player = Bukkit.getPlayerExact(plugin.sitblock.get(b));
plugin.ejectPlayer(player); plugin.unSitPlayer(player);
} }
} }
@EventHandler @EventHandler
public void onPlayerInteract(PlayerInteractEvent event) { public void onPlayerInteract(PlayerInteractEvent event) {
Player player = event.getPlayer(); Player player = event.getPlayer();
@ -309,7 +309,7 @@ public class EventListener implements Listener {
if (player.isInsideVehicle()) { if (player.isInsideVehicle()) {
return true; return true;
} else { } else {
plugin.unSit(player); plugin.clearSitInfo(player);
} }
} }
return false; return false;

View File

@ -41,7 +41,7 @@ public class PacketListener {
//just eject player if he is sitting on chair //just eject player if he is sitting on chair
if (pluginInstance.sit.containsKey(player.getName())) if (pluginInstance.sit.containsKey(player.getName()))
{ {
pluginInstance.ejectPlayer(player); pluginInstance.unSitPlayer(player);
} }
} }
} }
@ -68,7 +68,7 @@ public class PacketListener {
Player player = e.getPlayer(); Player player = e.getPlayer();
if (pluginInstance.sit.containsKey(player.getName())) if (pluginInstance.sit.containsKey(player.getName()))
{ {
pluginInstance.ejectPlayer(player); pluginInstance.unSitPlayer(player);
} }
} }
} }