From 184ed22422cce8f48d4dd0e974ad1495272361a2 Mon Sep 17 00:00:00 2001 From: Shevchik Date: Mon, 30 Sep 2013 12:27:16 +0400 Subject: [PATCH] Properly name methods --- src/com/cnaude/chairs/Chairs.java | 8 ++++---- src/com/cnaude/chairs/EventListener.java | 8 ++++---- src/com/cnaude/chairs/PacketListener.java | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/com/cnaude/chairs/Chairs.java b/src/com/cnaude/chairs/Chairs.java index 56a70ce..9a64b81 100644 --- a/src/com/cnaude/chairs/Chairs.java +++ b/src/com/cnaude/chairs/Chairs.java @@ -147,7 +147,7 @@ public class Chairs extends JavaPlugin { } },100); } - protected void ejectPlayer(final Player player) + protected void unSitPlayer(final Player player) { player.eject(); final Location tploc = sitstopteleportloc.get(player.getName()); @@ -161,14 +161,14 @@ public class Chairs extends JavaPlugin { } },1); } - unSit(player); + clearSitInfo(player); } private void ejectPlayerOnDisable(Player player) { player.eject(); - unSit(player); + clearSitInfo(player); } - protected void unSit(Player player) { + protected void clearSitInfo(Player player) { if (sit.containsKey(player.getName())) { sit.get(player.getName()).remove(); diff --git a/src/com/cnaude/chairs/EventListener.java b/src/com/cnaude/chairs/EventListener.java index ee83f79..878739d 100644 --- a/src/com/cnaude/chairs/EventListener.java +++ b/src/com/cnaude/chairs/EventListener.java @@ -16,6 +16,7 @@ import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerQuitEvent; +import org.bukkit.event.player.PlayerTeleportEvent; import org.bukkit.material.Stairs; import org.bukkit.material.Step; import org.bukkit.material.WoodenStep; @@ -49,7 +50,7 @@ public class EventListener implements Listener { if (plugin.sit.containsKey(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)) { Player player = Bukkit.getPlayerExact(plugin.sitblock.get(b)); - plugin.ejectPlayer(player); + plugin.unSitPlayer(player); } } - @EventHandler public void onPlayerInteract(PlayerInteractEvent event) { Player player = event.getPlayer(); @@ -309,7 +309,7 @@ public class EventListener implements Listener { if (player.isInsideVehicle()) { return true; } else { - plugin.unSit(player); + plugin.clearSitInfo(player); } } return false; diff --git a/src/com/cnaude/chairs/PacketListener.java b/src/com/cnaude/chairs/PacketListener.java index a44e34e..8c34102 100644 --- a/src/com/cnaude/chairs/PacketListener.java +++ b/src/com/cnaude/chairs/PacketListener.java @@ -41,7 +41,7 @@ public class PacketListener { //just eject player if he is sitting on chair if (pluginInstance.sit.containsKey(player.getName())) { - pluginInstance.ejectPlayer(player); + pluginInstance.unSitPlayer(player); } } } @@ -68,7 +68,7 @@ public class PacketListener { Player player = e.getPlayer(); if (pluginInstance.sit.containsKey(player.getName())) { - pluginInstance.ejectPlayer(player); + pluginInstance.unSitPlayer(player); } } }