Merge remote-tracking branch 'Coding/master'

master
502647092 2015-08-18 17:06:43 +08:00
commit 1ed77faf0a
8 changed files with 159 additions and 168 deletions

View File

@ -1,20 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry including="**/*.java" kind="src" output="target/classes" path="src">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry including="**/*.java" kind="src" output="target/classes" path="src">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>

3
.gitignore vendored
View File

@ -1,3 +1,6 @@
/.settings
.classpath
# netbeans
/nbproject

View File

@ -1,23 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>LuckLottery</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>LuckLottery</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@ -1,3 +0,0 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8
encoding/src=UTF-8

View File

@ -1,5 +0,0 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.7

View File

@ -1,4 +0,0 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1

View File

@ -1,76 +1,76 @@
package cn.citycraft.LuckLottery;
import net.milkbowl.vault.economy.Economy;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.RegisteredServiceProvider;
import org.bukkit.plugin.java.JavaPlugin;
import cn.citycraft.LuckLottery.command.LuckLotteryCommand;
import cn.citycraft.LuckLottery.config.Config;
import cn.citycraft.LuckLottery.config.OfflineDate;
import cn.citycraft.LuckLottery.config.PlayerDate;
import cn.citycraft.LuckLottery.listen.PlayerListen;
import cn.citycraft.LuckLottery.runnable.LotteryReward;
import cn.citycraft.LuckLottery.utils.ChatUtils;
import cn.citycraft.LuckLottery.utils.LotteryUtils;
import cn.citycraft.LuckLottery.utils.VersionChecker;
public class LuckLottery extends JavaPlugin {
public static boolean isEconomy;
public static Economy economy = null;
public static LuckLottery plugin;
@Override
public void onDisable() {
this.getLogger().info("保存彩票数据中...");
this.getLogger().info("保存玩家数据中...");
LotteryUtils.saveLottery();
}
@Override
public void onEnable() {
PluginManager pm = this.getServer().getPluginManager();
if (pm.getPlugin("Vault") == null && !pm.getPlugin("Vault").isEnabled()) {
this.getLogger().warning("未找到前置插件Vault 关闭插件...");
this.getServer().getPluginManager().disablePlugin(this);
return;
}
if (setupEconomy()) {
LuckLottery.isEconomy = true;
this.getLogger().info("发现Vault 载入数据...");
} else {
this.getLogger().warning("发现Vault 但是无法找到经济插件 关闭插件...");
this.getServer().getPluginManager().disablePlugin(this);
return;
}
int rewardtime = Config.getInstance().getInt("RewardTime", 10);
this.getServer().getScheduler()
.runTaskTimer(plugin, new LotteryReward(true), 10, rewardtime * 60 * 20);
this.getLogger().info("彩票系统已开启...");
new VersionChecker(this);
pm.registerEvents(new PlayerListen(), this);
getCommand("ll").setExecutor(new LuckLotteryCommand(this));
}
@Override
public void onLoad() {
plugin = this;
Config.load(this, "1.2");
OfflineDate.load(this);
PlayerDate.load(this);
LotteryUtils.reloadPlayerLottery();
ChatUtils.setPluginname(Config.getMessage("pluginname"));
LotteryUtils.setNumbersame(Config.getInstance().getBoolean("numbersame"));
LotteryUtils.setPrice(Config.getInstance().getInt("price"));
}
public boolean setupEconomy() {
RegisteredServiceProvider<Economy> economyProvider = getServer().getServicesManager()
.getRegistration(net.milkbowl.vault.economy.Economy.class);
if (economyProvider != null) {
economy = economyProvider.getProvider();
}
return (economy != null);
}
}
package cn.citycraft.LuckLottery;
import net.milkbowl.vault.economy.Economy;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.RegisteredServiceProvider;
import org.bukkit.plugin.java.JavaPlugin;
import cn.citycraft.LuckLottery.command.LuckLotteryCommand;
import cn.citycraft.LuckLottery.config.Config;
import cn.citycraft.LuckLottery.config.OfflineDate;
import cn.citycraft.LuckLottery.config.PlayerDate;
import cn.citycraft.LuckLottery.listen.PlayerListen;
import cn.citycraft.LuckLottery.runnable.LotteryReward;
import cn.citycraft.LuckLottery.utils.ChatUtils;
import cn.citycraft.LuckLottery.utils.LotteryUtils;
import cn.citycraft.LuckLottery.utils.VersionChecker;
public class LuckLottery extends JavaPlugin {
public static boolean isEconomy;
public static Economy economy = null;
public static LuckLottery plugin;
@Override
public void onDisable() {
this.getLogger().info("保存彩票数据中...");
this.getLogger().info("保存玩家数据中...");
LotteryUtils.saveLottery();
}
@Override
public void onEnable() {
PluginManager pm = this.getServer().getPluginManager();
if (pm.getPlugin("Vault") == null && !pm.getPlugin("Vault").isEnabled()) {
this.getLogger().warning("未找到前置插件Vault 关闭插件...");
this.getServer().getPluginManager().disablePlugin(this);
return;
}
if (setupEconomy()) {
LuckLottery.isEconomy = true;
this.getLogger().info("发现Vault 载入数据...");
} else {
this.getLogger().warning("发现Vault 但是无法找到经济插件 关闭插件...");
this.getServer().getPluginManager().disablePlugin(this);
return;
}
int rewardtime = Config.getInstance().getInt("RewardTime", 10);
this.getServer().getScheduler()
.runTaskTimer(plugin, new LotteryReward(true), 10, rewardtime * 60 * 20);
this.getLogger().info("彩票系统已开启...");
new VersionChecker(this);
pm.registerEvents(new PlayerListen(), this);
getCommand("ll").setExecutor(new LuckLotteryCommand(this));
}
@Override
public void onLoad() {
plugin = this;
Config.load(this, "1.2");
OfflineDate.load(this);
PlayerDate.load(this);
LotteryUtils.reloadPlayerLottery();
ChatUtils.setPluginname(Config.getMessage("pluginname"));
LotteryUtils.setNumbersame(Config.getInstance().getBoolean("numbersame"));
LotteryUtils.setPrice(Config.getInstance().getInt("price"));
}
public boolean setupEconomy() {
RegisteredServiceProvider<Economy> economyProvider = getServer().getServicesManager()
.getRegistration(net.milkbowl.vault.economy.Economy.class);
if (economyProvider != null) {
economy = economyProvider.getProvider();
}
return (economy != null);
}
}

View File

@ -1,38 +1,38 @@
name: LuckLottery
main: cn.citycraft.LuckLottery.LuckLottery
author: 喵♂呜
website: http://ci.citycraft.cn:8800/jenkins/job/LuckLottery/
version: 0.1.0
depended: [Vault]
commands:
lucklottery:
aliases: [ll]
permissions:
lucklottery.*:
description: 允许使用所有命令!
default: op
children:
lucklottery.showall: true
lucklottery.reward: true
lucklottery.random: true
lucklottery.look: true
lucklottery.clear: true
lucklottery.reload: true
lucklottery.showall:
description: 允许查看所有已购买彩票!
default: op
lucklottery.reward:
description: 允许结算上一轮彩票!
default: op
lucklottery.random:
description: 允许重新生成本轮彩票!
default: op
lucklottery.look:
description: 允许查看本轮彩票号码!
default: op
lucklottery.clear:
description: 允许清理玩家彩票数据!
default: op
lucklottery.reload:
description: 允许重载彩票插件!
name: LuckLottery
main: cn.citycraft.LuckLottery.LuckLottery
author: 喵♂呜
website: http://ci.citycraft.cn:8800/jenkins/job/LuckLottery/
version: 0.1.0
depended: [Vault]
commands:
lucklottery:
aliases: [ll]
permissions:
lucklottery.*:
description: 允许使用所有命令!
default: op
children:
lucklottery.showall: true
lucklottery.reward: true
lucklottery.random: true
lucklottery.look: true
lucklottery.clear: true
lucklottery.reload: true
lucklottery.showall:
description: 允许查看所有已购买彩票!
default: op
lucklottery.reward:
description: 允许结算上一轮彩票!
default: op
lucklottery.random:
description: 允许重新生成本轮彩票!
default: op
lucklottery.look:
description: 允许查看本轮彩票号码!
default: op
lucklottery.clear:
description: 允许清理玩家彩票数据!
default: op
lucklottery.reload:
description: 允许重载彩票插件!
default: op