Should run smooth now

This commit is contained in:
Travis Eggett 2012-07-17 17:06:57 -06:00
parent e7e96bd2d8
commit 95d6bfe9c5
33 changed files with 15 additions and 62 deletions

Binary file not shown.

View File

@ -1,10 +1,7 @@
# default config.yml
<<<<<<< HEAD
=======
#config version for us devs. DONT CHANGE THIS, or it will screw up some things PRETTY badly.
config:
version: 1.3
>>>>>>> de44f825be59d96da77136bf1dd2b26fc23d09b7
# Message to display when the games start
Start_Message: '&bLet The Games Begin!'
# If the games should automatically restart at the end
@ -13,11 +10,8 @@ Auto_Restart: 'false'
Auto_Start: 'false'
# If tributes need to type /ha confirm to join
Need_Confirm: 'true'
<<<<<<< HEAD
# Not yet implemented
iConomy_Support: 'false'
=======
>>>>>>> de44f825be59d96da77136bf1dd2b26fc23d09b7
# What the reward for winning is
Reward:
ID: 264
@ -30,11 +24,8 @@ Sponsor_Cost:
Countdown: 'true'
Spawn_coords: 100,100,100,world
# If players will only talk to close players of the whole server
<<<<<<< HEAD
ChatClose: 'true'
=======
ChatClose: 'false'
>>>>>>> de44f825be59d96da77136bf1dd2b26fc23d09b7
# How close the players have to be to talk to them
ChatClose_Radius: 10
# Whether or not players can break blocks while playing
@ -69,13 +60,10 @@ Tribute_twentythree_spawn: 100,100,100
Tribute_twentyfour_spawn: 100,100,100
# If /ha setspawn has been run
Spawn_set: 'false'
<<<<<<< HEAD
=======
# True means give money to winner, false means don't.
eco:
enabled: false
reward: 100
# How much money to give the winner.
# Leave this. :)
>>>>>>> de44f825be59d96da77136bf1dd2b26fc23d09b7
Blocks_Destroyed:

View File

@ -1,8 +1,8 @@
name: HungerArena
<<<<<<< HEAD
main: me.Travja.HungerArena.Main
version: 1.3alpha
description: A plugin to help with playing The Hunger Games!
description: A lightweight and powerful plugin to help with playing The Hunger Games!
softdepend: [Vault]
commands:
Ha:
description: Makes you join a game or start the game!
@ -10,16 +10,3 @@ commands:
description: Sets the starting point of a tribute.
Sponsor:
description: Sponsors a Tribute
=======
main: me.travja.hungerarena.Main
version: 1.3alpha
description: A lightweight and powerful plugin to help with playing The Hunger Games!
softdepend: [Vault]
commands:
Ha:
description: Base command for HungerArena!
StartPoint:
description: Set the starting points for tributes.
Sponsor:
description: Sponsor a tribute.
>>>>>>> de44f825be59d96da77136bf1dd2b26fc23d09b7

View File

@ -4,6 +4,7 @@ import java.util.List;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.block.Chest;
@ -59,24 +60,20 @@ public class HaCommands implements CommandExecutor {
sender.sendMessage(c + "/ha rlist - See who's ready!");
sender.sendMessage(c + "/startpoint [1,2,3,4,etc] - Sets the starting points of tributes!");
sender.sendMessage(ChatColor.GREEN + "----------------------");
return true;
}else if(args[0].equalsIgnoreCase("List")){
if(p.hasPermission("HungerArena.GameMaker")){
sender.sendMessage(ChatColor.AQUA + "-----People Playing-----");
if(!plugin.Playing.isEmpty()){
for(String playernames: plugin.Playing){
Player players = plugin.getServer().getPlayerExact(playernames);
p.sendMessage(ChatColor.GREEN + playernames + " Life: " + players.getHealth() + "/20");
return true;
sender.sendMessage(ChatColor.GREEN + playernames + " Life: " + players.getHealth() + "/20");
}
}else if(plugin.Playing.isEmpty()){
p.sendMessage(ChatColor.GRAY + "No one is playing!");
}
p.sendMessage(ChatColor.AQUA + "----------------------");
return true;
}else{
p.sendMessage(ChatColor.RED + "You don't have permission!");
return true;
}
}else if(args[0].equalsIgnoreCase("rList")){
if(p.hasPermission("HungerArena.GameMaker")){
@ -90,10 +87,8 @@ public class HaCommands implements CommandExecutor {
p.sendMessage(ChatColor.GRAY + "No one is ready!");
}
p.sendMessage(ChatColor.AQUA + "---------------------");
return true;
}else{
p.sendMessage(ChatColor.RED + "You don't have permission!");
return true;
}
}else if(args[0].equalsIgnoreCase("SetSpawn")){
if(p.hasPermission("HungerArena.SetSpawn")){
@ -105,35 +100,26 @@ public class HaCommands implements CommandExecutor {
plugin.config.set("Spawns_set", "true");
plugin.saveConfig();
p.sendMessage(ChatColor.AQUA + "You have set the spawn for dead tributes!");
return true;
}else{
p.sendMessage(ChatColor.RED + "You don't have permission!");
return true;
}
}else if(args[0].equalsIgnoreCase("Join")){
if(p.hasPermission("HungerArena.Join")){
if(plugin.Playing.contains(pname)){
p.sendMessage(ChatColor.RED + "You are already playing!");
return true;
}else if(plugin.Dead.contains(pname) || plugin.Quit.contains(pname)){
p.sendMessage(ChatColor.RED + "You DIED/QUIT! You can't join again!");
return true;
}else if(plugin.Playing.size()== 24){
p.sendMessage(ChatColor.RED + "There are already 24 Tributes!");
return true;
}else if(plugin.canjoin== true){
p.sendMessage(ChatColor.RED + "The game is in progress!");
return true;
}else if(plugin.config.getString("Spawns_set").equalsIgnoreCase("false")){
p.sendMessage(ChatColor.RED + "/ha setspawn hasn't been run!");
return true;
}else if(plugin.NeedConfirm.contains(pname)){
p.sendMessage(ChatColor.RED + "You need to do /ha confirm");
return true;
}else if(plugin.config.getString("Need_Confirm").equalsIgnoreCase("true")){
plugin.NeedConfirm.add(pname);
p.sendMessage(ChatColor.GOLD + "You're inventory will be cleared! Type /ha confirm to procede");
return true;
}else{
plugin.Playing.add(pname);
p.getInventory().clear();
@ -145,11 +131,9 @@ public class HaCommands implements CommandExecutor {
if(plugin.Playing.size()== 24){
p.performCommand("ha warpall");
}
return true;
}
}else{
p.sendMessage(ChatColor.RED + "You don't have permission!");
return true;
}
}else if(args[0].equalsIgnoreCase("Confirm")){
if(plugin.NeedConfirm.contains(pname)){
@ -165,32 +149,26 @@ public class HaCommands implements CommandExecutor {
if(plugin.Playing.size()== 24){
p.performCommand("ha warpall");
}
return true;
}
}else if(args[0].equalsIgnoreCase("Ready")){
if(plugin.Playing.contains(pname)){
if(plugin.Ready.contains(pname)){
p.sendMessage(ChatColor.RED + "You're already ready!");
return true;
}else if(plugin.Playing.size()== 1){
p.sendMessage(ChatColor.RED + "You can't be ready when no one else is playing!");
return true;
}else{
plugin.Ready.add(pname);
p.sendMessage(ChatColor.AQUA + "You have marked yourself as READY!");
if(plugin.Playing.size()-4== plugin.Ready.size()){
if(plugin.Playing.size()-4== plugin.Ready.size() || plugin.Playing.size()==plugin.Ready.size()){
Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), "ha warpall");
return true;
}
}
}else if(!plugin.Playing.contains(pname)){
p.sendMessage(ChatColor.RED + "You aren't playing!");
return true;
}
}else if(args[0].equalsIgnoreCase("Leave")){
if(!plugin.Playing.contains(pname)){
p.sendMessage(ChatColor.RED + "You aren't playing!");
return true;
}else if(plugin.canjoin== false){
plugin.Playing.remove(pname);
p.sendMessage(ChatColor.AQUA + "You have left the game!");
@ -204,7 +182,6 @@ public class HaCommands implements CommandExecutor {
if(plugin.Frozen.contains(pname)){
plugin.Frozen.remove(pname);
}
return true;
}else{
plugin.Playing.remove(pname);
plugin.Quit.add(pname);

View File

@ -41,15 +41,16 @@ public class Main extends JavaPlugin{
public CommandExecutor SpawnsCommand = new SpawnsCommand(this);
public boolean canjoin;
public boolean exists;
public FileConfiguration config = getConfig();
public FileConfiguration config;
public ItemStack Reward;
public ItemStack Cost;
public boolean vault = false;
public Economy econ = null;
public void onEnable(){
log.info("[HungerArena] enabled v" + getDescription().getVersion());
config = this.getConfig();
config.options().copyDefaults(true);
this.saveDefaultConfig();
log.info("[HungerArena] enabled v" + getDescription().getVersion());
getServer().getPluginManager().registerEvents(DeathListener, this);
getServer().getPluginManager().registerEvents(SpectatorListener, this);
getServer().getPluginManager().registerEvents(FreezeListener, this);

View File

@ -19,16 +19,16 @@ public class Signs implements Listener {
public void Sign(PlayerInteractEvent event){
Player p = event.getPlayer();
Block b = event.getClickedBlock();
if (b == null) {
return;
}
if (b == null) {
return;
}
if(event.getAction()== Action.RIGHT_CLICK_BLOCK){
if(b.getType()== Material.SIGN || b.getType()==Material.SIGN_POST || b.getType()==Material.WALL_SIGN){
org.bukkit.block.Sign sign = (org.bukkit.block.Sign) b.getState();
String line1 = sign.getLine(0);
String line2 = sign.getLine(1);
String line3 = sign.getLine(2);
String line4 = sign.getLine(3);
String line2 = sign.getLine(1);
String line3 = sign.getLine(2);
String line4 = sign.getLine(3);
if(line1.equalsIgnoreCase(ChatColor.BLUE + "[HungerArena]") || line1.equalsIgnoreCase(ChatColor.BLUE + "[HA]")){
if(line2.equals("")){
p.performCommand("ha");