9
0
mirror of https://github.com/Xiao-MoMi/Custom-Fishing.git synced 2025-12-29 11:59:11 +00:00
This commit is contained in:
Xiao-MoMi
2022-08-04 14:00:20 +08:00
parent d40806514b
commit 744067b686
17 changed files with 369 additions and 198 deletions

View File

@@ -6,6 +6,7 @@ import net.momirealms.customfishing.item.Bait;
import net.momirealms.customfishing.item.Loot;
import net.momirealms.customfishing.item.Rod;
import net.momirealms.customfishing.item.Util;
import net.momirealms.customfishing.utils.SaveItem;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
@@ -18,17 +19,17 @@ public class Execute implements CommandExecutor {
@Override
@ParametersAreNonnullByDefault
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
//没有权限的快走啦
if (!(sender.hasPermission("customfishing.admin") || sender.isOp())) {
AdventureManager.playerMessage((Player) sender,ConfigReader.Message.prefix + ConfigReader.Message.noPerm);
return true;
}
//参数打不全的赶紧走开
if (args.length < 1){
lackArgs(sender);
return true;
}
//重载命令
if (args[0].equalsIgnoreCase("reload")) {
ConfigReader.Reload();
if (sender instanceof Player){
@@ -38,7 +39,18 @@ public class Execute implements CommandExecutor {
}
return true;
}
//获取物品命令
if (args[0].equalsIgnoreCase("export")) {
if (args.length < 2){
lackArgs(sender);
return true;
}
if (sender instanceof Player player){
SaveItem.saveToFile(player.getInventory().getItemInMainHand(), args[1]);
}
return true;
}
if (args[0].equalsIgnoreCase("items")) {
if (args.length < 4){
lackArgs(sender);