mirror of
https://e.coding.net/circlecloud/LuckLottery.git
synced 2025-11-24 21:46:23 +00:00
update to 0.0.7 add reload command...
Signed-off-by: j502647092 <jtb1@163.com>
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -3,7 +3,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>cn.CityCraft</groupId>
|
<groupId>cn.CityCraft</groupId>
|
||||||
<artifactId>LuckLottery</artifactId>
|
<artifactId>LuckLottery</artifactId>
|
||||||
<version>0.0.6-SNAPSHOT</version>
|
<version>0.0.7-SNAPSHOT</version>
|
||||||
<build>
|
<build>
|
||||||
<sourceDirectory>src</sourceDirectory>
|
<sourceDirectory>src</sourceDirectory>
|
||||||
<resources>
|
<resources>
|
||||||
|
|||||||
@@ -64,9 +64,8 @@ public class LuckLottery extends JavaPlugin {
|
|||||||
|
|
||||||
public void onDisable() {
|
public void onDisable() {
|
||||||
this.getLogger().info("保存彩票数据中...");
|
this.getLogger().info("保存彩票数据中...");
|
||||||
LotteryUtils.saveLottery();
|
|
||||||
this.getLogger().info("保存玩家数据中...");
|
this.getLogger().info("保存玩家数据中...");
|
||||||
PlayerDate.save();
|
LotteryUtils.saveLottery();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean setupPermissions() {
|
public boolean setupPermissions() {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import org.bukkit.command.Command;
|
|||||||
import org.bukkit.command.CommandExecutor;
|
import org.bukkit.command.CommandExecutor;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.plugin.PluginManager;
|
||||||
|
|
||||||
import cn.citycraft.LuckLottery.LuckLottery;
|
import cn.citycraft.LuckLottery.LuckLottery;
|
||||||
import cn.citycraft.LuckLottery.utils.ChatUtils;
|
import cn.citycraft.LuckLottery.utils.ChatUtils;
|
||||||
@@ -91,6 +92,14 @@ public class LuckLotteryCommand implements CommandExecutor {
|
|||||||
LotteryUtils.showSystemLottery(sender);
|
LotteryUtils.showSystemLottery(sender);
|
||||||
}
|
}
|
||||||
return true;
|
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":
|
case "help":
|
||||||
ChatUtils.sendHelp(sender);
|
ChatUtils.sendHelp(sender);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ import org.bukkit.inventory.meta.ItemMeta;
|
|||||||
|
|
||||||
public class InvUtils {
|
public class InvUtils {
|
||||||
|
|
||||||
public static final String InvName = "§6[§3§l彩票系统§6] §c§l售价: "
|
public static final String InvName = ChatUtils.getPluginname()
|
||||||
+ LotteryUtils.getPrice() + "元一份";
|
+ " §c§l售价: " + LotteryUtils.getPrice() + "元一份";
|
||||||
|
|
||||||
public static final String Normal1 = "§6§l1";
|
public static final String Normal1 = "§6§l1";
|
||||||
public static final String Normal2 = "§6§l2";
|
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 Random = "lucklottery.random";
|
||||||
public static final String Look = "lucklottery.look";
|
public static final String Look = "lucklottery.look";
|
||||||
public static final String Clear = "lucklottery.clear";
|
public static final String Clear = "lucklottery.clear";
|
||||||
|
public static final String Reload = "lucklottery.reload";
|
||||||
|
|
||||||
public static String No_Permission = ChatColor.RED + "你没有此命令的权限!";
|
public static String No_Permission = ChatColor.RED + "你没有此命令的权限!";
|
||||||
|
|
||||||
public static boolean Check(Player p,String perm){
|
public static boolean Check(Player p, String perm) {
|
||||||
if (p.hasPermission(perm)){
|
if (p.hasPermission(perm)) {
|
||||||
return true;
|
return true;
|
||||||
}else{
|
} else {
|
||||||
ChatUtils.noPermission(p);
|
ChatUtils.noPermission(p);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean Check(CommandSender p,String perm){
|
public static boolean Check(CommandSender p, String perm) {
|
||||||
if (p.hasPermission(perm)){
|
if (p.hasPermission(perm)) {
|
||||||
return true;
|
return true;
|
||||||
}else{
|
} else {
|
||||||
ChatUtils.noPermission(p);
|
ChatUtils.noPermission(p);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
name: LuckLottery
|
name: LuckLottery
|
||||||
main: cn.citycraft.LuckLottery.LuckLottery
|
main: cn.citycraft.LuckLottery.LuckLottery
|
||||||
author: 喵♂呜
|
author: 喵♂呜
|
||||||
version: 0.0.6
|
version: 0.0.7
|
||||||
depended: [Vault]
|
depended: [Vault]
|
||||||
commands:
|
commands:
|
||||||
lucklottery:
|
lucklottery:
|
||||||
@@ -16,6 +16,7 @@ permissions:
|
|||||||
lucklottery.random: true
|
lucklottery.random: true
|
||||||
lucklottery.look: true
|
lucklottery.look: true
|
||||||
lucklottery.clear: true
|
lucklottery.clear: true
|
||||||
|
lucklottery.reload: true
|
||||||
lucklottery.showall:
|
lucklottery.showall:
|
||||||
description: 允许查看所有已购买彩票!
|
description: 允许查看所有已购买彩票!
|
||||||
default: op
|
default: op
|
||||||
@@ -31,3 +32,6 @@ permissions:
|
|||||||
lucklottery.clear:
|
lucklottery.clear:
|
||||||
description: 允许清理玩家彩票数据!
|
description: 允许清理玩家彩票数据!
|
||||||
default: op
|
default: op
|
||||||
|
lucklottery.reload:
|
||||||
|
description: 允许重载彩票插件!
|
||||||
|
default: op
|
||||||
Reference in New Issue
Block a user