Added message for online players when they vote

This commit is contained in:
Norbi Peti 2016-03-19 17:12:22 +01:00
parent 1e01fe4e86
commit 945604a5d6
14 changed files with 47 additions and 2 deletions

Binary file not shown.

View file

@ -25,9 +25,12 @@
<classpathentry kind="lib" path="D:/Downloads/htmlcleaner-2.16/htmlcleaner-2.16.jar"/>
<classpathentry kind="lib" path="D:/Z - Norbi cucca/0 Projektek/TheButtonMCAutoFlairProto/Spigot server/plugins/_/PermissionsEx-1.23.3.jar"/>
<classpathentry kind="lib" path="D:/Z - Norbi cucca/0 Projektek/TheButtonMCAutoFlairProto/Spigot server/plugins/_/votifier-1.9.jar"/>
<classpathentry kind="lib" path="D:/Z - Norbi cucca/0 Projektek/TheButtonMCAutoFlairProto/Spigot server/plugins/Vault.jar"/>
<classpathentry kind="lib" path="D:/Z - Norbi cucca/0 Projektek/TheButtonMCAutoFlairProto/Spigot server/plugins/_server/Vault.jar"/>
<classpathentry kind="lib" path="D:/Z - Norbi cucca/0 Projektek/TheButtonMCAutoFlairProto/Spigot server/plugins/_/Factions.jar"/>
<classpathentry kind="lib" path="D:/Z - Norbi cucca/0 Projektek/TheButtonMCAutoFlairProto/Spigot server/plugins/_/MassiveCore.jar"/>
<classpathentry kind="lib" path="D:/Z - Norbi cucca/0 Projektek/TheButtonMCAutoFlairProto/Spigot server (build)/Spigot/Spigot-API/target/spigot-api-1.9-R0.1-SNAPSHOT-shaded.jar"/>
<classpathentry kind="lib" path="D:/Z - Norbi cucca/0 Projektek/TheButtonMCAutoFlairProto/Spigot server/plugins/_/worldguard-legacy-6.1.2-SNAPSHOT-dist.jar"/>
<classpathentry kind="lib" path="D:/Z - Norbi cucca/0 Projektek/TheButtonMCAutoFlairProto/Spigot server/plugins/_/worldedit-bukkit-6.1.jar"/>
<classpathentry kind="lib" path="D:/Z - Norbi cucca/0 Projektek/TheButtonMCAutoFlairProto/Spigot server/plugins/_server/OreRegen1.5.jar"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>

View file

@ -19,8 +19,10 @@ commands:
description: Search the wiki.
usage: "&vUsage: /mwiki [query]&r"
dontrunthiscmd:
warmode:
description: Toggles war mode
author: NorbiPeti
depend: [Essentials, Towny, Minigames, Votifier, Factions]
depend: [Essentials, Towny, Minigames, Votifier, Factions, WorldGuard, WorldEdit, OreRegenerator]
permissions:
tbmc.admin:
description: Gives access to /un- commands and /u admin commands

View file

@ -1,5 +1,7 @@
package tk.sznp.thebuttonautoflair;
import me.steffansk1997.OreRegenerator.OreRegenerator;
import org.apache.commons.io.FileUtils;
import org.bukkit.Bukkit;
import org.bukkit.Location;
@ -17,6 +19,10 @@ import org.bukkit.potion.PotionEffectType;
import com.earth2me.essentials.Mob;
import com.earth2me.essentials.Mob.MobException;
import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
import com.sk89q.worldguard.protection.ApplicableRegionSet;
import com.sk89q.worldguard.protection.flags.StateFlag;
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
import au.com.mineauz.minigames.MinigamePlayer;
import au.com.mineauz.minigames.Minigames;
@ -255,6 +261,27 @@ public class Commands implements CommandExecutor {
DoMWiki(player, args);
return true;
}
case "warmode": {
ApplicableRegionSet ars = ((WorldGuardPlugin) Bukkit
.getPluginManager().getPlugin("WorldGuard"))
.getRegionManager(player.getWorld())
.getApplicableRegions(player.getLocation());
for (ProtectedRegion pr : ars) {
if (pr.getFlag(OreRegenerator.FLAG_REGENORES) == StateFlag.State.ALLOW) {
pr.setFlag(OreRegenerator.FLAG_REGENORES,
StateFlag.State.DENY);
sender.sendMessage("§eWarmode §cdisabled §ein "
+ pr.getId());
} else {
pr.setFlag(OreRegenerator.FLAG_REGENORES,
StateFlag.State.ALLOW);
sender.sendMessage("§eWarmode §aenabled §ein "
+ pr.getId());
}
break;
}
return true;
}
default:
player.sendMessage("Unknown command: " + cmd.getName());
break;

View file

@ -547,9 +547,13 @@ public class PlayerListener implements Listener {
System.out.println("Vote: " + vote);
org.bukkit.OfflinePlayer op = Bukkit.getOfflinePlayer(vote
.getUsername());
Player p = Bukkit.getPlayer(vote.getUsername());
if (op != null) {
PluginMain.economy.depositPlayer(op, 50.0);
}
if (p != null) {
p.sendMessage("§bThanks for voting! $50 was added to your account.");
}
}
/*

View file

@ -1,5 +1,6 @@
package tk.sznp.thebuttonautoflair;
import me.steffansk1997.OreRegenerator.OreRegenerator;
import net.milkbowl.vault.chat.Chat;
import net.milkbowl.vault.economy.Economy;
import net.milkbowl.vault.permission.Permission;
@ -24,6 +25,8 @@ import com.palmergames.bukkit.towny.Towny;
import com.palmergames.bukkit.towny.object.Nation;
import com.palmergames.bukkit.towny.object.Town;
import com.palmergames.bukkit.towny.object.TownyUniverse;
import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
import com.sk89q.worldguard.protection.flags.StateFlag;
import java.io.*;
import java.lang.String;
@ -94,6 +97,7 @@ public class PluginMain extends JavaPlugin { // Translated to Java: 2015.07.15.
this.getCommand("mwiki").setExecutor(comm);
this.getCommand("mwiki").setUsage(
this.getCommand("mwiki").getUsage().replace('&', '§'));
this.getCommand("warmode").setExecutor(comm);
Instance = this; // 2015.08.08.
Console = this.getServer().getConsoleSender(); // 2015.08.12.
LoadFiles(false); // 2015.08.09.
@ -119,6 +123,11 @@ public class PluginMain extends JavaPlugin { // Translated to Java: 2015.07.15.
GameMechanics.addGameMechanic(new CreativeGlobalMechanic());
((WorldGuardPlugin) Bukkit.getPluginManager().getPlugin("WorldGuard"))
.getRegionManager(Bukkit.getWorlds().get(0))
.getRegion("__global__")
.setFlag(OreRegenerator.FLAG_REGENORES, StateFlag.State.DENY);
Runnable r = new Runnable() {
public void run() {
ThreadMethod();