fix config file ...

Signed-off-by: j502647092 <jtb1@163.com>
Custom
j502647092 2015-05-21 00:30:12 +08:00
parent 543d145252
commit e17022ab40
3 changed files with 29 additions and 30 deletions

View File

@ -6,7 +6,6 @@ import java.util.Map.Entry;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.OfflinePlayer;
import org.bukkit.entity.Player;
import cn.citycraft.LuckLottery.LuckLottery;
import cn.citycraft.LuckLottery.config.Config;
@ -32,6 +31,8 @@ public class LotteryReward implements Runnable {
}
ChatUtils.broadcastMessage(ChatColor.GOLD + "本轮彩票开奖: " + ChatColor.RED
+ LotteryUtils.getSystemLottery().toString());
ChatUtils.broadcastMessage(ChatColor.BLUE + "使用命令: " + ChatColor.RED
+ "/ll" + ChatColor.BLUE + " 或闹钟菜单可以购买彩票!");
for (Entry<String, List<List<String>>> players : LotteryUtils
.getPlayerLottery().entrySet()) {
OfflinePlayer p = Bukkit.getOfflinePlayer(players.getKey());
@ -43,12 +44,16 @@ public class LotteryReward implements Runnable {
winprices = Config.getInstance().getInt("Reward." + win,
200);
if (winprices > 0) {
ChatUtils.broadcastMessage(ChatColor.GREEN + p.getName() +"的彩票: "
+ ChatColor.YELLOW + playerlottery.toString()
+ ChatColor.GREEN + "获得了" + ChatColor.GOLD
+ winprices + ChatColor.GREEN + "元!");
String message = ChatColor.GREEN + "您的彩票: "
+ ChatColor.YELLOW + playerlottery.toString()
+ ChatColor.GREEN + "获得了" + ChatColor.GOLD
+ winprices + ChatColor.GREEN + "元!";
if (p.isOnline()) {
ChatUtils.sendMessage((Player) p, message);
//ChatUtils.sendMessage((Player) p, message);
} else {
OfflineDate.addMessage(p.getName(), message);
}

View File

@ -26,20 +26,6 @@ public class LotteryUtils {
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,
List<String> lottery) {
List<List<String>> playerhas = playerLottery.get(player.getName());
@ -108,6 +94,14 @@ public class LotteryUtils {
LotteryUtils.systemLottery = systemLottery;
}
public static int getPrice() {
return price;
}
public static void setPrice(int price) {
LotteryUtils.price = price;
}
public static Map<String, List<List<String>>> getPlayerLottery() {
return playerLottery;
}

View File

@ -1,5 +1,5 @@
#本文件为插件的主配置文件
version: 1.0
version: 1.1
#服务器名称
servername: ''
#插件名称
@ -11,19 +11,19 @@ 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
0: 0
1: 300
2: 500
3: 800
4: 1000
5: 2000
6: 3000
10: 500
11: 800
12: 1000
13: 2000
14: 3000
15: 4000
16: 5000