mirror of
https://e.coding.net/circlecloud/LuckLottery.git
synced 2025-12-27 03:06:04 +00:00
110
pom.xml
110
pom.xml
@@ -1,56 +1,56 @@
|
|||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<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>
|
||||||
<resource>
|
<resource>
|
||||||
<directory>src</directory>
|
<directory>src</directory>
|
||||||
<excludes>
|
<excludes>
|
||||||
<exclude>**/*.java</exclude>
|
<exclude>**/*.java</exclude>
|
||||||
</excludes>
|
</excludes>
|
||||||
</resource>
|
</resource>
|
||||||
</resources>
|
</resources>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.1</version>
|
<version>3.1</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<source>1.7</source>
|
<source>1.7</source>
|
||||||
<target>1.7</target>
|
<target>1.7</target>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>
|
<repository>
|
||||||
<id>spigot-repo</id>
|
<id>spigot-repo</id>
|
||||||
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
|
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
|
||||||
</repository>
|
</repository>
|
||||||
<repository>
|
<repository>
|
||||||
<id>vault-repo</id>
|
<id>vault-repo</id>
|
||||||
<url>http://nexus.theyeticave.net/content/repositories/pub_releases</url>
|
<url>http://nexus.theyeticave.net/content/repositories/pub_releases</url>
|
||||||
</repository>
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.spigotmc</groupId>
|
<groupId>org.spigotmc</groupId>
|
||||||
<artifactId>spigot-api</artifactId>
|
<artifactId>spigot-api</artifactId>
|
||||||
<type>jar</type>
|
<type>jar</type>
|
||||||
<version>1.8.3-R0.1-SNAPSHOT</version>
|
<version>1.8.3-R0.1-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.milkbowl.vault</groupId>
|
<groupId>net.milkbowl.vault</groupId>
|
||||||
<artifactId>VaultAPI</artifactId>
|
<artifactId>VaultAPI</artifactId>
|
||||||
<version>1.5</version>
|
<version>1.5</version>
|
||||||
<scope>system</scope>
|
<scope>system</scope>
|
||||||
<systemPath>${project.basedir}/lib/Vault-1.4.1.jar</systemPath>
|
<systemPath>${project.basedir}/lib/Vault-1.4.1.jar</systemPath>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
</properties>
|
</properties>
|
||||||
</project>
|
</project>
|
||||||
@@ -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());
|
||||||
|
|||||||
@@ -1,8 +1,29 @@
|
|||||||
#本文件为插件的主配置文件
|
#本文件为插件的主配置文件
|
||||||
version: 1.0
|
version: 1.0
|
||||||
#服务器名称
|
#服务器名称
|
||||||
servername: ''
|
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]
|
||||||
Reference in New Issue
Block a user