parent
ec03a25912
commit
db6302219c
2
pom.xml
2
pom.xml
|
@ -3,7 +3,7 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>cn.CityCraft</groupId>
|
||||
<artifactId>LuckLottery</artifactId>
|
||||
<version>0.0.6-SNAPSHOT</version>
|
||||
<version>0.0.7-SNAPSHOT</version>
|
||||
<build>
|
||||
<sourceDirectory>src</sourceDirectory>
|
||||
<resources>
|
||||
|
|
|
@ -64,9 +64,8 @@ public class LuckLottery extends JavaPlugin {
|
|||
|
||||
public void onDisable() {
|
||||
this.getLogger().info("保存彩票数据中...");
|
||||
LotteryUtils.saveLottery();
|
||||
this.getLogger().info("保存玩家数据中...");
|
||||
PlayerDate.save();
|
||||
LotteryUtils.saveLottery();
|
||||
}
|
||||
|
||||
public boolean setupPermissions() {
|
||||
|
|
|
@ -5,6 +5,7 @@ import org.bukkit.command.Command;
|
|||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
|
||||
import cn.citycraft.LuckLottery.LuckLottery;
|
||||
import cn.citycraft.LuckLottery.utils.ChatUtils;
|
||||
|
@ -91,6 +92,14 @@ public class LuckLotteryCommand implements CommandExecutor {
|
|||
LotteryUtils.showSystemLottery(sender);
|
||||
}
|
||||
return true;
|
||||
case "reload":
|
||||
if (PermissionUtils.Check(sender, PermissionUtils.Reload)) {
|
||||
PluginManager pm = plugin.getServer().getPluginManager();
|
||||
pm.disablePlugin(plugin);
|
||||
pm.enablePlugin(plugin);
|
||||
ChatUtils.sendMessage(sender, ChatColor.GREEN + "配置文件已重载!");
|
||||
}
|
||||
return true;
|
||||
case "help":
|
||||
ChatUtils.sendHelp(sender);
|
||||
return true;
|
||||
|
|
|
@ -13,8 +13,8 @@ import org.bukkit.inventory.meta.ItemMeta;
|
|||
|
||||
public class InvUtils {
|
||||
|
||||
public static final String InvName = "§6[§3§l彩票系统§6] §c§l售价: "
|
||||
+ LotteryUtils.getPrice() + "元一份";
|
||||
public static final String InvName = ChatUtils.getPluginname()
|
||||
+ " §c§l售价: " + LotteryUtils.getPrice() + "元一份";
|
||||
|
||||
public static final String Normal1 = "§6§l1";
|
||||
public static final String Normal2 = "§6§l2";
|
||||
|
|
|
@ -11,22 +11,23 @@ public class PermissionUtils {
|
|||
public static final String Random = "lucklottery.random";
|
||||
public static final String Look = "lucklottery.look";
|
||||
public static final String Clear = "lucklottery.clear";
|
||||
|
||||
public static final String Reload = "lucklottery.reload";
|
||||
|
||||
public static String No_Permission = ChatColor.RED + "你没有此命令的权限!";
|
||||
|
||||
public static boolean Check(Player p,String perm){
|
||||
if (p.hasPermission(perm)){
|
||||
|
||||
public static boolean Check(Player p, String perm) {
|
||||
if (p.hasPermission(perm)) {
|
||||
return true;
|
||||
}else{
|
||||
} else {
|
||||
ChatUtils.noPermission(p);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean Check(CommandSender p,String perm){
|
||||
if (p.hasPermission(perm)){
|
||||
|
||||
public static boolean Check(CommandSender p, String perm) {
|
||||
if (p.hasPermission(perm)) {
|
||||
return true;
|
||||
}else{
|
||||
} else {
|
||||
ChatUtils.noPermission(p);
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
name: LuckLottery
|
||||
main: cn.citycraft.LuckLottery.LuckLottery
|
||||
author: 喵♂呜
|
||||
version: 0.0.6
|
||||
version: 0.0.7
|
||||
depended: [Vault]
|
||||
commands:
|
||||
lucklottery:
|
||||
|
@ -16,6 +16,7 @@ permissions:
|
|||
lucklottery.random: true
|
||||
lucklottery.look: true
|
||||
lucklottery.clear: true
|
||||
lucklottery.reload: true
|
||||
lucklottery.showall:
|
||||
description: 允许查看所有已购买彩票!
|
||||
default: op
|
||||
|
@ -30,4 +31,7 @@ permissions:
|
|||
default: op
|
||||
lucklottery.clear:
|
||||
description: 允许清理玩家彩票数据!
|
||||
default: op
|
||||
lucklottery.reload:
|
||||
description: 允许重载彩票插件!
|
||||
default: op
|
Loading…
Reference in New Issue