Don't pass the plugin.

This commit is contained in:
GJ 2013-02-12 11:44:29 -05:00
parent 5d693c5d8f
commit 51493fab48
2 changed files with 4 additions and 9 deletions

View File

@ -290,7 +290,7 @@ public class mcMMO extends JavaPlugin {
CommandRegistrationHelper.registerAdminChatCommand(); CommandRegistrationHelper.registerAdminChatCommand();
CommandRegistrationHelper.registerPartyCommand(); CommandRegistrationHelper.registerPartyCommand();
CommandRegistrationHelper.registerPartyChatCommand(); CommandRegistrationHelper.registerPartyChatCommand();
getCommand("ptp").setExecutor(new PtpCommand(this)); getCommand("ptp").setExecutor(new PtpCommand());
// Other commands // Other commands
CommandRegistrationHelper.registerAddxpCommand(); CommandRegistrationHelper.registerAddxpCommand();

View File

@ -18,14 +18,9 @@ import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.Users; import com.gmail.nossr50.util.Users;
public class PtpCommand implements CommandExecutor { public class PtpCommand implements CommandExecutor {
private final mcMMO plugin;
private Player player; private Player player;
private McMMOPlayer mcMMOPlayer; private McMMOPlayer mcMMOPlayer;
public PtpCommand(mcMMO instance) {
this.plugin = instance;
}
@Override @Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
String usage = LocaleLoader.getString("Commands.Usage.1", "ptp", "<" + LocaleLoader.getString("Commands.Usage.Player") + ">"); String usage = LocaleLoader.getString("Commands.Usage.1", "ptp", "<" + LocaleLoader.getString("Commands.Usage.Player") + ">");
@ -71,7 +66,7 @@ public class PtpCommand implements CommandExecutor {
} }
private boolean sendTeleportRequest(String args) { private boolean sendTeleportRequest(String args) {
Player target = plugin.getServer().getPlayer(args); Player target = mcMMO.p.getServer().getPlayer(args);
if (player.equals(target)) { if (player.equals(target)) {
player.sendMessage(LocaleLoader.getString("Party.Teleport.Self")); player.sendMessage(LocaleLoader.getString("Party.Teleport.Self"));
@ -98,7 +93,7 @@ public class PtpCommand implements CommandExecutor {
if (!targetMcMMOPlayer.getPtpConfirmRequired()) { if (!targetMcMMOPlayer.getPtpConfirmRequired()) {
McMMOPartyTeleportEvent event = new McMMOPartyTeleportEvent(player, target, mcMMOPlayer.getParty().getName()); McMMOPartyTeleportEvent event = new McMMOPartyTeleportEvent(player, target, mcMMOPlayer.getParty().getName());
plugin.getServer().getPluginManager().callEvent(event); mcMMO.p.getServer().getPluginManager().callEvent(event);
if (event.isCancelled()) { if (event.isCancelled()) {
return true; return true;
@ -168,7 +163,7 @@ public class PtpCommand implements CommandExecutor {
} }
McMMOPartyTeleportEvent event = new McMMOPartyTeleportEvent(target, player, mcMMOPlayer.getParty().getName()); McMMOPartyTeleportEvent event = new McMMOPartyTeleportEvent(target, player, mcMMOPlayer.getParty().getName());
plugin.getServer().getPluginManager().callEvent(event); mcMMO.p.getServer().getPluginManager().callEvent(event);
if (event.isCancelled()) { if (event.isCancelled()) {
return true; return true;