Many bug fixes and more configuration
This commit is contained in:
parent
ec10159a2b
commit
872448d92a
@ -2,7 +2,7 @@
|
|||||||
<classpath>
|
<classpath>
|
||||||
<classpathentry kind="src" path="src"/>
|
<classpathentry kind="src" path="src"/>
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
|
||||||
<classpathentry kind="lib" path="C:/Documents and Settings/TJ/Desktop/bukkit-1.2.5-R0.1-20120330.213519-1.jar"/>
|
|
||||||
<classpathentry kind="lib" path="C:/Documents and Settings/TJ/Desktop/iConomy.jar"/>
|
<classpathentry kind="lib" path="C:/Documents and Settings/TJ/Desktop/iConomy.jar"/>
|
||||||
|
<classpathentry kind="lib" path="C:/Documents and Settings/TJ/Desktop/bukkit-1.2.5-R1.4-20120509.221906-5.jar"/>
|
||||||
<classpathentry kind="output" path="bin"/>
|
<classpathentry kind="output" path="bin"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
bin/me/Travja/HungerArena/HaCommands$12.class
Normal file
BIN
bin/me/Travja/HungerArena/HaCommands$12.class
Normal file
Binary file not shown.
BIN
bin/me/Travja/HungerArena/HaCommands$13.class
Normal file
BIN
bin/me/Travja/HungerArena/HaCommands$13.class
Normal file
Binary file not shown.
BIN
bin/me/Travja/HungerArena/HaCommands$14.class
Normal file
BIN
bin/me/Travja/HungerArena/HaCommands$14.class
Normal file
Binary file not shown.
BIN
bin/me/Travja/HungerArena/HaCommands$15.class
Normal file
BIN
bin/me/Travja/HungerArena/HaCommands$15.class
Normal file
Binary file not shown.
BIN
bin/me/Travja/HungerArena/HaCommands$16.class
Normal file
BIN
bin/me/Travja/HungerArena/HaCommands$16.class
Normal file
Binary file not shown.
BIN
bin/me/Travja/HungerArena/HaCommands$17.class
Normal file
BIN
bin/me/Travja/HungerArena/HaCommands$17.class
Normal file
Binary file not shown.
BIN
bin/me/Travja/HungerArena/HaCommands$18.class
Normal file
BIN
bin/me/Travja/HungerArena/HaCommands$18.class
Normal file
Binary file not shown.
BIN
bin/me/Travja/HungerArena/HaCommands$19.class
Normal file
BIN
bin/me/Travja/HungerArena/HaCommands$19.class
Normal file
Binary file not shown.
Binary file not shown.
BIN
bin/me/Travja/HungerArena/HaCommands$20.class
Normal file
BIN
bin/me/Travja/HungerArena/HaCommands$20.class
Normal file
Binary file not shown.
BIN
bin/me/Travja/HungerArena/HaCommands$21.class
Normal file
BIN
bin/me/Travja/HungerArena/HaCommands$21.class
Normal file
Binary file not shown.
BIN
bin/me/Travja/HungerArena/HaCommands$22.class
Normal file
BIN
bin/me/Travja/HungerArena/HaCommands$22.class
Normal file
Binary file not shown.
BIN
bin/me/Travja/HungerArena/HaCommands$23.class
Normal file
BIN
bin/me/Travja/HungerArena/HaCommands$23.class
Normal file
Binary file not shown.
BIN
bin/me/Travja/HungerArena/HaCommands$24.class
Normal file
BIN
bin/me/Travja/HungerArena/HaCommands$24.class
Normal file
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.
11
config.yml
11
config.yml
@ -1,7 +1,15 @@
|
|||||||
# default config.yml
|
# default config.yml
|
||||||
|
# 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
|
||||||
Auto_Restart: 'false'
|
Auto_Restart: 'false'
|
||||||
|
# If it should automatically start the countdown on warping
|
||||||
|
Auto_Start: 'false'
|
||||||
|
# If tributes need to type /ha confirm to join
|
||||||
|
Need_Confirm: 'true'
|
||||||
|
# Not yet implemented
|
||||||
iConomy_Support: 'false'
|
iConomy_Support: 'false'
|
||||||
|
# What the reward for winning is
|
||||||
Reward:
|
Reward:
|
||||||
ID: 264
|
ID: 264
|
||||||
Amount: 10
|
Amount: 10
|
||||||
@ -46,4 +54,5 @@ Tribute_twentyone_spawn: 100,100,100
|
|||||||
Tribute_twentytwo_spawn: 100,100,100
|
Tribute_twentytwo_spawn: 100,100,100
|
||||||
Tribute_twentythree_spawn: 100,100,100
|
Tribute_twentythree_spawn: 100,100,100
|
||||||
Tribute_twentyfour_spawn: 100,100,100
|
Tribute_twentyfour_spawn: 100,100,100
|
||||||
Spawn_set: false
|
# If /ha setspawn has been run
|
||||||
|
Spawn_set: 'false'
|
@ -24,9 +24,9 @@ public class ChatListener implements Listener {
|
|||||||
List<Entity> near = p.getNearbyEntities(radius, radius, radius);
|
List<Entity> near = p.getNearbyEntities(radius, radius, radius);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
if(!(near.size()== 0)){
|
if(!(near.size()== 0)){
|
||||||
|
p.sendMessage(msg);
|
||||||
for(Entity e:near){
|
for(Entity e:near){
|
||||||
if(e instanceof Player){
|
if(e instanceof Player){
|
||||||
p.sendMessage(msg);
|
|
||||||
((Player) e).sendMessage(msg);
|
((Player) e).sendMessage(msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -42,6 +42,7 @@ public class ChatListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
|
event.setCancelled(true);
|
||||||
plugin.getServer().broadcastMessage(msg);
|
plugin.getServer().broadcastMessage(msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ public class CommandBlock implements Listener {
|
|||||||
public void CatchCommand(PlayerCommandPreprocessEvent event){
|
public void CatchCommand(PlayerCommandPreprocessEvent event){
|
||||||
String cmd = event.getMessage();
|
String cmd = event.getMessage();
|
||||||
Player p = event.getPlayer();
|
Player p = event.getPlayer();
|
||||||
if(!cmd.contains("/ha") && plugin.Playing.contains(p)){
|
if(!cmd.contains("/ha") && plugin.Playing.contains(p) && plugin.canjoin== true){
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
p.sendMessage(ChatColor.RED + "You are only allowed to use /ha commands!");
|
p.sendMessage(ChatColor.RED + "You are only allowed to use /ha commands!");
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package me.Travja.HungerArena;
|
package me.Travja.HungerArena;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Effect;
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.Server;
|
import org.bukkit.Server;
|
||||||
@ -24,7 +23,7 @@ public class DeathListener implements Listener{
|
|||||||
Player p = event.getPlayer();
|
Player p = event.getPlayer();
|
||||||
if(plugin.Dead.contains(p)){
|
if(plugin.Dead.contains(p)){
|
||||||
String[] Spawncoords = plugin.config.getString("Spawn_coords").split(",");
|
String[] Spawncoords = plugin.config.getString("Spawn_coords").split(",");
|
||||||
World spawnw = p.getWorld();
|
World spawnw = plugin.getServer().getWorld(Spawncoords[3]);
|
||||||
double spawnx = Double.parseDouble(Spawncoords[0]);
|
double spawnx = Double.parseDouble(Spawncoords[0]);
|
||||||
double spawny = Double.parseDouble(Spawncoords[1]);
|
double spawny = Double.parseDouble(Spawncoords[1]);
|
||||||
double spawnz = Double.parseDouble(Spawncoords[2]);
|
double spawnz = Double.parseDouble(Spawncoords[2]);
|
||||||
@ -37,9 +36,20 @@ public class DeathListener implements Listener{
|
|||||||
Player p = event.getEntity();
|
Player p = event.getEntity();
|
||||||
Server s = p.getServer();
|
Server s = p.getServer();
|
||||||
String pname = p.getName();
|
String pname = p.getName();
|
||||||
|
String[] Spawncoords = plugin.config.getString("Spawn_coords").split(",");
|
||||||
|
World spawnw = plugin.getServer().getWorld(Spawncoords[3]);
|
||||||
|
double spawnx = Double.parseDouble(Spawncoords[0]);
|
||||||
|
double spawny = Double.parseDouble(Spawncoords[1]);
|
||||||
|
double spawnz = Double.parseDouble(Spawncoords[2]);
|
||||||
|
Location Spawn = new Location(spawnw, spawnx, spawny, spawnz);
|
||||||
if(plugin.Playing.contains(p)){
|
if(plugin.Playing.contains(p)){
|
||||||
if(plugin.config.getString("Cannon_Death").equalsIgnoreCase("True")){
|
if(plugin.config.getString("Cannon_Death").equalsIgnoreCase("True")){
|
||||||
p.getWorld().playEffect(p.getLocation(), Effect.ZOMBIE_CHEW_WOODEN_DOOR, 0, 300);
|
double y = p.getLocation().getY();
|
||||||
|
double newy = y+200;
|
||||||
|
double x = p.getLocation().getX();
|
||||||
|
double z = p.getLocation().getZ();
|
||||||
|
Location strike = new Location(p.getWorld(), x, newy, z);
|
||||||
|
p.getWorld().strikeLightning(strike);
|
||||||
}
|
}
|
||||||
plugin.Dead.add(p);
|
plugin.Dead.add(p);
|
||||||
plugin.Playing.remove(p);
|
plugin.Playing.remove(p);
|
||||||
@ -56,21 +66,23 @@ public class DeathListener implements Listener{
|
|||||||
String winnername = winner.getName();
|
String winnername = winner.getName();
|
||||||
s.broadcastMessage(ChatColor.GREEN + winnername + " is the victor of this Hunger Games!");
|
s.broadcastMessage(ChatColor.GREEN + winnername + " is the victor of this Hunger Games!");
|
||||||
winner.getInventory().clear();
|
winner.getInventory().clear();
|
||||||
|
winner.teleport(Spawn);
|
||||||
winner.getInventory().setBoots(null);
|
winner.getInventory().setBoots(null);
|
||||||
winner.getInventory().setChestplate(null);
|
winner.getInventory().setChestplate(null);
|
||||||
winner.getInventory().setHelmet(null);
|
winner.getInventory().setHelmet(null);
|
||||||
winner.getInventory().setLeggings(null);
|
winner.getInventory().setLeggings(null);
|
||||||
winner.getInventory().addItem(plugin.Reward);
|
winner.getInventory().addItem(plugin.Reward);
|
||||||
}
|
}
|
||||||
|
plugin.Playing.clear();
|
||||||
for(Player spectator:plugin.Watching){
|
for(Player spectator:plugin.Watching){
|
||||||
spectator.setAllowFlight(false);
|
spectator.setAllowFlight(false);
|
||||||
|
spectator.teleport(Spawn);
|
||||||
for(Player online:plugin.getServer().getOnlinePlayers()){
|
for(Player online:plugin.getServer().getOnlinePlayers()){
|
||||||
online.showPlayer(spectator);
|
online.showPlayer(spectator);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(plugin.config.getString("Auto_Restart").equalsIgnoreCase("True")){
|
if(plugin.config.getString("Auto_Restart").equalsIgnoreCase("True")){
|
||||||
plugin.Dead.clear();
|
plugin.Dead.clear();
|
||||||
plugin.Playing.clear();
|
|
||||||
plugin.Quit.clear();
|
plugin.Quit.clear();
|
||||||
plugin.Watching.clear();
|
plugin.Watching.clear();
|
||||||
plugin.Frozen.clear();
|
plugin.Frozen.clear();
|
||||||
@ -90,21 +102,23 @@ public class DeathListener implements Listener{
|
|||||||
String winnername = winner.getName();
|
String winnername = winner.getName();
|
||||||
s.broadcastMessage(ChatColor.GREEN + winnername + " is the victor of this Hunger Games!");
|
s.broadcastMessage(ChatColor.GREEN + winnername + " is the victor of this Hunger Games!");
|
||||||
winner.getInventory().clear();
|
winner.getInventory().clear();
|
||||||
|
winner.teleport(Spawn);
|
||||||
winner.getInventory().setBoots(null);
|
winner.getInventory().setBoots(null);
|
||||||
winner.getInventory().setChestplate(null);
|
winner.getInventory().setChestplate(null);
|
||||||
winner.getInventory().setHelmet(null);
|
winner.getInventory().setHelmet(null);
|
||||||
winner.getInventory().setLeggings(null);
|
winner.getInventory().setLeggings(null);
|
||||||
winner.getInventory().addItem(plugin.Reward);
|
winner.getInventory().addItem(plugin.Reward);
|
||||||
}
|
}
|
||||||
|
plugin.Playing.clear();
|
||||||
for(Player spectator:plugin.Watching){
|
for(Player spectator:plugin.Watching){
|
||||||
spectator.setAllowFlight(false);
|
spectator.setAllowFlight(false);
|
||||||
|
spectator.teleport(Spawn);
|
||||||
for(Player online:plugin.getServer().getOnlinePlayers()){
|
for(Player online:plugin.getServer().getOnlinePlayers()){
|
||||||
online.showPlayer(spectator);
|
online.showPlayer(spectator);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(plugin.config.getString("Auto_Restart").equalsIgnoreCase("True")){
|
if(plugin.config.getString("Auto_Restart").equalsIgnoreCase("True")){
|
||||||
plugin.Dead.clear();
|
plugin.Dead.clear();
|
||||||
plugin.Playing.clear();
|
|
||||||
plugin.Quit.clear();
|
plugin.Quit.clear();
|
||||||
plugin.Watching.clear();
|
plugin.Watching.clear();
|
||||||
plugin.Frozen.clear();
|
plugin.Frozen.clear();
|
||||||
@ -121,21 +135,23 @@ public class DeathListener implements Listener{
|
|||||||
String winnername = winner.getName();
|
String winnername = winner.getName();
|
||||||
s.broadcastMessage(ChatColor.GREEN + winnername + " is the victor of this Hunger Games!");
|
s.broadcastMessage(ChatColor.GREEN + winnername + " is the victor of this Hunger Games!");
|
||||||
winner.getInventory().clear();
|
winner.getInventory().clear();
|
||||||
|
winner.teleport(Spawn);
|
||||||
winner.getInventory().setBoots(null);
|
winner.getInventory().setBoots(null);
|
||||||
winner.getInventory().setChestplate(null);
|
winner.getInventory().setChestplate(null);
|
||||||
winner.getInventory().setHelmet(null);
|
winner.getInventory().setHelmet(null);
|
||||||
winner.getInventory().setLeggings(null);
|
winner.getInventory().setLeggings(null);
|
||||||
winner.getInventory().addItem(plugin.Reward);
|
winner.getInventory().addItem(plugin.Reward);
|
||||||
}
|
}
|
||||||
|
plugin.Playing.clear();
|
||||||
for(Player spectator:plugin.Watching){
|
for(Player spectator:plugin.Watching){
|
||||||
spectator.setAllowFlight(false);
|
spectator.setAllowFlight(false);
|
||||||
|
spectator.teleport(Spawn);
|
||||||
for(Player online:plugin.getServer().getOnlinePlayers()){
|
for(Player online:plugin.getServer().getOnlinePlayers()){
|
||||||
online.showPlayer(spectator);
|
online.showPlayer(spectator);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(plugin.config.getString("Auto_Restart").equalsIgnoreCase("True")){
|
if(plugin.config.getString("Auto_Restart").equalsIgnoreCase("True")){
|
||||||
plugin.Dead.clear();
|
plugin.Dead.clear();
|
||||||
plugin.Playing.clear();
|
|
||||||
plugin.Quit.clear();
|
plugin.Quit.clear();
|
||||||
plugin.Watching.clear();
|
plugin.Watching.clear();
|
||||||
plugin.Frozen.clear();
|
plugin.Frozen.clear();
|
||||||
|
@ -23,17 +23,18 @@ public class HaCommands implements CommandExecutor {
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args){
|
public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args){
|
||||||
|
if(sender instanceof Player){
|
||||||
Player p = (Player) sender;
|
Player p = (Player) sender;
|
||||||
String pname = p.getName();
|
String pname = p.getName();
|
||||||
ChatColor c = ChatColor.AQUA;
|
ChatColor c = ChatColor.AQUA;
|
||||||
if(cmd.getName().equalsIgnoreCase("Ha")){
|
if(cmd.getName().equalsIgnoreCase("Ha")){
|
||||||
if(args.length== 0){
|
if(args.length== 0){
|
||||||
sender.sendMessage(ChatColor.GREEN + "[HungerArena] by " + ChatColor.AQUA + "travja!");
|
p.sendMessage(ChatColor.GREEN + "[HungerArena] by " + ChatColor.AQUA + "travja!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if(args[0].equalsIgnoreCase("Help")){
|
if(args[0].equalsIgnoreCase("Help")){
|
||||||
sender.sendMessage(ChatColor.GREEN + "----HungerArena Help----");
|
p.sendMessage(ChatColor.GREEN + "----HungerArena Help----");
|
||||||
sender.sendMessage(c + "/ha - Displays author message!");
|
p.sendMessage(c + "/ha - Displays author message!");
|
||||||
sender.sendMessage(c + "/ha help - Displays this screen!");
|
sender.sendMessage(c + "/ha help - Displays this screen!");
|
||||||
sender.sendMessage(c + "/ha join - Makes you join the game!");
|
sender.sendMessage(c + "/ha join - Makes you join the game!");
|
||||||
sender.sendMessage(c + "/ha leave - Makes you leave the game!");
|
sender.sendMessage(c + "/ha leave - Makes you leave the game!");
|
||||||
@ -51,7 +52,7 @@ public class HaCommands implements CommandExecutor {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if(args[0].equalsIgnoreCase("List")){
|
if(args[0].equalsIgnoreCase("List")){
|
||||||
if(sender instanceof ConsoleCommandSender){
|
if(p.hasPermission("HungerArena.GameMaker") || sender instanceof ConsoleCommandSender){
|
||||||
sender.sendMessage(ChatColor.AQUA + "-----People Playing-----");
|
sender.sendMessage(ChatColor.AQUA + "-----People Playing-----");
|
||||||
for(Player players:plugin.Playing){
|
for(Player players:plugin.Playing){
|
||||||
sender.sendMessage(ChatColor.GREEN + players.getDisplayName() + " Life: " + players.getHealth() + "/20");
|
sender.sendMessage(ChatColor.GREEN + players.getDisplayName() + " Life: " + players.getHealth() + "/20");
|
||||||
@ -60,22 +61,14 @@ public class HaCommands implements CommandExecutor {
|
|||||||
sender.sendMessage(ChatColor.GRAY + "No one is playing!");
|
sender.sendMessage(ChatColor.GRAY + "No one is playing!");
|
||||||
}
|
}
|
||||||
sender.sendMessage(ChatColor.AQUA + "----------------------");
|
sender.sendMessage(ChatColor.AQUA + "----------------------");
|
||||||
}
|
|
||||||
if(p.hasPermission("HungerArena.GameMaker")){
|
|
||||||
p.sendMessage(ChatColor.AQUA + "-----People Playing-----");
|
|
||||||
for(Player players:plugin.Playing){
|
|
||||||
p.sendMessage(ChatColor.GREEN + players.getDisplayName() + " Life: " + players.getHealth() + "/20");
|
|
||||||
}
|
|
||||||
if(plugin.Playing.size()== 0){
|
|
||||||
p.sendMessage(ChatColor.GRAY + "No one is playing!");
|
|
||||||
}
|
|
||||||
p.sendMessage(ChatColor.AQUA + "----------------------");
|
|
||||||
}else{
|
}else{
|
||||||
p.sendMessage(ChatColor.RED + "You don't have permission!");
|
sender.sendMessage(ChatColor.RED + "You don't have permission!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(args[0].equalsIgnoreCase("SetSpawn")){
|
if(args[0].equalsIgnoreCase("SetSpawn")){
|
||||||
if(p.hasPermission("HungerArena.SetSpawn")){
|
if(sender instanceof ConsoleCommandSender){
|
||||||
|
sender.sendMessage(ChatColor.RED + "That can only be run by a player!");
|
||||||
|
}else if(p.hasPermission("HungerArena.SetSpawn")){
|
||||||
double x = p.getLocation().getX();
|
double x = p.getLocation().getX();
|
||||||
double y = p.getLocation().getY();
|
double y = p.getLocation().getY();
|
||||||
double z = p.getLocation().getZ();
|
double z = p.getLocation().getZ();
|
||||||
@ -96,7 +89,9 @@ public class HaCommands implements CommandExecutor {
|
|||||||
World spawnw = plugin.getServer().getWorld(spawnworld);
|
World spawnw = plugin.getServer().getWorld(spawnworld);
|
||||||
Location Spawn = new Location(spawnw, spawnx, spawny, spawnz);
|
Location Spawn = new Location(spawnw, spawnx, spawny, spawnz);
|
||||||
if(args[0].equalsIgnoreCase("Join")){
|
if(args[0].equalsIgnoreCase("Join")){
|
||||||
if(p.hasPermission("HungerArena.Join")){
|
if(sender instanceof ConsoleCommandSender){
|
||||||
|
sender.sendMessage(ChatColor.RED + "That can only be run by a player!");
|
||||||
|
}else if(p.hasPermission("HungerArena.Join")){
|
||||||
if(plugin.Playing.contains(p)){
|
if(plugin.Playing.contains(p)){
|
||||||
p.sendMessage(ChatColor.RED + "You are already playing!");
|
p.sendMessage(ChatColor.RED + "You are already playing!");
|
||||||
}else if(plugin.Dead.contains(p) || plugin.Quit.contains(p)){
|
}else if(plugin.Dead.contains(p) || plugin.Quit.contains(p)){
|
||||||
@ -109,16 +104,29 @@ public class HaCommands implements CommandExecutor {
|
|||||||
p.sendMessage(ChatColor.RED + "/ha setspawn hasn't been run!");
|
p.sendMessage(ChatColor.RED + "/ha setspawn hasn't been run!");
|
||||||
}else if(plugin.NeedConfirm.contains(p)){
|
}else if(plugin.NeedConfirm.contains(p)){
|
||||||
p.sendMessage(ChatColor.RED + "You need to do /ha confirm");
|
p.sendMessage(ChatColor.RED + "You need to do /ha confirm");
|
||||||
}else{
|
}else if(plugin.config.getString("Need_Confirm").equalsIgnoreCase("true")){
|
||||||
plugin.NeedConfirm.add(p);
|
plugin.NeedConfirm.add(p);
|
||||||
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");
|
||||||
|
}else{
|
||||||
|
plugin.Playing.add(p);
|
||||||
|
p.getInventory().clear();
|
||||||
|
p.getInventory().setBoots(null);
|
||||||
|
p.getInventory().setChestplate(null);
|
||||||
|
p.getInventory().setHelmet(null);
|
||||||
|
p.getInventory().setLeggings(null);
|
||||||
|
plugin.getServer().broadcastMessage(ChatColor.AQUA + pname + " has Joined the Game!");
|
||||||
|
if(plugin.Playing.size()== 24){
|
||||||
|
p.performCommand("ha warpall");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
p.sendMessage(ChatColor.RED + "You don't have permission!");
|
p.sendMessage(ChatColor.RED + "You don't have permission!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(args[0].equalsIgnoreCase("Confirm")){
|
if(args[0].equalsIgnoreCase("Confirm")){
|
||||||
if(plugin.NeedConfirm.contains(p)){
|
if(sender instanceof ConsoleCommandSender){
|
||||||
|
sender.sendMessage(ChatColor.RED + "That can only be run by a player!");
|
||||||
|
}else if(plugin.NeedConfirm.contains(p)){
|
||||||
plugin.Playing.add(p);
|
plugin.Playing.add(p);
|
||||||
plugin.NeedConfirm.remove(p);
|
plugin.NeedConfirm.remove(p);
|
||||||
p.getInventory().clear();
|
p.getInventory().clear();
|
||||||
@ -133,18 +141,22 @@ public class HaCommands implements CommandExecutor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(args[0].equalsIgnoreCase("Ready")){
|
if(args[0].equalsIgnoreCase("Ready")){
|
||||||
if(plugin.Playing.contains(p)){
|
if(sender instanceof ConsoleCommandSender){
|
||||||
|
sender.sendMessage(ChatColor.RED + "That can only be run by a player!");
|
||||||
|
}else if(plugin.Playing.contains(p)){
|
||||||
plugin.Ready.add(p);
|
plugin.Ready.add(p);
|
||||||
p.sendMessage(ChatColor.AQUA + "You have marked yourself as READY!");
|
p.sendMessage(ChatColor.AQUA + "You have marked yourself as READY!");
|
||||||
if(plugin.Playing.size()== plugin.Ready.size()){
|
if(plugin.Playing.size()== plugin.Ready.size()){
|
||||||
p.performCommand("Ha Warpall");
|
Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), "ha warpall");
|
||||||
}
|
}
|
||||||
}else if(!plugin.Playing.contains(p)){
|
}else if(!plugin.Playing.contains(p)){
|
||||||
p.sendMessage(ChatColor.RED + "You aren't playing!");
|
p.sendMessage(ChatColor.RED + "You aren't playing!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(args[0].equalsIgnoreCase("Leave")){
|
if(args[0].equalsIgnoreCase("Leave")){
|
||||||
if(!plugin.Playing.contains(p)){
|
if(sender instanceof ConsoleCommandSender){
|
||||||
|
sender.sendMessage(ChatColor.RED + "That can only be run by a player!");
|
||||||
|
}else if(!plugin.Playing.contains(p)){
|
||||||
p.sendMessage(ChatColor.RED + "You aren't playing!");
|
p.sendMessage(ChatColor.RED + "You aren't playing!");
|
||||||
}else{
|
}else{
|
||||||
plugin.Playing.remove(p);
|
plugin.Playing.remove(p);
|
||||||
@ -176,7 +188,9 @@ public class HaCommands implements CommandExecutor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(args[0].equalsIgnoreCase("Watch")){
|
if(args[0].equalsIgnoreCase("Watch")){
|
||||||
if(p.hasPermission("HungerArena.Watch")){
|
if(sender instanceof ConsoleCommandSender){
|
||||||
|
sender.sendMessage(ChatColor.RED + "That can only be run by a player!");
|
||||||
|
}else if(sender.hasPermission("HungerArena.Watch")){
|
||||||
if(!plugin.Watching.contains(p) && !plugin.Playing.contains(p) && plugin.canjoin== true){
|
if(!plugin.Watching.contains(p) && !plugin.Playing.contains(p) && plugin.canjoin== true){
|
||||||
plugin.Watching.add(p);
|
plugin.Watching.add(p);
|
||||||
for(Player online:plugin.getServer().getOnlinePlayers()){
|
for(Player online:plugin.getServer().getOnlinePlayers()){
|
||||||
@ -195,15 +209,15 @@ public class HaCommands implements CommandExecutor {
|
|||||||
}
|
}
|
||||||
p.teleport(Spawn);
|
p.teleport(Spawn);
|
||||||
p.setAllowFlight(false);
|
p.setAllowFlight(false);
|
||||||
p.sendMessage(ChatColor.AQUA + "You are not spectating anymore");
|
sender.sendMessage(ChatColor.AQUA + "You are not spectating anymore");
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
p.sendMessage(ChatColor.RED + "You don't have permission!");
|
sender.sendMessage(ChatColor.RED + "You don't have permission!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(args[0].equalsIgnoreCase("Kick")){
|
if(args[0].equalsIgnoreCase("Kick")){
|
||||||
Player target = plugin.getServer().getPlayer(args[1]);
|
Player target = plugin.getServer().getPlayer(args[1]);
|
||||||
if(p.hasPermission("HungerArena.Kick")){
|
if(sender.hasPermission("HungerArena.Kick") || sender instanceof ConsoleCommandSender){
|
||||||
if(plugin.Playing.contains(target)){
|
if(plugin.Playing.contains(target)){
|
||||||
if(p.isOnline()){
|
if(p.isOnline()){
|
||||||
plugin.Playing.remove(target);
|
plugin.Playing.remove(target);
|
||||||
@ -218,7 +232,7 @@ public class HaCommands implements CommandExecutor {
|
|||||||
if(plugin.Playing.size()== 1 && plugin.canjoin== true){
|
if(plugin.Playing.size()== 1 && plugin.canjoin== true){
|
||||||
for(Player winner:plugin.Playing){
|
for(Player winner:plugin.Playing){
|
||||||
String winnername = winner.getName();
|
String winnername = winner.getName();
|
||||||
p.getServer().broadcastMessage(ChatColor.GREEN + winnername + " is the victor of this Hunger Games!");
|
sender.getServer().broadcastMessage(ChatColor.GREEN + winnername + " is the victor of this Hunger Games!");
|
||||||
winner.getInventory().clear();
|
winner.getInventory().clear();
|
||||||
winner.getInventory().addItem(plugin.Reward);
|
winner.getInventory().addItem(plugin.Reward);
|
||||||
}
|
}
|
||||||
@ -233,10 +247,10 @@ public class HaCommands implements CommandExecutor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
p.sendMessage(ChatColor.RED + "That player isn't in the game!");
|
sender.sendMessage(ChatColor.RED + "That player isn't in the game!");
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
p.sendMessage(ChatColor.RED + "You don't have permission!");
|
sender.sendMessage(ChatColor.RED + "You don't have permission!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(args[0].equalsIgnoreCase("Refill")){
|
if(args[0].equalsIgnoreCase("Refill")){
|
||||||
@ -267,11 +281,11 @@ public class HaCommands implements CommandExecutor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(limit== list056){
|
if(limit== list056){
|
||||||
p.sendMessage(ChatColor.GREEN + "All chests refilled!");
|
sender.sendMessage(ChatColor.GREEN + "All chests refilled!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(args[0].equalsIgnoreCase("Restart")){
|
if(args[0].equalsIgnoreCase("Restart")){
|
||||||
if(p.hasPermission("HungerArena.Restart")){
|
if(sender.hasPermission("HungerArena.Restart") || sender instanceof ConsoleCommandSender){
|
||||||
for(Player spectator:plugin.Watching){
|
for(Player spectator:plugin.Watching){
|
||||||
spectator.setAllowFlight(false);
|
spectator.setAllowFlight(false);
|
||||||
for(Player online:plugin.getServer().getOnlinePlayers()){
|
for(Player online:plugin.getServer().getOnlinePlayers()){
|
||||||
@ -284,22 +298,22 @@ public class HaCommands implements CommandExecutor {
|
|||||||
plugin.Watching.clear();
|
plugin.Watching.clear();
|
||||||
plugin.Frozen.clear();
|
plugin.Frozen.clear();
|
||||||
plugin.canjoin = false;
|
plugin.canjoin = false;
|
||||||
p.sendMessage(ChatColor.AQUA + "The games have been reset!");
|
sender.sendMessage(ChatColor.AQUA + "The games have been reset!");
|
||||||
}else{
|
}else{
|
||||||
p.sendMessage(ChatColor.RED + "You don't have permission!");
|
sender.sendMessage(ChatColor.RED + "You don't have permission!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(args[0].equalsIgnoreCase("Reload")){
|
if(args[0].equalsIgnoreCase("Reload")){
|
||||||
plugin.reloadConfig();
|
plugin.reloadConfig();
|
||||||
p.sendMessage(ChatColor.AQUA + "HungerArena Reloaded!");
|
sender.sendMessage(ChatColor.AQUA + "HungerArena Reloaded!");
|
||||||
}
|
}
|
||||||
if(args[0].equalsIgnoreCase("WarpAll")){
|
if(args[0].equalsIgnoreCase("WarpAll")){
|
||||||
if(p.hasPermission("HungerArena.Warpall")){
|
if(sender.hasPermission("HungerArena.Warpall") || sender instanceof ConsoleCommandSender){
|
||||||
if(plugin.config.getString("Spawns_set").equalsIgnoreCase("false")){
|
if(plugin.config.getString("Spawns_set").equalsIgnoreCase("false")){
|
||||||
p.sendMessage(ChatColor.RED + "/ha setspawn hasn't been run!");
|
sender.sendMessage(ChatColor.RED + "/ha setspawn hasn't been run!");
|
||||||
}else{
|
}else{
|
||||||
if(plugin.Playing.size()== 1){
|
if(plugin.Playing.size()== 1){
|
||||||
p.sendMessage(ChatColor.RED + "There are not enough players!");
|
sender.sendMessage(ChatColor.RED + "There are not enough players!");
|
||||||
}
|
}
|
||||||
if(plugin.Playing.size()>= 2){
|
if(plugin.Playing.size()>= 2){
|
||||||
plugin.config.getString("Tribute_one_spawn");
|
plugin.config.getString("Tribute_one_spawn");
|
||||||
@ -636,6 +650,15 @@ public class HaCommands implements CommandExecutor {
|
|||||||
plugin.Frozen.add(Tribute_twentyfour);
|
plugin.Frozen.add(Tribute_twentyfour);
|
||||||
Tribute_twentyfour.setFoodLevel(20);
|
Tribute_twentyfour.setFoodLevel(20);
|
||||||
}
|
}
|
||||||
|
if(plugin.Playing.size()>= 2){
|
||||||
|
if(plugin.config.getString("Auto_Start").equalsIgnoreCase("true")){
|
||||||
|
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable(){
|
||||||
|
public void run(){
|
||||||
|
Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), "ha start");
|
||||||
|
}
|
||||||
|
}, 20L);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -712,6 +735,586 @@ public class HaCommands implements CommandExecutor {
|
|||||||
p.sendMessage(ChatColor.RED + "You don't have permission!");
|
p.sendMessage(ChatColor.RED + "You don't have permission!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}else if(sender instanceof ConsoleCommandSender){
|
||||||
|
if(cmd.getName().equalsIgnoreCase("Ha")){
|
||||||
|
if(args.length== 0){
|
||||||
|
sender.sendMessage(ChatColor.GREEN + "[HungerArena] by " + ChatColor.AQUA + "travja!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if(args[0].equalsIgnoreCase("Help")){
|
||||||
|
ChatColor c = ChatColor.AQUA;
|
||||||
|
sender.sendMessage(ChatColor.GREEN + "----HungerArena Help----");
|
||||||
|
sender.sendMessage(c + "/ha - Displays author message!");
|
||||||
|
sender.sendMessage(c + "/ha help - Displays this screen!");
|
||||||
|
sender.sendMessage(c + "/ha join - Makes you join the game!");
|
||||||
|
sender.sendMessage(c + "/ha leave - Makes you leave the game!");
|
||||||
|
sender.sendMessage(c + "/ha watch - Lets you watch the tributes!");
|
||||||
|
sender.sendMessage(c + "/sponsor [Player] [ItemID] [Amount] - Lets you sponsor someone!");
|
||||||
|
sender.sendMessage(c + "/ha setspawn - Sets the spawn for dead tributes!");
|
||||||
|
sender.sendMessage(c + "/ha kick [Player] - Kicks a player from the arena!");
|
||||||
|
sender.sendMessage(c + "/ha restart - Makes it so dead tributes can join again!");
|
||||||
|
sender.sendMessage(c + "/ha warpall - Warps all tribute into position!");
|
||||||
|
sender.sendMessage(c + "/ha reload - Reloads the config!");
|
||||||
|
sender.sendMessage(c + "/ha start - Unfreezes tributes allowing them to fight!");
|
||||||
|
sender.sendMessage(c + "/ha list - Shows a list of players in the game and their health!");
|
||||||
|
sender.sendMessage(c + "/startpoint [1,2,3,4,etc] - Sets the starting points of tributes!");
|
||||||
|
sender.sendMessage(ChatColor.GREEN + "----------------------");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if(args[0].equalsIgnoreCase("List")){
|
||||||
|
sender.sendMessage(ChatColor.AQUA + "-----People Playing-----");
|
||||||
|
for(Player players:plugin.Playing){
|
||||||
|
sender.sendMessage(ChatColor.GREEN + players.getDisplayName() + " Life: " + players.getHealth() + "/20");
|
||||||
|
}
|
||||||
|
if(plugin.Playing.size()== 0){
|
||||||
|
sender.sendMessage(ChatColor.GRAY + "No one is playing!");
|
||||||
|
}
|
||||||
|
sender.sendMessage(ChatColor.AQUA + "----------------------");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(args[0].equalsIgnoreCase("SetSpawn")){
|
||||||
|
if(sender instanceof ConsoleCommandSender){
|
||||||
|
sender.sendMessage(ChatColor.RED + "That can only be run by a player!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
String[] Spawncoords = plugin.config.getString("Spawn_coords").split(",");
|
||||||
|
double spawnx = Double.parseDouble(Spawncoords[0]);
|
||||||
|
double spawny = Double.parseDouble(Spawncoords[1]);
|
||||||
|
double spawnz = Double.parseDouble(Spawncoords[2]);
|
||||||
|
String spawnworld = Spawncoords[3];
|
||||||
|
World spawnw = plugin.getServer().getWorld(spawnworld);
|
||||||
|
Location Spawn = new Location(spawnw, spawnx, spawny, spawnz);
|
||||||
|
if(args[0].equalsIgnoreCase("Join")){
|
||||||
|
if(sender instanceof ConsoleCommandSender){
|
||||||
|
sender.sendMessage(ChatColor.RED + "That can only be run by a player!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(args[0].equalsIgnoreCase("Confirm")){
|
||||||
|
if(sender instanceof ConsoleCommandSender){
|
||||||
|
sender.sendMessage(ChatColor.RED + "That can only be run by a player!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(args[0].equalsIgnoreCase("Ready")){
|
||||||
|
if(sender instanceof ConsoleCommandSender){
|
||||||
|
sender.sendMessage(ChatColor.RED + "That can only be run by a player!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(args[0].equalsIgnoreCase("Leave")){
|
||||||
|
if(sender instanceof ConsoleCommandSender){
|
||||||
|
sender.sendMessage(ChatColor.RED + "That can only be run by a player!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(args[0].equalsIgnoreCase("Watch")){
|
||||||
|
if(sender instanceof ConsoleCommandSender){
|
||||||
|
sender.sendMessage(ChatColor.RED + "That can only be run by a player!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(args[0].equalsIgnoreCase("Kick")){
|
||||||
|
Player target = plugin.getServer().getPlayer(args[1]);
|
||||||
|
if(plugin.Playing.contains(target)){
|
||||||
|
if(target.isOnline()){
|
||||||
|
plugin.Playing.remove(target);
|
||||||
|
plugin.getServer().broadcastMessage(ChatColor.RED + target.getName() + " was kicked from the game!");
|
||||||
|
target.teleport(Spawn);
|
||||||
|
target.getInventory().clear();
|
||||||
|
target.getInventory().setBoots(null);
|
||||||
|
target.getInventory().setChestplate(null);
|
||||||
|
target.getInventory().setHelmet(null);
|
||||||
|
target.getInventory().setLeggings(null);
|
||||||
|
plugin.Quit.add(target);
|
||||||
|
if(plugin.Playing.size()== 1 && plugin.canjoin== true){
|
||||||
|
for(Player winner:plugin.Playing){
|
||||||
|
String winnername = winner.getName();
|
||||||
|
sender.getServer().broadcastMessage(ChatColor.GREEN + winnername + " is the victor of this Hunger Games!");
|
||||||
|
winner.getInventory().clear();
|
||||||
|
winner.getInventory().addItem(plugin.Reward);
|
||||||
|
}
|
||||||
|
for(Player spectator:plugin.Watching){
|
||||||
|
spectator.setAllowFlight(false);
|
||||||
|
}
|
||||||
|
plugin.canjoin= false;
|
||||||
|
plugin.Watching.clear();
|
||||||
|
}else{
|
||||||
|
plugin.Playing.remove(target);
|
||||||
|
plugin.Quit.add(target);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
sender.sendMessage(ChatColor.RED + "That player isn't in the game!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(args[0].equalsIgnoreCase("Refill")){
|
||||||
|
int list056;
|
||||||
|
list056 = 0;
|
||||||
|
int limit = plugin.getConfig().getStringList("StorageXYZ").size();
|
||||||
|
while(limit > list056){
|
||||||
|
String xyz2 = plugin.getConfig().getStringList("StorageXYZ").get(list056);
|
||||||
|
int chestx = plugin.getConfig().getInt("Storage." + xyz2 + ".Location.X");
|
||||||
|
int chesty = plugin.getConfig().getInt("Storage." + xyz2 + ".Location.Y");
|
||||||
|
int chestz = plugin.getConfig().getInt("Storage." + xyz2 + ".Location.Z");
|
||||||
|
String chestw = plugin.getConfig().getString("Storage." + xyz2 + ".Location.W");
|
||||||
|
Block blockatlocation = Bukkit.getWorld(chestw).getBlockAt(chestx, chesty, chestz);
|
||||||
|
plugin.exists = false;
|
||||||
|
if(blockatlocation.getState() instanceof Chest){
|
||||||
|
plugin.exists = true;
|
||||||
|
Chest chest = (Chest) blockatlocation.getState();
|
||||||
|
chest.getInventory().clear();
|
||||||
|
ItemStack[] itemsinchest = null;
|
||||||
|
Object o = plugin.getConfig().get("Storage." + xyz2 + ".ItemsInStorage");
|
||||||
|
if(o instanceof ItemStack[]){
|
||||||
|
itemsinchest = (ItemStack[]) o;
|
||||||
|
}else if(o instanceof List){
|
||||||
|
itemsinchest = (ItemStack[]) ((List<ItemStack>) o).toArray(new ItemStack[0]);
|
||||||
|
}
|
||||||
|
list056 = list056+1;
|
||||||
|
chest.getInventory().setContents(itemsinchest);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(limit== list056){
|
||||||
|
sender.sendMessage(ChatColor.GREEN + "All chests refilled!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(args[0].equalsIgnoreCase("Restart")){
|
||||||
|
for(Player spectator:plugin.Watching){
|
||||||
|
spectator.setAllowFlight(false);
|
||||||
|
for(Player online:plugin.getServer().getOnlinePlayers()){
|
||||||
|
online.showPlayer(spectator);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
plugin.Dead.clear();
|
||||||
|
plugin.Playing.clear();
|
||||||
|
plugin.Quit.clear();
|
||||||
|
plugin.Watching.clear();
|
||||||
|
plugin.Frozen.clear();
|
||||||
|
plugin.canjoin = false;
|
||||||
|
sender.sendMessage(ChatColor.AQUA + "The games have been reset!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(args[0].equalsIgnoreCase("Reload")){
|
||||||
|
plugin.reloadConfig();
|
||||||
|
sender.sendMessage(ChatColor.AQUA + "HungerArena Reloaded!");
|
||||||
|
}
|
||||||
|
if(args[0].equalsIgnoreCase("WarpAll")){
|
||||||
|
if(plugin.config.getString("Spawns_set").equalsIgnoreCase("false")){
|
||||||
|
sender.sendMessage(ChatColor.RED + "/ha setspawn hasn't been run!");
|
||||||
|
}else{
|
||||||
|
if(plugin.Playing.size()<= 1){
|
||||||
|
sender.sendMessage(ChatColor.RED + "There are not enough players!");
|
||||||
|
}
|
||||||
|
if(plugin.Playing.size()>= 2){
|
||||||
|
plugin.config.getString("Tribute_one_spawn");
|
||||||
|
String[] onecoords = plugin.config.getString("Tribute_one_spawn").split(",");
|
||||||
|
Player Tribute_one = plugin.Playing.get(0);
|
||||||
|
double x = Double.parseDouble(onecoords[0]);
|
||||||
|
double y = Double.parseDouble(onecoords[1]);
|
||||||
|
double z = Double.parseDouble(onecoords[2]);
|
||||||
|
String world = onecoords[3];
|
||||||
|
World w = plugin.getServer().getWorld(world);
|
||||||
|
Location oneloc = new Location(w, x, y, z);
|
||||||
|
Tribute_one.teleport(oneloc);
|
||||||
|
plugin.Frozen.add(Tribute_one);
|
||||||
|
Tribute_one.setFoodLevel(20);
|
||||||
|
plugin.config.getString("Tribute_two_spawn");
|
||||||
|
String[] twocoords = plugin.config.getString("Tribute_two_spawn").split(",");
|
||||||
|
Player Tribute_two = plugin.Playing.get(1);
|
||||||
|
double twox = Double.parseDouble(twocoords[0]);
|
||||||
|
double twoy = Double.parseDouble(twocoords[1]);
|
||||||
|
double twoz = Double.parseDouble(twocoords[2]);
|
||||||
|
String twoworld = twocoords[3];
|
||||||
|
World twow = plugin.getServer().getWorld(twoworld);
|
||||||
|
Location twoloc = new Location(twow, twox, twoy, twoz);
|
||||||
|
Tribute_two.teleport(twoloc);
|
||||||
|
plugin.Frozen.add(Tribute_two);
|
||||||
|
Tribute_two.setFoodLevel(20);
|
||||||
|
Tribute_one.getWorld().setTime(0);
|
||||||
|
}
|
||||||
|
if(plugin.Playing.size()>= 3){
|
||||||
|
plugin.config.getString("Tribute_three_spawn");
|
||||||
|
String[] coords = plugin.config.getString("Tribute_three_spawn").split(",");
|
||||||
|
Player Tribute_three = plugin.Playing.get(2);
|
||||||
|
double x = Double.parseDouble(coords[0]);
|
||||||
|
double y = Double.parseDouble(coords[1]);
|
||||||
|
double z = Double.parseDouble(coords[2]);
|
||||||
|
String world = coords[3];
|
||||||
|
World w = plugin.getServer().getWorld(world);
|
||||||
|
Location loc = new Location(w, x, y, z);
|
||||||
|
Tribute_three.teleport(loc);
|
||||||
|
plugin.Frozen.add(Tribute_three);
|
||||||
|
Tribute_three.setFoodLevel(20);
|
||||||
|
}
|
||||||
|
if(plugin.Playing.size()>= 4){
|
||||||
|
plugin.config.getString("Tribute_four_spawn");
|
||||||
|
String[] coords = plugin.config.getString("Tribute_four_spawn").split(",");
|
||||||
|
Player Tribute_four = plugin.Playing.get(3);
|
||||||
|
double x = Double.parseDouble(coords[0]);
|
||||||
|
double y = Double.parseDouble(coords[1]);
|
||||||
|
double z = Double.parseDouble(coords[2]);
|
||||||
|
String world = coords[3];
|
||||||
|
World w = plugin.getServer().getWorld(world);
|
||||||
|
Location loc = new Location(w, x, y, z);
|
||||||
|
Tribute_four.teleport(loc);
|
||||||
|
plugin.Frozen.add(Tribute_four);
|
||||||
|
Tribute_four.setFoodLevel(20);
|
||||||
|
}
|
||||||
|
if(plugin.Playing.size()>= 5){
|
||||||
|
plugin.config.getString("Tribute_five_spawn");
|
||||||
|
String[] coords = plugin.config.getString("Tribute_five_spawn").split(",");
|
||||||
|
Player Tribute_five = plugin.Playing.get(4);
|
||||||
|
double x = Double.parseDouble(coords[0]);
|
||||||
|
double y = Double.parseDouble(coords[1]);
|
||||||
|
double z = Double.parseDouble(coords[2]);
|
||||||
|
String world = coords[3];
|
||||||
|
World w = plugin.getServer().getWorld(world);
|
||||||
|
Location loc = new Location(w, x, y, z);
|
||||||
|
Tribute_five.teleport(loc);
|
||||||
|
plugin.Frozen.add(Tribute_five);
|
||||||
|
Tribute_five.setFoodLevel(20);
|
||||||
|
}
|
||||||
|
if(plugin.Playing.size()>= 6){
|
||||||
|
plugin.config.getString("Tribute_six_spawn");
|
||||||
|
String[] coords = plugin.config.getString("Tribute_six_spawn").split(",");
|
||||||
|
Player Tribute_six = plugin.Playing.get(5);
|
||||||
|
double x = Double.parseDouble(coords[0]);
|
||||||
|
double y = Double.parseDouble(coords[1]);
|
||||||
|
double z = Double.parseDouble(coords[2]);
|
||||||
|
String world = coords[3];
|
||||||
|
World w = plugin.getServer().getWorld(world);
|
||||||
|
Location loc = new Location(w, x, y, z);
|
||||||
|
Tribute_six.teleport(loc);
|
||||||
|
plugin.Frozen.add(Tribute_six);
|
||||||
|
Tribute_six.setFoodLevel(20);
|
||||||
|
}
|
||||||
|
if(plugin.Playing.size()>= 7){
|
||||||
|
plugin.config.getString("Tribute_seven_spawn");
|
||||||
|
String[] coords = plugin.config.getString("Tribute_seven_spawn").split(",");
|
||||||
|
Player Tribute_seven = plugin.Playing.get(6);
|
||||||
|
double x = Double.parseDouble(coords[0]);
|
||||||
|
double y = Double.parseDouble(coords[1]);
|
||||||
|
double z = Double.parseDouble(coords[2]);
|
||||||
|
String world = coords[3];
|
||||||
|
World w = plugin.getServer().getWorld(world);
|
||||||
|
Location loc = new Location(w, x, y, z);
|
||||||
|
Tribute_seven.teleport(loc);
|
||||||
|
plugin.Frozen.add(Tribute_seven);
|
||||||
|
Tribute_seven.setFoodLevel(20);
|
||||||
|
}
|
||||||
|
if(plugin.Playing.size()>= 8){
|
||||||
|
plugin.config.getString("Tribute_eight_spawn");
|
||||||
|
String[] coords = plugin.config.getString("Tribute_eight_spawn").split(",");
|
||||||
|
Player Tribute_eight = plugin.Playing.get(7);
|
||||||
|
double x = Double.parseDouble(coords[0]);
|
||||||
|
double y = Double.parseDouble(coords[1]);
|
||||||
|
double z = Double.parseDouble(coords[2]);
|
||||||
|
String world = coords[3];
|
||||||
|
World w = plugin.getServer().getWorld(world);
|
||||||
|
Location loc = new Location(w, x, y, z);
|
||||||
|
Tribute_eight.teleport(loc);
|
||||||
|
plugin.Frozen.add(Tribute_eight);
|
||||||
|
Tribute_eight.setFoodLevel(20);
|
||||||
|
}
|
||||||
|
if(plugin.Playing.size()>= 9){
|
||||||
|
plugin.config.getString("Tribute_nine_spawn");
|
||||||
|
String[] coords = plugin.config.getString("Tribute_nine_spawn").split(",");
|
||||||
|
Player Tribute_nine = plugin.Playing.get(8);
|
||||||
|
double x = Double.parseDouble(coords[0]);
|
||||||
|
double y = Double.parseDouble(coords[1]);
|
||||||
|
double z = Double.parseDouble(coords[2]);
|
||||||
|
String world = coords[3];
|
||||||
|
World w = plugin.getServer().getWorld(world);
|
||||||
|
Location loc = new Location(w, x, y, z);
|
||||||
|
Tribute_nine.teleport(loc);
|
||||||
|
plugin.Frozen.add(Tribute_nine);
|
||||||
|
Tribute_nine.setFoodLevel(20);
|
||||||
|
}
|
||||||
|
if(plugin.Playing.size()>= 10){
|
||||||
|
plugin.config.getString("Tribute_ten_spawn");
|
||||||
|
String[] coords = plugin.config.getString("Tribute_ten_spawn").split(",");
|
||||||
|
Player Tribute_ten = plugin.Playing.get(9);
|
||||||
|
double x = Double.parseDouble(coords[0]);
|
||||||
|
double y = Double.parseDouble(coords[1]);
|
||||||
|
double z = Double.parseDouble(coords[2]);
|
||||||
|
String world = coords[3];
|
||||||
|
World w = plugin.getServer().getWorld(world);
|
||||||
|
Location loc = new Location(w, x, y, z);
|
||||||
|
Tribute_ten.teleport(loc);
|
||||||
|
plugin.Frozen.add(Tribute_ten);
|
||||||
|
Tribute_ten.setFoodLevel(20);
|
||||||
|
}
|
||||||
|
if(plugin.Playing.size()>= 11){
|
||||||
|
plugin.config.getString("Tribute_eleven_spawn");
|
||||||
|
String[] coords = plugin.config.getString("Tribute_eleven_spawn").split(",");
|
||||||
|
Player Tribute_eleven = plugin.Playing.get(10);
|
||||||
|
double x = Double.parseDouble(coords[0]);
|
||||||
|
double y = Double.parseDouble(coords[1]);
|
||||||
|
double z = Double.parseDouble(coords[2]);
|
||||||
|
String world = coords[3];
|
||||||
|
World w = plugin.getServer().getWorld(world);
|
||||||
|
Location loc = new Location(w, x, y, z);
|
||||||
|
Tribute_eleven.teleport(loc);
|
||||||
|
plugin.Frozen.add(Tribute_eleven);
|
||||||
|
Tribute_eleven.setFoodLevel(20);
|
||||||
|
}
|
||||||
|
if(plugin.Playing.size()>= 12){
|
||||||
|
plugin.config.getString("Tribute_twelve_spawn");
|
||||||
|
String[] coords = plugin.config.getString("Tribute_twelve_spawn").split(",");
|
||||||
|
Player Tribute_twelve = plugin.Playing.get(11);
|
||||||
|
double x = Double.parseDouble(coords[0]);
|
||||||
|
double y = Double.parseDouble(coords[1]);
|
||||||
|
double z = Double.parseDouble(coords[2]);
|
||||||
|
String world = coords[3];
|
||||||
|
World w = plugin.getServer().getWorld(world);
|
||||||
|
Location loc = new Location(w, x, y, z);
|
||||||
|
Tribute_twelve.teleport(loc);
|
||||||
|
plugin.Frozen.add(Tribute_twelve);
|
||||||
|
Tribute_twelve.setFoodLevel(20);
|
||||||
|
}
|
||||||
|
if(plugin.Playing.size()>= 13){
|
||||||
|
plugin.config.getString("Tribute_thirteen_spawn");
|
||||||
|
String[] coords = plugin.config.getString("Tribute_thirteen_spawn").split(",");
|
||||||
|
Player Tribute_thirteen = plugin.Playing.get(12);
|
||||||
|
double x = Double.parseDouble(coords[0]);
|
||||||
|
double y = Double.parseDouble(coords[1]);
|
||||||
|
double z = Double.parseDouble(coords[2]);
|
||||||
|
String world = coords[3];
|
||||||
|
World w = plugin.getServer().getWorld(world);
|
||||||
|
Location loc = new Location(w, x, y, z);
|
||||||
|
Tribute_thirteen.teleport(loc);
|
||||||
|
plugin.Frozen.add(Tribute_thirteen);
|
||||||
|
Tribute_thirteen.setFoodLevel(20);
|
||||||
|
}
|
||||||
|
if(plugin.Playing.size()>= 14){
|
||||||
|
plugin.config.getString("Tribute_fourteen_spawn");
|
||||||
|
String[] coords = plugin.config.getString("Tribute_fourteen_spawn").split(",");
|
||||||
|
Player Tribute_fourteen = plugin.Playing.get(13);
|
||||||
|
double x = Double.parseDouble(coords[0]);
|
||||||
|
double y = Double.parseDouble(coords[1]);
|
||||||
|
double z = Double.parseDouble(coords[2]);
|
||||||
|
String world = coords[3];
|
||||||
|
World w = plugin.getServer().getWorld(world);
|
||||||
|
Location loc = new Location(w, x, y, z);
|
||||||
|
Tribute_fourteen.teleport(loc);
|
||||||
|
plugin.Frozen.add(Tribute_fourteen);
|
||||||
|
Tribute_fourteen.setFoodLevel(20);
|
||||||
|
}
|
||||||
|
if(plugin.Playing.size()>= 15){
|
||||||
|
plugin.config.getString("Tribute_fifteen_spawn");
|
||||||
|
String[] coords = plugin.config.getString("Tribute_fifteen_spawn").split(",");
|
||||||
|
Player Tribute_fifteen = plugin.Playing.get(14);
|
||||||
|
double x = Double.parseDouble(coords[0]);
|
||||||
|
double y = Double.parseDouble(coords[1]);
|
||||||
|
double z = Double.parseDouble(coords[2]);
|
||||||
|
String world = coords[3];
|
||||||
|
World w = plugin.getServer().getWorld(world);
|
||||||
|
Location loc = new Location(w, x, y, z);
|
||||||
|
Tribute_fifteen.teleport(loc);
|
||||||
|
plugin.Frozen.add(Tribute_fifteen);
|
||||||
|
Tribute_fifteen.setFoodLevel(20);
|
||||||
|
}
|
||||||
|
if(plugin.Playing.size()>= 16){
|
||||||
|
plugin.config.getString("Tribute_sixteen_spawn");
|
||||||
|
String[] coords = plugin.config.getString("Tribute_sixteen_spawn").split(",");
|
||||||
|
Player Tribute_sixteen = plugin.Playing.get(15);
|
||||||
|
double x = Double.parseDouble(coords[0]);
|
||||||
|
double y = Double.parseDouble(coords[1]);
|
||||||
|
double z = Double.parseDouble(coords[2]);
|
||||||
|
String world = coords[3];
|
||||||
|
World w = plugin.getServer().getWorld(world);
|
||||||
|
Location loc = new Location(w, x, y, z);
|
||||||
|
Tribute_sixteen.teleport(loc);
|
||||||
|
plugin.Frozen.add(Tribute_sixteen);
|
||||||
|
Tribute_sixteen.setFoodLevel(20);
|
||||||
|
}
|
||||||
|
if(plugin.Playing.size()>= 17){
|
||||||
|
plugin.config.getString("Tribute_seventeen_spawn");
|
||||||
|
String[] coords = plugin.config.getString("Tribute_seventeen_spawn").split(",");
|
||||||
|
Player Tribute_seventeen = plugin.Playing.get(16);
|
||||||
|
double x = Double.parseDouble(coords[0]);
|
||||||
|
double y = Double.parseDouble(coords[1]);
|
||||||
|
double z = Double.parseDouble(coords[2]);
|
||||||
|
String world = coords[3];
|
||||||
|
World w = plugin.getServer().getWorld(world);
|
||||||
|
Location loc = new Location(w, x, y, z);
|
||||||
|
Tribute_seventeen.teleport(loc);
|
||||||
|
plugin.Frozen.add(Tribute_seventeen);
|
||||||
|
Tribute_seventeen.setFoodLevel(20);
|
||||||
|
}
|
||||||
|
if(plugin.Playing.size()>= 18){
|
||||||
|
plugin.config.getString("Tribute_eighteen_spawn");
|
||||||
|
String[] coords = plugin.config.getString("Tribute_eighteen_spawn").split(",");
|
||||||
|
Player Tribute_eighteen = plugin.Playing.get(17);
|
||||||
|
double x = Double.parseDouble(coords[0]);
|
||||||
|
double y = Double.parseDouble(coords[1]);
|
||||||
|
double z = Double.parseDouble(coords[2]);
|
||||||
|
String world = coords[3];
|
||||||
|
World w = plugin.getServer().getWorld(world);
|
||||||
|
Location loc = new Location(w, x, y, z);
|
||||||
|
Tribute_eighteen.teleport(loc);
|
||||||
|
plugin.Frozen.add(Tribute_eighteen);
|
||||||
|
Tribute_eighteen.setFoodLevel(20);
|
||||||
|
}
|
||||||
|
if(plugin.Playing.size()>= 19){
|
||||||
|
plugin.config.getString("Tribute_nineteen_spawn");
|
||||||
|
String[] coords = plugin.config.getString("Tribute_nineteen_spawn").split(",");
|
||||||
|
Player Tribute_nineteen = plugin.Playing.get(18);
|
||||||
|
double x = Double.parseDouble(coords[0]);
|
||||||
|
double y = Double.parseDouble(coords[1]);
|
||||||
|
double z = Double.parseDouble(coords[2]);
|
||||||
|
String world = coords[3];
|
||||||
|
World w = plugin.getServer().getWorld(world);
|
||||||
|
Location loc = new Location(w, x, y, z);
|
||||||
|
Tribute_nineteen.teleport(loc);
|
||||||
|
plugin.Frozen.add(Tribute_nineteen);
|
||||||
|
Tribute_nineteen.setFoodLevel(20);
|
||||||
|
}
|
||||||
|
if(plugin.Playing.size()>= 20){
|
||||||
|
plugin.config.getString("Tribute_twenty_spawn");
|
||||||
|
String[] coords = plugin.config.getString("Tribute_twenty_spawn").split(",");
|
||||||
|
Player Tribute_twenty = plugin.Playing.get(19);
|
||||||
|
double x = Double.parseDouble(coords[0]);
|
||||||
|
double y = Double.parseDouble(coords[1]);
|
||||||
|
double z = Double.parseDouble(coords[2]);
|
||||||
|
String world = coords[3];
|
||||||
|
World w = plugin.getServer().getWorld(world);
|
||||||
|
Location loc = new Location(w, x, y, z);
|
||||||
|
Tribute_twenty.teleport(loc);
|
||||||
|
plugin.Frozen.add(Tribute_twenty);
|
||||||
|
Tribute_twenty.setFoodLevel(20);
|
||||||
|
}
|
||||||
|
if(plugin.Playing.size()>= 21){
|
||||||
|
plugin.config.getString("Tribute_twentyone_spawn");
|
||||||
|
String[] coords = plugin.config.getString("Tribute_twentyone_spawn").split(",");
|
||||||
|
Player Tribute_twentyone = plugin.Playing.get(20);
|
||||||
|
double x = Double.parseDouble(coords[0]);
|
||||||
|
double y = Double.parseDouble(coords[1]);
|
||||||
|
double z = Double.parseDouble(coords[2]);
|
||||||
|
String world = coords[3];
|
||||||
|
World w = plugin.getServer().getWorld(world);
|
||||||
|
Location loc = new Location(w, x, y, z);
|
||||||
|
Tribute_twentyone.teleport(loc);
|
||||||
|
plugin.Frozen.add(Tribute_twentyone);
|
||||||
|
Tribute_twentyone.setFoodLevel(20);
|
||||||
|
}
|
||||||
|
if(plugin.Playing.size()>= 22){
|
||||||
|
plugin.config.getString("Tribute_twentytwo_spawn");
|
||||||
|
String[] coords = plugin.config.getString("Tribute_twentytwo_spawn").split(",");
|
||||||
|
Player Tribute_twentytwo = plugin.Playing.get(21);
|
||||||
|
double x = Double.parseDouble(coords[0]);
|
||||||
|
double y = Double.parseDouble(coords[1]);
|
||||||
|
double z = Double.parseDouble(coords[2]);
|
||||||
|
String world = coords[3];
|
||||||
|
World w = plugin.getServer().getWorld(world);
|
||||||
|
Location loc = new Location(w, x, y, z);
|
||||||
|
Tribute_twentytwo.teleport(loc);
|
||||||
|
plugin.Frozen.add(Tribute_twentytwo);
|
||||||
|
Tribute_twentytwo.setFoodLevel(20);
|
||||||
|
}
|
||||||
|
if(plugin.Playing.size()>= 23){
|
||||||
|
plugin.config.getString("Tribute_twentythree_spawn");
|
||||||
|
String[] coords = plugin.config.getString("Tribute_twentythree_spawn").split(",");
|
||||||
|
Player Tribute_twentythree = plugin.Playing.get(22);
|
||||||
|
double x = Double.parseDouble(coords[0]);
|
||||||
|
double y = Double.parseDouble(coords[1]);
|
||||||
|
double z = Double.parseDouble(coords[2]);
|
||||||
|
String world = coords[3];
|
||||||
|
World w = plugin.getServer().getWorld(world);
|
||||||
|
Location loc = new Location(w, x, y, z);
|
||||||
|
Tribute_twentythree.teleport(loc);
|
||||||
|
plugin.Frozen.add(Tribute_twentythree);
|
||||||
|
Tribute_twentythree.setFoodLevel(20);
|
||||||
|
}
|
||||||
|
if(plugin.Playing.size()>= 24){
|
||||||
|
plugin.config.getString("Tribute_twentyfour_spawn");
|
||||||
|
String[] coords = plugin.config.getString("Tribute_twentyfour_spawn").split(",");
|
||||||
|
Player Tribute_twentyfour = plugin.Playing.get(23);
|
||||||
|
double x = Double.parseDouble(coords[0]);
|
||||||
|
double y = Double.parseDouble(coords[1]);
|
||||||
|
double z = Double.parseDouble(coords[2]);
|
||||||
|
String world = coords[3];
|
||||||
|
World w = plugin.getServer().getWorld(world);
|
||||||
|
Location loc = new Location(w, x, y, z);
|
||||||
|
Tribute_twentyfour.teleport(loc);
|
||||||
|
plugin.Frozen.add(Tribute_twentyfour);
|
||||||
|
Tribute_twentyfour.setFoodLevel(20);
|
||||||
|
}
|
||||||
|
if(plugin.Playing.size()>= 2){
|
||||||
|
if(plugin.config.getString("Auto_Start").equalsIgnoreCase("true")){
|
||||||
|
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable(){
|
||||||
|
public void run(){
|
||||||
|
Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), "ha start");
|
||||||
|
}
|
||||||
|
}, 20L);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(args[0].equalsIgnoreCase("Start")){
|
||||||
|
String begin = plugin.config.getString("Start_Message");
|
||||||
|
begin = begin.replaceAll("(&([a-f0-9]))", "\u00A7$2");
|
||||||
|
final String msg = begin;
|
||||||
|
if(plugin.config.getString("Countdown").equalsIgnoreCase("true")){
|
||||||
|
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable(){
|
||||||
|
public void run(){
|
||||||
|
plugin.getServer().broadcastMessage("10");
|
||||||
|
}
|
||||||
|
}, 20L);
|
||||||
|
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable(){
|
||||||
|
public void run(){
|
||||||
|
plugin.getServer().broadcastMessage("9");
|
||||||
|
}
|
||||||
|
}, 40L);
|
||||||
|
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable(){
|
||||||
|
public void run(){
|
||||||
|
plugin.getServer().broadcastMessage("8");
|
||||||
|
}
|
||||||
|
}, 60L);
|
||||||
|
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable(){
|
||||||
|
public void run(){
|
||||||
|
plugin.getServer().broadcastMessage("7");
|
||||||
|
}
|
||||||
|
}, 80L);
|
||||||
|
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable(){
|
||||||
|
public void run(){
|
||||||
|
plugin.getServer().broadcastMessage("6");
|
||||||
|
}
|
||||||
|
}, 100L);
|
||||||
|
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable(){
|
||||||
|
public void run(){
|
||||||
|
plugin.getServer().broadcastMessage("5");
|
||||||
|
}
|
||||||
|
}, 120L);
|
||||||
|
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable(){
|
||||||
|
public void run(){
|
||||||
|
plugin.getServer().broadcastMessage("4");
|
||||||
|
}
|
||||||
|
}, 140L);
|
||||||
|
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable(){
|
||||||
|
public void run(){
|
||||||
|
plugin.getServer().broadcastMessage("3");
|
||||||
|
}
|
||||||
|
}, 160L);
|
||||||
|
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable(){
|
||||||
|
public void run(){
|
||||||
|
plugin.getServer().broadcastMessage("2");
|
||||||
|
}
|
||||||
|
}, 180L);
|
||||||
|
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable(){
|
||||||
|
public void run(){
|
||||||
|
plugin.getServer().broadcastMessage("1");
|
||||||
|
}
|
||||||
|
}, 200L);
|
||||||
|
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable(){
|
||||||
|
public void run(){
|
||||||
|
plugin.Frozen.clear();
|
||||||
|
plugin.getServer().broadcastMessage(msg);
|
||||||
|
plugin.canjoin = true;
|
||||||
|
}
|
||||||
|
}, 220L);
|
||||||
|
}else{
|
||||||
|
plugin.Frozen.clear();
|
||||||
|
plugin.getServer().broadcastMessage(ChatColor.AQUA + "Let the Games Begin!!");
|
||||||
|
plugin.canjoin = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
package me.Travja.HungerArena;
|
package me.Travja.HungerArena;
|
||||||
|
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.block.Action;
|
import org.bukkit.event.block.Action;
|
||||||
|
import org.bukkit.event.block.SignChangeEvent;
|
||||||
import org.bukkit.event.player.PlayerInteractEvent;
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
|
|
||||||
public class Signs implements Listener {
|
public class Signs implements Listener {
|
||||||
@ -21,21 +23,25 @@ public class Signs implements Listener {
|
|||||||
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[] lines = sign.getLines();
|
String[] lines = sign.getLines();
|
||||||
if(lines[0].equalsIgnoreCase("[HungerArena]")){
|
if(lines[0].equalsIgnoreCase(ChatColor.BLUE + "[HungerArena]")){
|
||||||
if(lines[1].equalsIgnoreCase("Join")){
|
if(lines[1].isEmpty()){
|
||||||
p.performCommand("ha join");
|
p.performCommand("ha");
|
||||||
}
|
}else{
|
||||||
if(lines[1].equalsIgnoreCase("Confirm")){
|
p.performCommand("ha " + lines[1]);
|
||||||
p.performCommand("ha confirm");
|
|
||||||
}
|
|
||||||
if(lines[1].equalsIgnoreCase("Leave")){
|
|
||||||
p.performCommand("ha leave");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(lines[0].equalsIgnoreCase("[Sponsor]")){
|
if(lines[0].equalsIgnoreCase(ChatColor.BLUE + "[Sponsor]")){
|
||||||
p.performCommand("sponsor" + " " + lines[1] + " " + lines[2] + " " + lines[3]);
|
p.performCommand("sponsor " + lines[1] + " " + lines[2] + " " + lines[3]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@EventHandler
|
||||||
|
public void Create(SignChangeEvent event){
|
||||||
|
String[] lines = event.getLines();
|
||||||
|
String top = lines[0];
|
||||||
|
if(top.equalsIgnoreCase("[HungerArena]") || top.equalsIgnoreCase("[Sponsor]")){
|
||||||
|
event.setLine(0, ChatColor.BLUE + top);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,7 @@ public class SponsorCommands implements CommandExecutor {
|
|||||||
Player p = (Player) sender;
|
Player p = (Player) sender;
|
||||||
String pname = p.getName();
|
String pname = p.getName();
|
||||||
if(cmd.getName().equalsIgnoreCase("Sponsor")){
|
if(cmd.getName().equalsIgnoreCase("Sponsor")){
|
||||||
|
if(p.hasPermission("HungerArena.Sponsor")){
|
||||||
if(!plugin.Playing.contains(p)){
|
if(!plugin.Playing.contains(p)){
|
||||||
if(args.length== 0){
|
if(args.length== 0){
|
||||||
p.sendMessage(ChatColor.RED + "You didn't specify a tribute!");
|
p.sendMessage(ChatColor.RED + "You didn't specify a tribute!");
|
||||||
@ -59,6 +60,9 @@ public class SponsorCommands implements CommandExecutor {
|
|||||||
}else{
|
}else{
|
||||||
p.sendMessage(ChatColor.RED + "You are playing, you can't sponsor yourself!");
|
p.sendMessage(ChatColor.RED + "You are playing, you can't sponsor yourself!");
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
p.sendMessage(ChatColor.RED + "You don't have permission!");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user