48 lines
1.4 KiB
Java
48 lines
1.4 KiB
Java
package com.yuyu.srdisassemble.command;
|
|
|
|
import com.sakurarealm.sritem.bukkit.command.SubCommand;
|
|
import com.yuyu.srdisassemble.SrDisassemble;
|
|
import com.yuyu.srdisassemble.disassemeble.DisassembleManager;
|
|
import org.bukkit.Bukkit;
|
|
import org.bukkit.ChatColor;
|
|
import org.bukkit.command.CommandSender;
|
|
import org.bukkit.entity.Player;
|
|
|
|
/**
|
|
* @author 峰。
|
|
* @version 1.0
|
|
* @project SrDisassemble113
|
|
* @date 2024/7/25 20:42:26
|
|
* @description 回炉指令类
|
|
*/
|
|
public class MeltCommand implements SubCommand {
|
|
|
|
@Override
|
|
public void onCommand(CommandSender commandSender, String[] strings) {
|
|
if (strings.length == 1) {
|
|
if (strings[0].equalsIgnoreCase("reload")){
|
|
commandSender.sendMessage(ChatColor.RED+"分解配置文件重载!");
|
|
//重载文件
|
|
SrDisassemble.getConfigManager().reload();
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
if (strings.length < 2){
|
|
commandSender.sendMessage(ChatColor.RED+"正确的格式为:/srmeltagain open 姓名 ");
|
|
return;
|
|
}
|
|
|
|
Player player = Bukkit.getPlayer(strings[1]);
|
|
if (player == null){
|
|
commandSender.sendMessage(ChatColor.RED+"玩家"+strings[1]+"不存在!");
|
|
return;
|
|
}
|
|
|
|
//为玩家打开GUI列表
|
|
DisassembleManager.getInstance().openMeltAgain(player);
|
|
|
|
}
|
|
}
|