diff --git a/pom.xml b/pom.xml
index d6d4d81..1ef29fd 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
4.0.0
org.maxgamer
QuickShop
- 1.6.3.1
+ 1.6.3.2
快捷商店重置版本...
${project.name}
@@ -54,7 +54,7 @@
http://ci.citycraft.cn:8080
- &4修复下载问题 &a修改扫描流程 &c发现非法物品后扫描玩家背包...
+ &a修改扫描流程 &c修复设置玩家命令错误...
UTF-8
diff --git a/src/main/java/org/maxgamer/QuickShop/Command/CommandSetOwner.java b/src/main/java/org/maxgamer/QuickShop/Command/CommandSetOwner.java
index 103e337..62f1789 100644
--- a/src/main/java/org/maxgamer/QuickShop/Command/CommandSetOwner.java
+++ b/src/main/java/org/maxgamer/QuickShop/Command/CommandSetOwner.java
@@ -1,6 +1,5 @@
package org.maxgamer.QuickShop.Command;
-import org.bukkit.OfflinePlayer;
import org.bukkit.block.Block;
import org.bukkit.command.Command;
import org.bukkit.command.CommandException;
@@ -19,27 +18,22 @@ public class CommandSetOwner extends BaseCommand {
public CommandSetOwner(final QuickShop plugin) {
super("so");
this.plugin = plugin;
- setPermission("quickshop.setowner");
setOnlyPlayerExecutable();
+ setMinimumArguments(1);
+ setPermission("quickshop.setowner");
setDescription(MsgUtil.p("command.description.setowner"));
}
- @SuppressWarnings("deprecation")
@Override
public void execute(final CommandSender sender, final Command command, final String label, final String[] args) throws CommandException {
- if (args.length < 2) {
- sender.sendMessage(MsgUtil.p("command.no-owner-given"));
- return;
- }
final BlockIterator bIt = new BlockIterator((Player) sender, 10);
while (bIt.hasNext()) {
final Block b = bIt.next();
final Shop shop = plugin.getShopManager().getShop(b.getLocation());
if (shop != null) {
- final OfflinePlayer p = this.plugin.getServer().getOfflinePlayer(args[1]);
- shop.setOwner(p.getName());
+ shop.setOwner(args[0]);
shop.update();
- sender.sendMessage(MsgUtil.p("command.new-owner", this.plugin.getServer().getOfflinePlayer(shop.getOwner()).getName()));
+ sender.sendMessage(MsgUtil.p("command.new-owner", args[0]));
return;
}
}