switch to custom version...
Signed-off-by: j502647092 <jtb1@163.com>
This commit is contained in:
parent
b7318b8f98
commit
543d145252
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.3-SNAPSHOT</version>
|
<version>0.0.5-SNAPSHOT</version>
|
||||||
<build>
|
<build>
|
||||||
<sourceDirectory>src</sourceDirectory>
|
<sourceDirectory>src</sourceDirectory>
|
||||||
<resources>
|
<resources>
|
||||||
|
|
|
@ -30,12 +30,15 @@ public class LuckLottery extends JavaPlugin {
|
||||||
OfflineDate.load(this);
|
OfflineDate.load(this);
|
||||||
PlayerDate.load(this);
|
PlayerDate.load(this);
|
||||||
ChatUtils.setPluginname(Config.getMessage("pluginname"));
|
ChatUtils.setPluginname(Config.getMessage("pluginname"));
|
||||||
LotteryUtils.setNumbersame(Config.getInstance().getBoolean("numbersame"));
|
|
||||||
|
LotteryUtils.setNumbersame(Config.getInstance()
|
||||||
|
.getBoolean("numbersame"));
|
||||||
|
LotteryUtils.setPrice(Config.getInstance().getInt("price"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
PluginManager pm = this.getServer().getPluginManager();
|
PluginManager pm = this.getServer().getPluginManager();
|
||||||
if (!pm.getPlugin("Vault").isEnabled()){
|
if (!pm.getPlugin("Vault").isEnabled()) {
|
||||||
this.getLogger().warning("未找到前置插件Vault 关闭插件...");
|
this.getLogger().warning("未找到前置插件Vault 关闭插件...");
|
||||||
this.getServer().getPluginManager().disablePlugin(this);
|
this.getServer().getPluginManager().disablePlugin(this);
|
||||||
return;
|
return;
|
||||||
|
@ -48,7 +51,8 @@ public class LuckLottery extends JavaPlugin {
|
||||||
this.getServer().getPluginManager().disablePlugin(this);
|
this.getServer().getPluginManager().disablePlugin(this);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.getServer().getScheduler()
|
this.getServer()
|
||||||
|
.getScheduler()
|
||||||
.runTaskTimer(plugin, new LotteryReward(true), 10, 10 * 60 * 20);
|
.runTaskTimer(plugin, new LotteryReward(true), 10, 10 * 60 * 20);
|
||||||
this.getLogger().info("彩票系统已开启...");
|
this.getLogger().info("彩票系统已开启...");
|
||||||
pm.registerEvents(new PlayerListen(), this);
|
pm.registerEvents(new PlayerListen(), this);
|
||||||
|
|
|
@ -25,14 +25,15 @@ public class LuckLotteryCommand implements CommandExecutor {
|
||||||
String[] args) {
|
String[] args) {
|
||||||
switch (args.length) {
|
switch (args.length) {
|
||||||
case 0:
|
case 0:
|
||||||
if (isPlayer(sender)){
|
if (isPlayer(sender)) {
|
||||||
Player p = (Player) sender;
|
Player p = (Player) sender;
|
||||||
|
int price = LotteryUtils.getPrice();
|
||||||
if (LuckLottery.economy.hasAccount(p)
|
if (LuckLottery.economy.hasAccount(p)
|
||||||
&& LuckLottery.economy.has(p, 200)) {
|
&& LuckLottery.economy.has(p, price)) {
|
||||||
InvUtils.openGui(p);
|
InvUtils.openGui(p);
|
||||||
} else {
|
} else {
|
||||||
ChatUtils.sendMessage(p, ChatColor.GOLD
|
ChatUtils.sendMessage(p, ChatColor.GOLD
|
||||||
+ "你没有足够的金钱购买彩票,每张彩票" + ChatColor.RED + "200"
|
+ "你没有足够的金钱购买彩票,每张彩票" + ChatColor.RED + price
|
||||||
+ ChatColor.GOLD + "元!");
|
+ ChatColor.GOLD + "元!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -60,11 +61,12 @@ public class LuckLotteryCommand implements CommandExecutor {
|
||||||
case "reward":
|
case "reward":
|
||||||
if (PermissionUtils.Check(sender, PermissionUtils.Reward)) {
|
if (PermissionUtils.Check(sender, PermissionUtils.Reward)) {
|
||||||
LotteryUtils.rewardLastLottery();
|
LotteryUtils.rewardLastLottery();
|
||||||
ChatUtils.sendMessage(sender, ChatColor.GREEN + "已结算上一轮彩票!");
|
ChatUtils
|
||||||
|
.sendMessage(sender, ChatColor.GREEN + "已结算上一轮彩票!");
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
case "look":
|
case "look":
|
||||||
if (PermissionUtils.Check(sender, PermissionUtils.Reward)){
|
if (PermissionUtils.Check(sender, PermissionUtils.Reward)) {
|
||||||
LotteryUtils.showSystemLottery(sender);
|
LotteryUtils.showSystemLottery(sender);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -9,6 +9,7 @@ import org.bukkit.OfflinePlayer;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import cn.citycraft.LuckLottery.LuckLottery;
|
import cn.citycraft.LuckLottery.LuckLottery;
|
||||||
|
import cn.citycraft.LuckLottery.config.Config;
|
||||||
import cn.citycraft.LuckLottery.config.OfflineDate;
|
import cn.citycraft.LuckLottery.config.OfflineDate;
|
||||||
import cn.citycraft.LuckLottery.utils.ChatUtils;
|
import cn.citycraft.LuckLottery.utils.ChatUtils;
|
||||||
import cn.citycraft.LuckLottery.utils.LotteryUtils;
|
import cn.citycraft.LuckLottery.utils.LotteryUtils;
|
||||||
|
@ -39,65 +40,8 @@ public class LotteryReward implements Runnable {
|
||||||
for (List<String> playerlottery : pl) {
|
for (List<String> playerlottery : pl) {
|
||||||
int win = LotteryUtils.getSameNumber(playerlottery);
|
int win = LotteryUtils.getSameNumber(playerlottery);
|
||||||
int winprices = 0;
|
int winprices = 0;
|
||||||
switch (win) {
|
winprices = Config.getInstance().getInt("Reward." + win,
|
||||||
case 10:
|
200);
|
||||||
case 11:
|
|
||||||
winprices = 500;
|
|
||||||
break;
|
|
||||||
case 12:
|
|
||||||
winprices = 1000;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
case 13:
|
|
||||||
winprices = 3000;
|
|
||||||
break;
|
|
||||||
case 14:
|
|
||||||
case 5:
|
|
||||||
case 15:
|
|
||||||
winprices = 5000;
|
|
||||||
break;
|
|
||||||
// case 0:
|
|
||||||
// case 1:
|
|
||||||
// winprices = 0;
|
|
||||||
// break;
|
|
||||||
// case 2:
|
|
||||||
// winprices = 500;
|
|
||||||
// break;
|
|
||||||
// case 3:
|
|
||||||
// winprices = 1000;
|
|
||||||
// break;
|
|
||||||
// case 4:
|
|
||||||
// winprices = 3000;
|
|
||||||
// break;
|
|
||||||
// case 5:
|
|
||||||
// winprices = 5000;
|
|
||||||
// break;
|
|
||||||
// case 6:
|
|
||||||
// winprices = 10000;
|
|
||||||
// break;
|
|
||||||
// case 10:
|
|
||||||
// winprices = 0;
|
|
||||||
// break;
|
|
||||||
// case 11:
|
|
||||||
// winprices = 500;
|
|
||||||
// break;
|
|
||||||
// case 12:
|
|
||||||
// winprices = 1000;
|
|
||||||
// break;
|
|
||||||
// case 13:
|
|
||||||
// winprices = 3000;
|
|
||||||
// break;
|
|
||||||
// case 14:
|
|
||||||
// winprices = 5000;
|
|
||||||
// break;
|
|
||||||
// case 15:
|
|
||||||
// winprices = 10000;
|
|
||||||
// break;
|
|
||||||
// case 16:
|
|
||||||
// winprices = 50000;
|
|
||||||
// break;
|
|
||||||
default:
|
|
||||||
}
|
|
||||||
if (winprices > 0) {
|
if (winprices > 0) {
|
||||||
String message = ChatColor.GREEN + "您的彩票: "
|
String message = ChatColor.GREEN + "您的彩票: "
|
||||||
+ ChatColor.YELLOW + playerlottery.toString()
|
+ ChatColor.YELLOW + playerlottery.toString()
|
||||||
|
|
|
@ -24,6 +24,22 @@ public class LotteryUtils {
|
||||||
|
|
||||||
protected static boolean numbersame;
|
protected static boolean numbersame;
|
||||||
|
|
||||||
|
protected static int price;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return price
|
||||||
|
*/
|
||||||
|
public static int getPrice() {
|
||||||
|
return price;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param price 要设置的 price
|
||||||
|
*/
|
||||||
|
public static void setPrice(int price) {
|
||||||
|
LotteryUtils.price = price;
|
||||||
|
}
|
||||||
|
|
||||||
public static List<List<String>> addLottery(Player player,
|
public static List<List<String>> addLottery(Player player,
|
||||||
List<String> lottery) {
|
List<String> lottery) {
|
||||||
List<List<String>> playerhas = playerLottery.get(player.getName());
|
List<List<String>> playerhas = playerLottery.get(player.getName());
|
||||||
|
|
|
@ -6,3 +6,24 @@ servername: ''
|
||||||
pluginname: '&6[&b彩票系统&6]&r '
|
pluginname: '&6[&b彩票系统&6]&r '
|
||||||
#是否需要对应彩票号码位置
|
#是否需要对应彩票号码位置
|
||||||
numbersame: true
|
numbersame: true
|
||||||
|
#单张彩票价格
|
||||||
|
price: 200
|
||||||
|
#返现金额(红色球一个代表1点,蓝色球代表10点自行相加!)
|
||||||
|
#注意:请不要删除0这一行,配置错误将默认全部返还彩票价格的金钱.
|
||||||
|
Reward:
|
||||||
|
0:0
|
||||||
|
1: 50
|
||||||
|
2: 100
|
||||||
|
3: 300
|
||||||
|
4: 500
|
||||||
|
5: 1000
|
||||||
|
6: 2000
|
||||||
|
10: 300
|
||||||
|
11: 500
|
||||||
|
12: 800
|
||||||
|
13: 1200
|
||||||
|
14: 2400
|
||||||
|
15: 3600
|
||||||
|
16: 5000
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
name: LuckLottery
|
name: LuckLottery
|
||||||
main: cn.citycraft.LuckLottery.LuckLottery
|
main: cn.citycraft.LuckLottery.LuckLottery
|
||||||
author: 喵♂呜
|
author: 喵♂呜
|
||||||
version: 0.0.1
|
version: 0.0.5
|
||||||
depended: [BVLib,Vault]
|
depended: [Vault]
|
||||||
commands:
|
commands:
|
||||||
lucklottery:
|
lucklottery:
|
||||||
aliases: [ll]
|
aliases: [ll]
|
Loading…
Reference in New Issue