1
0
mirror of https://e.coding.net/circlecloud/QuickShop.git synced 2024-11-22 01:58:54 +00:00

修复商店所有者设置错误...

Signed-off-by: 502647092 <jtb1@163.com>
This commit is contained in:
502647092 2015-12-06 22:19:57 +08:00
parent a6b810e140
commit f64af66f09
2 changed files with 6 additions and 12 deletions

View File

@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.maxgamer</groupId>
<artifactId>QuickShop</artifactId>
<version>1.6.3.1</version>
<version>1.6.3.2</version>
<description>快捷商店重置版本...</description>
<build>
<finalName>${project.name}</finalName>
@ -54,7 +54,7 @@
</build>
<properties>
<jenkins.url>http://ci.citycraft.cn:8080</jenkins.url>
<update.description>&amp;4修复下载问题 &amp;a修改扫描流程 &amp;c发现非法物品后扫描玩家背包...</update.description>
<update.description>&amp;a修改扫描流程 &amp;c修复设置玩家命令错误...</update.description>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>

View File

@ -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;
}
}