Should run smooth now
This commit is contained in:
parent
e7e96bd2d8
commit
95d6bfe9c5
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
12
config.yml
12
config.yml
@ -1,10 +1,7 @@
|
|||||||
# default config.yml
|
# default config.yml
|
||||||
<<<<<<< HEAD
|
|
||||||
=======
|
|
||||||
#config version for us devs. DONT CHANGE THIS, or it will screw up some things PRETTY badly.
|
#config version for us devs. DONT CHANGE THIS, or it will screw up some things PRETTY badly.
|
||||||
config:
|
config:
|
||||||
version: 1.3
|
version: 1.3
|
||||||
>>>>>>> de44f825be59d96da77136bf1dd2b26fc23d09b7
|
|
||||||
# Message to display when the games start
|
# Message to display when the games start
|
||||||
Start_Message: '&bLet The Games Begin!'
|
Start_Message: '&bLet The Games Begin!'
|
||||||
# If the games should automatically restart at the end
|
# If the games should automatically restart at the end
|
||||||
@ -13,11 +10,8 @@ Auto_Restart: 'false'
|
|||||||
Auto_Start: 'false'
|
Auto_Start: 'false'
|
||||||
# If tributes need to type /ha confirm to join
|
# If tributes need to type /ha confirm to join
|
||||||
Need_Confirm: 'true'
|
Need_Confirm: 'true'
|
||||||
<<<<<<< HEAD
|
|
||||||
# Not yet implemented
|
# Not yet implemented
|
||||||
iConomy_Support: 'false'
|
iConomy_Support: 'false'
|
||||||
=======
|
|
||||||
>>>>>>> de44f825be59d96da77136bf1dd2b26fc23d09b7
|
|
||||||
# What the reward for winning is
|
# What the reward for winning is
|
||||||
Reward:
|
Reward:
|
||||||
ID: 264
|
ID: 264
|
||||||
@ -30,11 +24,8 @@ Sponsor_Cost:
|
|||||||
Countdown: 'true'
|
Countdown: 'true'
|
||||||
Spawn_coords: 100,100,100,world
|
Spawn_coords: 100,100,100,world
|
||||||
# If players will only talk to close players of the whole server
|
# If players will only talk to close players of the whole server
|
||||||
<<<<<<< HEAD
|
|
||||||
ChatClose: 'true'
|
ChatClose: 'true'
|
||||||
=======
|
|
||||||
ChatClose: 'false'
|
ChatClose: 'false'
|
||||||
>>>>>>> de44f825be59d96da77136bf1dd2b26fc23d09b7
|
|
||||||
# How close the players have to be to talk to them
|
# How close the players have to be to talk to them
|
||||||
ChatClose_Radius: 10
|
ChatClose_Radius: 10
|
||||||
# Whether or not players can break blocks while playing
|
# 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
|
Tribute_twentyfour_spawn: 100,100,100
|
||||||
# If /ha setspawn has been run
|
# If /ha setspawn has been run
|
||||||
Spawn_set: 'false'
|
Spawn_set: 'false'
|
||||||
<<<<<<< HEAD
|
|
||||||
=======
|
|
||||||
# True means give money to winner, false means don't.
|
# True means give money to winner, false means don't.
|
||||||
eco:
|
eco:
|
||||||
enabled: false
|
enabled: false
|
||||||
reward: 100
|
reward: 100
|
||||||
# How much money to give the winner.
|
# How much money to give the winner.
|
||||||
# Leave this. :)
|
# Leave this. :)
|
||||||
>>>>>>> de44f825be59d96da77136bf1dd2b26fc23d09b7
|
|
||||||
Blocks_Destroyed:
|
Blocks_Destroyed:
|
17
plugin.yml
17
plugin.yml
@ -1,8 +1,8 @@
|
|||||||
name: HungerArena
|
name: HungerArena
|
||||||
<<<<<<< HEAD
|
|
||||||
main: me.Travja.HungerArena.Main
|
main: me.Travja.HungerArena.Main
|
||||||
version: 1.3alpha
|
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:
|
commands:
|
||||||
Ha:
|
Ha:
|
||||||
description: Makes you join a game or start the game!
|
description: Makes you join a game or start the game!
|
||||||
@ -10,16 +10,3 @@ commands:
|
|||||||
description: Sets the starting point of a tribute.
|
description: Sets the starting point of a tribute.
|
||||||
Sponsor:
|
Sponsor:
|
||||||
description: Sponsors a Tribute
|
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
|
|
||||||
|
@ -4,6 +4,7 @@ import java.util.List;
|
|||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Material;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.block.Chest;
|
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 + "/ha rlist - See who's ready!");
|
||||||
sender.sendMessage(c + "/startpoint [1,2,3,4,etc] - Sets the starting points of tributes!");
|
sender.sendMessage(c + "/startpoint [1,2,3,4,etc] - Sets the starting points of tributes!");
|
||||||
sender.sendMessage(ChatColor.GREEN + "----------------------");
|
sender.sendMessage(ChatColor.GREEN + "----------------------");
|
||||||
return true;
|
|
||||||
}else if(args[0].equalsIgnoreCase("List")){
|
}else if(args[0].equalsIgnoreCase("List")){
|
||||||
if(p.hasPermission("HungerArena.GameMaker")){
|
if(p.hasPermission("HungerArena.GameMaker")){
|
||||||
sender.sendMessage(ChatColor.AQUA + "-----People Playing-----");
|
sender.sendMessage(ChatColor.AQUA + "-----People Playing-----");
|
||||||
if(!plugin.Playing.isEmpty()){
|
if(!plugin.Playing.isEmpty()){
|
||||||
for(String playernames: plugin.Playing){
|
for(String playernames: plugin.Playing){
|
||||||
Player players = plugin.getServer().getPlayerExact(playernames);
|
Player players = plugin.getServer().getPlayerExact(playernames);
|
||||||
p.sendMessage(ChatColor.GREEN + playernames + " Life: " + players.getHealth() + "/20");
|
sender.sendMessage(ChatColor.GREEN + playernames + " Life: " + players.getHealth() + "/20");
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}else if(plugin.Playing.isEmpty()){
|
}else if(plugin.Playing.isEmpty()){
|
||||||
p.sendMessage(ChatColor.GRAY + "No one is playing!");
|
p.sendMessage(ChatColor.GRAY + "No one is playing!");
|
||||||
}
|
}
|
||||||
p.sendMessage(ChatColor.AQUA + "----------------------");
|
p.sendMessage(ChatColor.AQUA + "----------------------");
|
||||||
return true;
|
|
||||||
}else{
|
}else{
|
||||||
p.sendMessage(ChatColor.RED + "You don't have permission!");
|
p.sendMessage(ChatColor.RED + "You don't have permission!");
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}else if(args[0].equalsIgnoreCase("rList")){
|
}else if(args[0].equalsIgnoreCase("rList")){
|
||||||
if(p.hasPermission("HungerArena.GameMaker")){
|
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.GRAY + "No one is ready!");
|
||||||
}
|
}
|
||||||
p.sendMessage(ChatColor.AQUA + "---------------------");
|
p.sendMessage(ChatColor.AQUA + "---------------------");
|
||||||
return true;
|
|
||||||
}else{
|
}else{
|
||||||
p.sendMessage(ChatColor.RED + "You don't have permission!");
|
p.sendMessage(ChatColor.RED + "You don't have permission!");
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}else if(args[0].equalsIgnoreCase("SetSpawn")){
|
}else if(args[0].equalsIgnoreCase("SetSpawn")){
|
||||||
if(p.hasPermission("HungerArena.SetSpawn")){
|
if(p.hasPermission("HungerArena.SetSpawn")){
|
||||||
@ -105,35 +100,26 @@ public class HaCommands implements CommandExecutor {
|
|||||||
plugin.config.set("Spawns_set", "true");
|
plugin.config.set("Spawns_set", "true");
|
||||||
plugin.saveConfig();
|
plugin.saveConfig();
|
||||||
p.sendMessage(ChatColor.AQUA + "You have set the spawn for dead tributes!");
|
p.sendMessage(ChatColor.AQUA + "You have set the spawn for dead tributes!");
|
||||||
return true;
|
|
||||||
}else{
|
}else{
|
||||||
p.sendMessage(ChatColor.RED + "You don't have permission!");
|
p.sendMessage(ChatColor.RED + "You don't have permission!");
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}else if(args[0].equalsIgnoreCase("Join")){
|
}else if(args[0].equalsIgnoreCase("Join")){
|
||||||
if(p.hasPermission("HungerArena.Join")){
|
if(p.hasPermission("HungerArena.Join")){
|
||||||
if(plugin.Playing.contains(pname)){
|
if(plugin.Playing.contains(pname)){
|
||||||
p.sendMessage(ChatColor.RED + "You are already playing!");
|
p.sendMessage(ChatColor.RED + "You are already playing!");
|
||||||
return true;
|
|
||||||
}else if(plugin.Dead.contains(pname) || plugin.Quit.contains(pname)){
|
}else if(plugin.Dead.contains(pname) || plugin.Quit.contains(pname)){
|
||||||
p.sendMessage(ChatColor.RED + "You DIED/QUIT! You can't join again!");
|
p.sendMessage(ChatColor.RED + "You DIED/QUIT! You can't join again!");
|
||||||
return true;
|
|
||||||
}else if(plugin.Playing.size()== 24){
|
}else if(plugin.Playing.size()== 24){
|
||||||
p.sendMessage(ChatColor.RED + "There are already 24 Tributes!");
|
p.sendMessage(ChatColor.RED + "There are already 24 Tributes!");
|
||||||
return true;
|
|
||||||
}else if(plugin.canjoin== true){
|
}else if(plugin.canjoin== true){
|
||||||
p.sendMessage(ChatColor.RED + "The game is in progress!");
|
p.sendMessage(ChatColor.RED + "The game is in progress!");
|
||||||
return true;
|
|
||||||
}else if(plugin.config.getString("Spawns_set").equalsIgnoreCase("false")){
|
}else if(plugin.config.getString("Spawns_set").equalsIgnoreCase("false")){
|
||||||
p.sendMessage(ChatColor.RED + "/ha setspawn hasn't been run!");
|
p.sendMessage(ChatColor.RED + "/ha setspawn hasn't been run!");
|
||||||
return true;
|
|
||||||
}else if(plugin.NeedConfirm.contains(pname)){
|
}else if(plugin.NeedConfirm.contains(pname)){
|
||||||
p.sendMessage(ChatColor.RED + "You need to do /ha confirm");
|
p.sendMessage(ChatColor.RED + "You need to do /ha confirm");
|
||||||
return true;
|
|
||||||
}else if(plugin.config.getString("Need_Confirm").equalsIgnoreCase("true")){
|
}else if(plugin.config.getString("Need_Confirm").equalsIgnoreCase("true")){
|
||||||
plugin.NeedConfirm.add(pname);
|
plugin.NeedConfirm.add(pname);
|
||||||
p.sendMessage(ChatColor.GOLD + "You're inventory will be cleared! Type /ha confirm to procede");
|
p.sendMessage(ChatColor.GOLD + "You're inventory will be cleared! Type /ha confirm to procede");
|
||||||
return true;
|
|
||||||
}else{
|
}else{
|
||||||
plugin.Playing.add(pname);
|
plugin.Playing.add(pname);
|
||||||
p.getInventory().clear();
|
p.getInventory().clear();
|
||||||
@ -145,11 +131,9 @@ public class HaCommands implements CommandExecutor {
|
|||||||
if(plugin.Playing.size()== 24){
|
if(plugin.Playing.size()== 24){
|
||||||
p.performCommand("ha warpall");
|
p.performCommand("ha warpall");
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
p.sendMessage(ChatColor.RED + "You don't have permission!");
|
p.sendMessage(ChatColor.RED + "You don't have permission!");
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}else if(args[0].equalsIgnoreCase("Confirm")){
|
}else if(args[0].equalsIgnoreCase("Confirm")){
|
||||||
if(plugin.NeedConfirm.contains(pname)){
|
if(plugin.NeedConfirm.contains(pname)){
|
||||||
@ -165,32 +149,26 @@ public class HaCommands implements CommandExecutor {
|
|||||||
if(plugin.Playing.size()== 24){
|
if(plugin.Playing.size()== 24){
|
||||||
p.performCommand("ha warpall");
|
p.performCommand("ha warpall");
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}else if(args[0].equalsIgnoreCase("Ready")){
|
}else if(args[0].equalsIgnoreCase("Ready")){
|
||||||
if(plugin.Playing.contains(pname)){
|
if(plugin.Playing.contains(pname)){
|
||||||
if(plugin.Ready.contains(pname)){
|
if(plugin.Ready.contains(pname)){
|
||||||
p.sendMessage(ChatColor.RED + "You're already ready!");
|
p.sendMessage(ChatColor.RED + "You're already ready!");
|
||||||
return true;
|
|
||||||
}else if(plugin.Playing.size()== 1){
|
}else if(plugin.Playing.size()== 1){
|
||||||
p.sendMessage(ChatColor.RED + "You can't be ready when no one else is playing!");
|
p.sendMessage(ChatColor.RED + "You can't be ready when no one else is playing!");
|
||||||
return true;
|
|
||||||
}else{
|
}else{
|
||||||
plugin.Ready.add(pname);
|
plugin.Ready.add(pname);
|
||||||
p.sendMessage(ChatColor.AQUA + "You have marked yourself as READY!");
|
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");
|
Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), "ha warpall");
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else if(!plugin.Playing.contains(pname)){
|
}else if(!plugin.Playing.contains(pname)){
|
||||||
p.sendMessage(ChatColor.RED + "You aren't playing!");
|
p.sendMessage(ChatColor.RED + "You aren't playing!");
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}else if(args[0].equalsIgnoreCase("Leave")){
|
}else if(args[0].equalsIgnoreCase("Leave")){
|
||||||
if(!plugin.Playing.contains(pname)){
|
if(!plugin.Playing.contains(pname)){
|
||||||
p.sendMessage(ChatColor.RED + "You aren't playing!");
|
p.sendMessage(ChatColor.RED + "You aren't playing!");
|
||||||
return true;
|
|
||||||
}else if(plugin.canjoin== false){
|
}else if(plugin.canjoin== false){
|
||||||
plugin.Playing.remove(pname);
|
plugin.Playing.remove(pname);
|
||||||
p.sendMessage(ChatColor.AQUA + "You have left the game!");
|
p.sendMessage(ChatColor.AQUA + "You have left the game!");
|
||||||
@ -204,7 +182,6 @@ public class HaCommands implements CommandExecutor {
|
|||||||
if(plugin.Frozen.contains(pname)){
|
if(plugin.Frozen.contains(pname)){
|
||||||
plugin.Frozen.remove(pname);
|
plugin.Frozen.remove(pname);
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}else{
|
}else{
|
||||||
plugin.Playing.remove(pname);
|
plugin.Playing.remove(pname);
|
||||||
plugin.Quit.add(pname);
|
plugin.Quit.add(pname);
|
||||||
|
@ -41,15 +41,16 @@ public class Main extends JavaPlugin{
|
|||||||
public CommandExecutor SpawnsCommand = new SpawnsCommand(this);
|
public CommandExecutor SpawnsCommand = new SpawnsCommand(this);
|
||||||
public boolean canjoin;
|
public boolean canjoin;
|
||||||
public boolean exists;
|
public boolean exists;
|
||||||
public FileConfiguration config = getConfig();
|
public FileConfiguration config;
|
||||||
public ItemStack Reward;
|
public ItemStack Reward;
|
||||||
public ItemStack Cost;
|
public ItemStack Cost;
|
||||||
public boolean vault = false;
|
public boolean vault = false;
|
||||||
public Economy econ = null;
|
public Economy econ = null;
|
||||||
public void onEnable(){
|
public void onEnable(){
|
||||||
log.info("[HungerArena] enabled v" + getDescription().getVersion());
|
config = this.getConfig();
|
||||||
config.options().copyDefaults(true);
|
config.options().copyDefaults(true);
|
||||||
this.saveDefaultConfig();
|
this.saveDefaultConfig();
|
||||||
|
log.info("[HungerArena] enabled v" + getDescription().getVersion());
|
||||||
getServer().getPluginManager().registerEvents(DeathListener, this);
|
getServer().getPluginManager().registerEvents(DeathListener, this);
|
||||||
getServer().getPluginManager().registerEvents(SpectatorListener, this);
|
getServer().getPluginManager().registerEvents(SpectatorListener, this);
|
||||||
getServer().getPluginManager().registerEvents(FreezeListener, this);
|
getServer().getPluginManager().registerEvents(FreezeListener, this);
|
||||||
|
@ -19,16 +19,16 @@ public class Signs implements Listener {
|
|||||||
public void Sign(PlayerInteractEvent event){
|
public void Sign(PlayerInteractEvent event){
|
||||||
Player p = event.getPlayer();
|
Player p = event.getPlayer();
|
||||||
Block b = event.getClickedBlock();
|
Block b = event.getClickedBlock();
|
||||||
if (b == null) {
|
if (b == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(event.getAction()== Action.RIGHT_CLICK_BLOCK){
|
if(event.getAction()== Action.RIGHT_CLICK_BLOCK){
|
||||||
if(b.getType()== Material.SIGN || b.getType()==Material.SIGN_POST || b.getType()==Material.WALL_SIGN){
|
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();
|
org.bukkit.block.Sign sign = (org.bukkit.block.Sign) b.getState();
|
||||||
String line1 = sign.getLine(0);
|
String line1 = sign.getLine(0);
|
||||||
String line2 = sign.getLine(1);
|
String line2 = sign.getLine(1);
|
||||||
String line3 = sign.getLine(2);
|
String line3 = sign.getLine(2);
|
||||||
String line4 = sign.getLine(3);
|
String line4 = sign.getLine(3);
|
||||||
if(line1.equalsIgnoreCase(ChatColor.BLUE + "[HungerArena]") || line1.equalsIgnoreCase(ChatColor.BLUE + "[HA]")){
|
if(line1.equalsIgnoreCase(ChatColor.BLUE + "[HungerArena]") || line1.equalsIgnoreCase(ChatColor.BLUE + "[HA]")){
|
||||||
if(line2.equals("")){
|
if(line2.equals("")){
|
||||||
p.performCommand("ha");
|
p.performCommand("ha");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user