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:
parent
a6b810e140
commit
f64af66f09
4
pom.xml
4
pom.xml
@ -3,7 +3,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>org.maxgamer</groupId>
|
<groupId>org.maxgamer</groupId>
|
||||||
<artifactId>QuickShop</artifactId>
|
<artifactId>QuickShop</artifactId>
|
||||||
<version>1.6.3.1</version>
|
<version>1.6.3.2</version>
|
||||||
<description>快捷商店重置版本...</description>
|
<description>快捷商店重置版本...</description>
|
||||||
<build>
|
<build>
|
||||||
<finalName>${project.name}</finalName>
|
<finalName>${project.name}</finalName>
|
||||||
@ -54,7 +54,7 @@
|
|||||||
</build>
|
</build>
|
||||||
<properties>
|
<properties>
|
||||||
<jenkins.url>http://ci.citycraft.cn:8080</jenkins.url>
|
<jenkins.url>http://ci.citycraft.cn:8080</jenkins.url>
|
||||||
<update.description>&4修复下载问题 &a修改扫描流程 &c发现非法物品后扫描玩家背包...</update.description>
|
<update.description>&a修改扫描流程 &c修复设置玩家命令错误...</update.description>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
</properties>
|
</properties>
|
||||||
<repositories>
|
<repositories>
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package org.maxgamer.QuickShop.Command;
|
package org.maxgamer.QuickShop.Command;
|
||||||
|
|
||||||
import org.bukkit.OfflinePlayer;
|
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandException;
|
import org.bukkit.command.CommandException;
|
||||||
@ -19,27 +18,22 @@ public class CommandSetOwner extends BaseCommand {
|
|||||||
public CommandSetOwner(final QuickShop plugin) {
|
public CommandSetOwner(final QuickShop plugin) {
|
||||||
super("so");
|
super("so");
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
setPermission("quickshop.setowner");
|
|
||||||
setOnlyPlayerExecutable();
|
setOnlyPlayerExecutable();
|
||||||
|
setMinimumArguments(1);
|
||||||
|
setPermission("quickshop.setowner");
|
||||||
setDescription(MsgUtil.p("command.description.setowner"));
|
setDescription(MsgUtil.p("command.description.setowner"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(final CommandSender sender, final Command command, final String label, final String[] args) throws CommandException {
|
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);
|
final BlockIterator bIt = new BlockIterator((Player) sender, 10);
|
||||||
while (bIt.hasNext()) {
|
while (bIt.hasNext()) {
|
||||||
final Block b = bIt.next();
|
final Block b = bIt.next();
|
||||||
final Shop shop = plugin.getShopManager().getShop(b.getLocation());
|
final Shop shop = plugin.getShopManager().getShop(b.getLocation());
|
||||||
if (shop != null) {
|
if (shop != null) {
|
||||||
final OfflinePlayer p = this.plugin.getServer().getOfflinePlayer(args[1]);
|
shop.setOwner(args[0]);
|
||||||
shop.setOwner(p.getName());
|
|
||||||
shop.update();
|
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;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user