Updated to most recent Dev
This commit is contained in:
parent
a9ff18163d
commit
444ec3ea01
@ -3,6 +3,6 @@
|
|||||||
<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:/Users/Travja/Documents/Plugins/Vault.jar"/>
|
<classpathentry kind="lib" path="C:/Users/Travja/Documents/Plugins/Vault.jar"/>
|
||||||
<classpathentry kind="lib" path="C:/Users/Travja/Downloads/bukkit-1.3.2-R1.0.jar"/>
|
<classpathentry kind="lib" path="C:/Users/Travja/Downloads/bukkit-1.4.2-R0.1-20121030.091619-10.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.
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.
BIN
bin/me/Travja/HungerArena/JoinAndQuitListener$4.class
Normal file
BIN
bin/me/Travja/HungerArena/JoinAndQuitListener$4.class
Normal file
Binary file not shown.
BIN
bin/me/Travja/HungerArena/JoinAndQuitListener$5.class
Normal file
BIN
bin/me/Travja/HungerArena/JoinAndQuitListener$5.class
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
bin/me/Travja/HungerArena/Main$2$1.class
Normal file
BIN
bin/me/Travja/HungerArena/Main$2$1.class
Normal file
Binary file not shown.
BIN
bin/me/Travja/HungerArena/Main$2.class
Normal file
BIN
bin/me/Travja/HungerArena/Main$2.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.
@ -6,10 +6,8 @@
|
|||||||
|
|
||||||
commands:
|
commands:
|
||||||
whitelist: []
|
whitelist: []
|
||||||
##### Not implemented! #####
|
|
||||||
blocks:
|
blocks:
|
||||||
|
useWhitelistAsBlacklist: false
|
||||||
whitelist: []
|
whitelist: []
|
||||||
blacklist: []
|
|
||||||
############################
|
|
||||||
sponsors:
|
sponsors:
|
||||||
blacklist: []
|
blacklist: []
|
@ -16,6 +16,15 @@ config:
|
|||||||
# - world_nether
|
# - world_nether
|
||||||
worlds:
|
worlds:
|
||||||
|
|
||||||
|
# If left at 0 there will be no death match, fill in a time in minutes
|
||||||
|
DeathMatch: 0
|
||||||
|
|
||||||
|
#Whether or not to broadcast game messages to all players
|
||||||
|
broadcastAll: true
|
||||||
|
|
||||||
|
# The max amount of players that can be in a game, This is also dependent on the amount of startpoints you have set.
|
||||||
|
maxPlayers: 24
|
||||||
|
|
||||||
# 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!'
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
name: HungerArena
|
name: HungerArena
|
||||||
main: me.Travja.HungerArena.Main
|
main: me.Travja.HungerArena.Main
|
||||||
version: 1.3alpha
|
version: 1.4Dev
|
||||||
description: A lightweight and powerful plugin to help with playing The Hunger Games!
|
description: A lightweight and powerful plugin to help with playing The Hunger Games!
|
||||||
softdepend: [Vault]
|
softdepend: [Vault]
|
||||||
commands:
|
commands:
|
||||||
|
30
spawns.yml
30
spawns.yml
@ -3,27 +3,9 @@ Spawn_coords: 100,100,100,world
|
|||||||
# If /ha setspawn has been run
|
# If /ha setspawn has been run
|
||||||
Spawns_set: 'false'
|
Spawns_set: 'false'
|
||||||
Spawns:
|
Spawns:
|
||||||
- 100,100,100,world,false
|
1:
|
||||||
- 100,100,100,world,false
|
1:
|
||||||
- 100,100,100,world,false
|
2:
|
||||||
- 100,100,100,world,false
|
2:
|
||||||
- 100,100,100,world,false
|
1:
|
||||||
- 100,100,100,world,false
|
2:
|
||||||
- 100,100,100,world,false
|
|
||||||
- 100,100,100,world,false
|
|
||||||
- 100,100,100,world,false
|
|
||||||
- 100,100,100,world,false
|
|
||||||
- 100,100,100,world,false
|
|
||||||
- 100,100,100,world,false
|
|
||||||
- 100,100,100,world,false
|
|
||||||
- 100,100,100,world,false
|
|
||||||
- 100,100,100,world,false
|
|
||||||
- 100,100,100,world,false
|
|
||||||
- 100,100,100,world,false
|
|
||||||
- 100,100,100,world,false
|
|
||||||
- 100,100,100,world,false
|
|
||||||
- 100,100,100,world,false
|
|
||||||
- 100,100,100,world,false
|
|
||||||
- 100,100,100,world,false
|
|
||||||
- 100,100,100,world,false
|
|
||||||
- 100,100,100,world,false
|
|
@ -30,42 +30,58 @@ public class BlockStorage implements Listener {
|
|||||||
Block b = event.getBlock();
|
Block b = event.getBlock();
|
||||||
Player p = event.getPlayer();
|
Player p = event.getPlayer();
|
||||||
String pname = p.getName();
|
String pname = p.getName();
|
||||||
|
if(plugin.getArena(p)!= null){
|
||||||
|
int a = plugin.getArena(p);
|
||||||
if(!event.isCancelled()){
|
if(!event.isCancelled()){
|
||||||
if(plugin.Playing.contains(pname)){
|
if(plugin.Playing.get(a).contains(pname)){
|
||||||
if(plugin.config.getString("Protected_Arena").equalsIgnoreCase("True")){
|
if(plugin.config.getString("Protected_Arena").equalsIgnoreCase("True")){
|
||||||
if(!plugin.management.getStringList("blocks.blacklist").isEmpty() && plugin.management.getStringList("blocks.blacklist").contains(b.getData())){
|
p.sendMessage(ChatColor.RED + "You can't break blocks while playing!");
|
||||||
event.setCancelled(true);
|
|
||||||
p.sendMessage(ChatColor.RED + "That is an illegal block!");
|
|
||||||
}else if(!plugin.management.getStringList("blocks.whitelist").isEmpty() && !plugin.management.getStringList("blocks.whitelist").contains(b.getData())){
|
|
||||||
if(!plugin.management.getStringList("blocks.blacklist").isEmpty() && !plugin.management.getStringList("blocks.blacklist").contains(b.getData())){
|
|
||||||
event.setCancelled(true);
|
|
||||||
p.sendMessage(ChatColor.RED + "That is an illegal block!");
|
|
||||||
}
|
}
|
||||||
}else if(!plugin.management.getStringList("blocks.blacklist").isEmpty() && !plugin.management.getStringList("blocks.blacklist").contains(b.getData())){
|
if(plugin.canjoin.get(a)){
|
||||||
if(!plugin.management.getStringList("blocks.whitelist").isEmpty() && !plugin.management.getStringList("blocks.whitelist").contains(b.getData())){
|
if(plugin.config.getStringList("worlds").isEmpty() || (!plugin.config.getStringList("worlds").isEmpty() && plugin.config.getStringList("worlds").contains(p.getWorld().getName()))){
|
||||||
|
if(!plugin.management.getBoolean("blocks.useWhitelistAsBlacklist")){
|
||||||
|
if(!plugin.management.getIntegerList("blocks.whitelist").isEmpty()){
|
||||||
|
if(!plugin.management.getIntegerList("blocks.whitelist").contains(b.getTypeId())){
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
p.sendMessage(ChatColor.RED + "That is an illegal block!");
|
p.sendMessage(ChatColor.RED + "That is an illegal block!");
|
||||||
|
}else if(plugin.management.getIntegerList("blocks.whitelist").contains(b.getTypeId())){
|
||||||
|
String w = b.getWorld().getName();
|
||||||
|
int x = b.getX();
|
||||||
|
int y = b.getY();
|
||||||
|
int z = b.getZ();
|
||||||
|
int d = b.getTypeId();
|
||||||
|
byte m = b.getData();
|
||||||
|
String coords = w + "," + x + "," + y + "," + z + "," + d + "," + m + "," + a;
|
||||||
|
List<String> blocks = plugin.data.getStringList("Blocks_Destroyed");
|
||||||
|
if(!plugin.data.getStringList("Blocks_Placed").contains(w + "," + x + "," + y + "," + z + "," + a)){
|
||||||
|
blocks.add(coords);
|
||||||
|
plugin.data.set("Blocks_Destroyed", blocks);
|
||||||
|
plugin.saveData();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
p.sendMessage(ChatColor.RED + "That is an illegal block!");
|
p.sendMessage(ChatColor.RED + "That is an illegal block!");
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
if(!plugin.management.getIntegerList("blocks.whitelist").isEmpty()){
|
||||||
|
if(!plugin.management.getIntegerList("blocks.whitelist").contains(b.getTypeId())){
|
||||||
|
String w = b.getWorld().getName();
|
||||||
|
int x = b.getX();
|
||||||
|
int y = b.getY();
|
||||||
|
int z = b.getZ();
|
||||||
|
int d = b.getTypeId();
|
||||||
|
byte m = b.getData();
|
||||||
|
String coords = w + "," + x + "," + y + "," + z + "," + d + "," + m + "," + a;
|
||||||
|
List<String> blocks = plugin.data.getStringList("Blocks_Destroyed");
|
||||||
|
if(!plugin.data.getStringList("Blocks_Placed").contains(w + "," + x + "," + y + "," + z + "," + a)){
|
||||||
|
blocks.add(coords);
|
||||||
|
plugin.data.set("Blocks_Destroyed", blocks);
|
||||||
|
plugin.saveData();
|
||||||
}
|
}
|
||||||
if(plugin.canjoin){
|
}else if(plugin.management.getIntegerList("blocks.whitelist").contains(b.getTypeId())){
|
||||||
if(plugin.config.getStringList("worlds").isEmpty() || (!plugin.config.getStringList("worlds").isEmpty() && plugin.config.getStringList("worlds").contains(p.getWorld().getName()))){
|
|
||||||
if(!plugin.management.getStringList("blocks.blacklist").isEmpty() && plugin.management.getStringList("blocks.blacklist").contains(b.getData())){
|
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
p.sendMessage(ChatColor.RED + "That is an illegal block!");
|
p.sendMessage(ChatColor.RED + "That is an illegal block");
|
||||||
}else if(!plugin.management.getStringList("blocks.whitelist").isEmpty() && !plugin.management.getStringList("blocks.whitelist").contains(b.getData())){
|
|
||||||
if(!plugin.management.getStringList("blocks.blacklist").isEmpty() && !plugin.management.getStringList("blocks.blacklist").contains(b.getData())){
|
|
||||||
event.setCancelled(true);
|
|
||||||
p.sendMessage(ChatColor.RED + "That is an illegal block!");
|
|
||||||
}
|
|
||||||
}else if(!plugin.management.getStringList("blocks.blacklist").isEmpty() && !plugin.management.getStringList("blocks.blacklist").contains(b.getData())){
|
|
||||||
if(!plugin.management.getStringList("blocks.whitelist").isEmpty() && !plugin.management.getStringList("blocks.whitelist").contains(b.getData())){
|
|
||||||
event.setCancelled(true);
|
|
||||||
p.sendMessage(ChatColor.RED + "That is an illegal block!");
|
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
String w = b.getWorld().getName();
|
String w = b.getWorld().getName();
|
||||||
@ -74,9 +90,9 @@ public class BlockStorage implements Listener {
|
|||||||
int z = b.getZ();
|
int z = b.getZ();
|
||||||
int d = b.getTypeId();
|
int d = b.getTypeId();
|
||||||
byte m = b.getData();
|
byte m = b.getData();
|
||||||
String coords = w + "," + x + "," + y + "," + z + "," + d + "," + m;
|
String coords = w + "," + x + "," + y + "," + z + "," + d + "," + m + "," + a;
|
||||||
List<String> blocks = plugin.data.getStringList("Blocks_Destroyed");
|
List<String> blocks = plugin.data.getStringList("Blocks_Destroyed");
|
||||||
if(!plugin.data.getStringList("Blocks_Placed").contains(w + "," + x + "," + y + "," + z)){
|
if(!plugin.data.getStringList("Blocks_Placed").contains(w + "," + x + "," + y + "," + z + "," + a)){
|
||||||
blocks.add(coords);
|
blocks.add(coords);
|
||||||
plugin.data.set("Blocks_Destroyed", blocks);
|
plugin.data.set("Blocks_Destroyed", blocks);
|
||||||
plugin.saveData();
|
plugin.saveData();
|
||||||
@ -87,12 +103,17 @@ public class BlockStorage implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@EventHandler(priority = EventPriority.MONITOR)
|
@EventHandler(priority = EventPriority.MONITOR)
|
||||||
public void Explosion(EntityExplodeEvent event){
|
public void Explosion(EntityExplodeEvent event){
|
||||||
List<Block> blocksd = event.blockList();
|
List<Block> blocksd = event.blockList();
|
||||||
Entity e = event.getEntity();
|
Entity e = event.getEntity();
|
||||||
|
int i = 0;
|
||||||
if(!event.isCancelled()){
|
if(!event.isCancelled()){
|
||||||
if(plugin.canjoin){
|
for(i = 1; i <= plugin.canjoin.size(); i++){
|
||||||
|
if(plugin.canjoin.get(i)){
|
||||||
|
i = plugin.canjoin.size()+1;
|
||||||
if(plugin.config.getStringList("worlds").isEmpty() || (!plugin.config.getStringList("worlds").isEmpty() && plugin.config.getStringList("worlds").contains(event.getEntity().getWorld().getName()))){
|
if(plugin.config.getStringList("worlds").isEmpty() || (!plugin.config.getStringList("worlds").isEmpty() && plugin.config.getStringList("worlds").contains(event.getEntity().getWorld().getName()))){
|
||||||
if(e.getType()== EntityType.PRIMED_TNT){
|
if(e.getType()== EntityType.PRIMED_TNT){
|
||||||
if(!plugin.data.getStringList("Blocks_Placed").contains(e.getLocation().getWorld() + "," + e.getLocation().getX() + "," + e.getLocation().getY() + "," + e.getLocation().getZ()) /*|| !plugin.data.getStringList("Blocks_Destroyed").contains(e.getLocation().getWorld() + "," + e.getLocation().getX() + "," + e.getLocation().getY() + "," + e.getLocation().getZ())*/){
|
if(!plugin.data.getStringList("Blocks_Placed").contains(e.getLocation().getWorld() + "," + e.getLocation().getX() + "," + e.getLocation().getY() + "," + e.getLocation().getZ()) /*|| !plugin.data.getStringList("Blocks_Destroyed").contains(e.getLocation().getWorld() + "," + e.getLocation().getX() + "," + e.getLocation().getY() + "," + e.getLocation().getZ())*/){
|
||||||
@ -100,7 +121,6 @@ public class BlockStorage implements Listener {
|
|||||||
blocks.add(e.getLocation().getWorld().getName() + "," + e.getLocation().getX() + "," + e.getLocation().getY() + "," + e.getLocation().getZ() + ",46" + ",0");
|
blocks.add(e.getLocation().getWorld().getName() + "," + e.getLocation().getX() + "," + e.getLocation().getY() + "," + e.getLocation().getZ() + ",46" + ",0");
|
||||||
plugin.data.set("Blocks_Destroyed", blocks);
|
plugin.data.set("Blocks_Destroyed", blocks);
|
||||||
plugin.saveData();
|
plugin.saveData();
|
||||||
plugin.getServer().broadcastMessage("TNT blew up!");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for(Block b:blocksd){
|
for(Block b:blocksd){
|
||||||
@ -110,9 +130,9 @@ public class BlockStorage implements Listener {
|
|||||||
int z = b.getZ();
|
int z = b.getZ();
|
||||||
int d = b.getTypeId();
|
int d = b.getTypeId();
|
||||||
byte m = b.getData();
|
byte m = b.getData();
|
||||||
String coords = w + "," + x + "," + y + "," + z + "," + d + "," + m;
|
String coords = w + "," + x + "," + y + "," + z + "," + d + "," + m + "," + i;
|
||||||
List<String> blocks = plugin.data.getStringList("Blocks_Destroyed");
|
List<String> blocks = plugin.data.getStringList("Blocks_Destroyed");
|
||||||
if(!plugin.data.getStringList("Blocks_Placed").contains(w + "," + x + "," + y + "," + z) || !plugin.data.getStringList("Blocks_Destroyed").contains(w + "," + x + "," + y + "," + z)){
|
if(!plugin.data.getStringList("Blocks_Placed").contains(w + "," + x + "," + y + "," + z + "," + i) || !plugin.data.getStringList("Blocks_Destroyed").contains(w + "," + x + "," + y + "," + z + "," + i)){
|
||||||
blocks.add(coords);
|
blocks.add(coords);
|
||||||
plugin.data.set("Blocks_Destroyed", blocks);
|
plugin.data.set("Blocks_Destroyed", blocks);
|
||||||
plugin.saveData();
|
plugin.saveData();
|
||||||
@ -122,11 +142,15 @@ public class BlockStorage implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
@EventHandler(priority = EventPriority.MONITOR)
|
@EventHandler(priority = EventPriority.MONITOR)
|
||||||
public void burningBlocks(BlockBurnEvent event){
|
public void burningBlocks(BlockBurnEvent event){
|
||||||
Block b = event.getBlock();
|
Block b = event.getBlock();
|
||||||
|
int i = 0;
|
||||||
if(!event.isCancelled()){
|
if(!event.isCancelled()){
|
||||||
if(plugin.canjoin){
|
for(i = 1; i <= plugin.canjoin.size(); i++){
|
||||||
|
if(plugin.canjoin.get(i)){
|
||||||
|
i = plugin.canjoin.size()+1;
|
||||||
if(plugin.config.getStringList("worlds").isEmpty() || (!plugin.config.getStringList("worlds").isEmpty() && plugin.config.getStringList("worlds").contains(b.getWorld().getName()))){
|
if(plugin.config.getStringList("worlds").isEmpty() || (!plugin.config.getStringList("worlds").isEmpty() && plugin.config.getStringList("worlds").contains(b.getWorld().getName()))){
|
||||||
String w = b.getWorld().getName();
|
String w = b.getWorld().getName();
|
||||||
int x = b.getX();
|
int x = b.getX();
|
||||||
@ -134,9 +158,9 @@ public class BlockStorage implements Listener {
|
|||||||
int z = b.getZ();
|
int z = b.getZ();
|
||||||
int d = b.getTypeId();
|
int d = b.getTypeId();
|
||||||
byte m = b.getData();
|
byte m = b.getData();
|
||||||
String coords = w + "," + x + "," + y + "," + z + "," + d + "," + m;
|
String coords = w + "," + x + "," + y + "," + z + "," + d + "," + m + "," + i;
|
||||||
List<String> blocks = plugin.data.getStringList("Blocks_Destroyed");
|
List<String> blocks = plugin.data.getStringList("Blocks_Destroyed");
|
||||||
if(!plugin.data.getStringList("Blocks_Placed").contains(w + "," + x + "," + y + "," + z)){
|
if(!plugin.data.getStringList("Blocks_Placed").contains(w + "," + x + "," + y + "," + z + "," + i)){
|
||||||
blocks.add(coords);
|
blocks.add(coords);
|
||||||
plugin.data.set("Blocks_Destroyed", blocks);
|
plugin.data.set("Blocks_Destroyed", blocks);
|
||||||
plugin.saveData();
|
plugin.saveData();
|
||||||
@ -145,13 +169,16 @@ public class BlockStorage implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
@EventHandler(priority = EventPriority.MONITOR)
|
@EventHandler(priority = EventPriority.MONITOR)
|
||||||
public void blockPlace(BlockPlaceEvent event){
|
public void blockPlace(BlockPlaceEvent event){
|
||||||
Block b = event.getBlock();
|
Block b = event.getBlock();
|
||||||
Player p = event.getPlayer();
|
Player p = event.getPlayer();
|
||||||
|
if(plugin.getArena(p)!= null){
|
||||||
|
int a = plugin.getArena(p);
|
||||||
if(!event.isCancelled()){
|
if(!event.isCancelled()){
|
||||||
if(plugin.Playing.contains(p.getName())){
|
if(plugin.Playing.get(a).contains(p.getName())){
|
||||||
if(plugin.canjoin){
|
if(plugin.canjoin.get(a)){
|
||||||
if(plugin.config.getStringList("worlds").isEmpty() || (!plugin.config.getStringList("worlds").isEmpty() && plugin.config.getStringList("worlds").contains(b.getWorld().getName()))){
|
if(plugin.config.getStringList("worlds").isEmpty() || (!plugin.config.getStringList("worlds").isEmpty() && plugin.config.getStringList("worlds").contains(b.getWorld().getName()))){
|
||||||
if((b.getType()== Material.SAND || b.getType()== Material.GRAVEL) && (b.getRelative(BlockFace.DOWN).getType()== Material.AIR || b.getRelative(BlockFace.DOWN).getType()== Material.WATER || b.getRelative(BlockFace.DOWN).getType()== Material.LAVA)){
|
if((b.getType()== Material.SAND || b.getType()== Material.GRAVEL) && (b.getRelative(BlockFace.DOWN).getType()== Material.AIR || b.getRelative(BlockFace.DOWN).getType()== Material.WATER || b.getRelative(BlockFace.DOWN).getType()== Material.LAVA)){
|
||||||
int n = b.getY() -1;
|
int n = b.getY() -1;
|
||||||
@ -165,7 +192,7 @@ public class BlockStorage implements Listener {
|
|||||||
int x = br.getX();
|
int x = br.getX();
|
||||||
int y = br.getY();
|
int y = br.getY();
|
||||||
int z = br.getZ();
|
int z = br.getZ();
|
||||||
String coords = w + "," + x + "," + y + "," + z;
|
String coords = w + "," + x + "," + y + "," + z + "," + a;
|
||||||
p.sendMessage(ChatColor.GREEN + "Sand/Gravel will land at " + coords);
|
p.sendMessage(ChatColor.GREEN + "Sand/Gravel will land at " + coords);
|
||||||
List<String> blocks = plugin.data.getStringList("Blocks_Placed");
|
List<String> blocks = plugin.data.getStringList("Blocks_Placed");
|
||||||
blocks.add(coords);
|
blocks.add(coords);
|
||||||
@ -179,7 +206,7 @@ public class BlockStorage implements Listener {
|
|||||||
int x = b.getX();
|
int x = b.getX();
|
||||||
int y = b.getY();
|
int y = b.getY();
|
||||||
int z = b.getZ();
|
int z = b.getZ();
|
||||||
String coords = w + "," + x + "," + y + "," + z;
|
String coords = w + "," + x + "," + y + "," + z + "," + a;
|
||||||
List<String> blocks = plugin.data.getStringList("Blocks_Placed");
|
List<String> blocks = plugin.data.getStringList("Blocks_Placed");
|
||||||
blocks.add(coords);
|
blocks.add(coords);
|
||||||
plugin.data.set("Blocks_Placed", blocks);
|
plugin.data.set("Blocks_Placed", blocks);
|
||||||
@ -191,18 +218,21 @@ public class BlockStorage implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
@EventHandler(priority = EventPriority.MONITOR)
|
@EventHandler(priority = EventPriority.MONITOR)
|
||||||
public void bucketEmpty(PlayerBucketEmptyEvent event){
|
public void bucketEmpty(PlayerBucketEmptyEvent event){
|
||||||
|
if(plugin.getArena(event.getPlayer())!= null){
|
||||||
|
int a = plugin.getArena(event.getPlayer());
|
||||||
if(!event.isCancelled()){
|
if(!event.isCancelled()){
|
||||||
if(plugin.canjoin){
|
if(plugin.canjoin.get(a)){
|
||||||
if(plugin.Playing.contains(event.getPlayer().getName())){
|
if(plugin.Playing.get(a).contains(event.getPlayer().getName())){
|
||||||
if(plugin.config.getStringList("worlds").isEmpty() || (!plugin.config.getStringList("worlds").isEmpty() && plugin.config.getStringList("worlds").contains(event.getPlayer().getWorld().getName()))){
|
if(plugin.config.getStringList("worlds").isEmpty() || (!plugin.config.getStringList("worlds").isEmpty() && plugin.config.getStringList("worlds").contains(event.getPlayer().getWorld().getName()))){
|
||||||
Block b = event.getBlockClicked().getRelative(event.getBlockFace());
|
Block b = event.getBlockClicked().getRelative(event.getBlockFace());
|
||||||
String w = b.getWorld().getName();
|
String w = b.getWorld().getName();
|
||||||
int x = b.getX();
|
int x = b.getX();
|
||||||
int y = b.getY();
|
int y = b.getY();
|
||||||
int z = b.getZ();
|
int z = b.getZ();
|
||||||
String coords = w + "," + x + "," + y + "," + z;
|
String coords = w + "," + x + "," + y + "," + z + "," + a;
|
||||||
List<String> blocks = plugin.data.getStringList("Blocks_Placed");
|
List<String> blocks = plugin.data.getStringList("Blocks_Placed");
|
||||||
blocks.add(coords);
|
blocks.add(coords);
|
||||||
plugin.data.set("Blocks_Placed", blocks);
|
plugin.data.set("Blocks_Placed", blocks);
|
||||||
@ -212,11 +242,14 @@ public class BlockStorage implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
@EventHandler(priority = EventPriority.MONITOR)
|
@EventHandler(priority = EventPriority.MONITOR)
|
||||||
public void bucketFill(PlayerBucketFillEvent event){
|
public void bucketFill(PlayerBucketFillEvent event){
|
||||||
|
if(plugin.getArena(event.getPlayer())!= null){
|
||||||
|
int a = plugin.getArena(event.getPlayer());
|
||||||
if(!event.isCancelled()){
|
if(!event.isCancelled()){
|
||||||
if(plugin.canjoin){
|
if(plugin.canjoin.get(a)){
|
||||||
if(plugin.Playing.contains(event.getPlayer().getName())){
|
if(plugin.Playing.get(a).contains(event.getPlayer().getName())){
|
||||||
if(plugin.config.getStringList("worlds").isEmpty() || (!plugin.config.getStringList("worlds").isEmpty() && plugin.config.getStringList("worlds").contains(event.getPlayer().getWorld().getName()))){
|
if(plugin.config.getStringList("worlds").isEmpty() || (!plugin.config.getStringList("worlds").isEmpty() && plugin.config.getStringList("worlds").contains(event.getPlayer().getWorld().getName()))){
|
||||||
Block b = event.getBlockClicked().getRelative(event.getBlockFace());
|
Block b = event.getBlockClicked().getRelative(event.getBlockFace());
|
||||||
String w = b.getWorld().getName();
|
String w = b.getWorld().getName();
|
||||||
@ -225,9 +258,9 @@ public class BlockStorage implements Listener {
|
|||||||
int z = b.getZ();
|
int z = b.getZ();
|
||||||
int d = b.getTypeId();
|
int d = b.getTypeId();
|
||||||
byte m = b.getData();
|
byte m = b.getData();
|
||||||
String coords = w + "," + x + "," + y + "," + z + "," + d + "," + m;
|
String coords = w + "," + x + "," + y + "," + z + "," + d + "," + m + "," + a;
|
||||||
List<String> blocks = plugin.data.getStringList("Blocks_Destroyed");
|
List<String> blocks = plugin.data.getStringList("Blocks_Destroyed");
|
||||||
if(!plugin.data.getStringList("Blocks_Placed").contains(w + "," + x + "," + y + "," + z)){
|
if(!plugin.data.getStringList("Blocks_Placed").contains(w + "," + x + "," + y + "," + z + "," + a)){
|
||||||
blocks.add(coords);
|
blocks.add(coords);
|
||||||
plugin.data.set("Blocks_Destroyed", blocks);
|
plugin.data.set("Blocks_Destroyed", blocks);
|
||||||
plugin.saveData();
|
plugin.saveData();
|
||||||
@ -237,11 +270,15 @@ public class BlockStorage implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
@EventHandler(priority = EventPriority.MONITOR)
|
@EventHandler(priority = EventPriority.MONITOR)
|
||||||
public void blockMelt(BlockFadeEvent event){
|
public void blockMelt(BlockFadeEvent event){
|
||||||
|
int i = 0;
|
||||||
if(!event.isCancelled()){
|
if(!event.isCancelled()){
|
||||||
if(plugin.canjoin){
|
for(i = 1; i <= plugin.canjoin.size(); i++){
|
||||||
|
if(plugin.canjoin.get(i)){
|
||||||
if(plugin.config.getStringList("worlds").isEmpty() || (!plugin.config.getStringList("worlds").isEmpty() && plugin.config.getStringList("worlds").contains(event.getBlock().getWorld().getName()))){
|
if(plugin.config.getStringList("worlds").isEmpty() || (!plugin.config.getStringList("worlds").isEmpty() && plugin.config.getStringList("worlds").contains(event.getBlock().getWorld().getName()))){
|
||||||
|
i = plugin.canjoin.size()+1;
|
||||||
Block b = event.getBlock();
|
Block b = event.getBlock();
|
||||||
String w = b.getWorld().getName();
|
String w = b.getWorld().getName();
|
||||||
int x = b.getX();
|
int x = b.getX();
|
||||||
@ -249,9 +286,9 @@ public class BlockStorage implements Listener {
|
|||||||
int z = b.getZ();
|
int z = b.getZ();
|
||||||
int d = b.getTypeId();
|
int d = b.getTypeId();
|
||||||
byte m = b.getData();
|
byte m = b.getData();
|
||||||
String coords = w + "," + x + "," + y + "," + z + "," + d + "," + m;
|
String coords = w + "," + x + "," + y + "," + z + "," + d + "," + m + "," + i;
|
||||||
List<String> blocks = plugin.data.getStringList("Blocks_Destroyed");
|
List<String> blocks = plugin.data.getStringList("Blocks_Destroyed");
|
||||||
if(!plugin.data.getStringList("Blocks_Placed").contains(w + "," + x + "," + y + "," + z)){
|
if(!plugin.data.getStringList("Blocks_Placed").contains(w + "," + x + "," + y + "," + z + "," + i)){
|
||||||
blocks.add(coords);
|
blocks.add(coords);
|
||||||
plugin.data.set("Blocks_Destroyed", blocks);
|
plugin.data.set("Blocks_Destroyed", blocks);
|
||||||
plugin.saveData();
|
plugin.saveData();
|
||||||
@ -260,6 +297,7 @@ public class BlockStorage implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/*@EventHandler
|
/*@EventHandler
|
||||||
public void blockGrow(BlockGrowEvent event){
|
public void blockGrow(BlockGrowEvent event){
|
||||||
if(plugin.canjoin== true){
|
if(plugin.canjoin== true){
|
||||||
|
@ -18,8 +18,8 @@ public class ChatListener implements Listener {
|
|||||||
public void TributeChat(AsyncPlayerChatEvent event){
|
public void TributeChat(AsyncPlayerChatEvent event){
|
||||||
Player p = event.getPlayer();
|
Player p = event.getPlayer();
|
||||||
String pname = p.getName();
|
String pname = p.getName();
|
||||||
if(plugin.Playing.contains(pname)){
|
if(plugin.getArena(p)!= null){
|
||||||
String msg = "<" + ChatColor.RED + "[Tribute] " + ChatColor.WHITE + p.getName() + ">" + " " + event.getMessage();
|
String msg = "<" + ChatColor.RED + "[Tribute] " + ChatColor.WHITE + pname + ">" + " " + event.getMessage();
|
||||||
if(plugin.config.getString("ChatClose").equalsIgnoreCase("True")){
|
if(plugin.config.getString("ChatClose").equalsIgnoreCase("True")){
|
||||||
double radius = plugin.config.getDouble("ChatClose_Radius");
|
double radius = plugin.config.getDouble("ChatClose_Radius");
|
||||||
List<Entity> near = p.getNearbyEntities(radius, radius, radius);
|
List<Entity> near = p.getNearbyEntities(radius, radius, radius);
|
||||||
@ -27,10 +27,9 @@ public class ChatListener implements Listener {
|
|||||||
if(!(near.size()== 0)){
|
if(!(near.size()== 0)){
|
||||||
p.sendMessage(msg);
|
p.sendMessage(msg);
|
||||||
for(Entity e:near){
|
for(Entity e:near){
|
||||||
if(e instanceof Player){
|
if(e instanceof Player)
|
||||||
((Player) e).sendMessage(msg);
|
((Player) e).sendMessage(msg);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}else if(near.size()== 0){
|
}else if(near.size()== 0){
|
||||||
p.sendMessage(msg);
|
p.sendMessage(msg);
|
||||||
p.sendMessage(ChatColor.YELLOW + "No one near!");
|
p.sendMessage(ChatColor.YELLOW + "No one near!");
|
||||||
|
@ -3,16 +3,13 @@ package me.Travja.HungerArena;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.GameMode;
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.block.Chest;
|
import org.bukkit.block.Chest;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.block.Action;
|
|
||||||
import org.bukkit.event.block.BlockBreakEvent;
|
import org.bukkit.event.block.BlockBreakEvent;
|
||||||
import org.bukkit.event.player.PlayerInteractEvent;
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
@ -25,43 +22,15 @@ public class Chests implements Listener {
|
|||||||
@EventHandler(priority = EventPriority.HIGHEST)
|
@EventHandler(priority = EventPriority.HIGHEST)
|
||||||
public void ChestBreak(BlockBreakEvent event){
|
public void ChestBreak(BlockBreakEvent event){
|
||||||
Player p = event.getPlayer();
|
Player p = event.getPlayer();
|
||||||
|
|
||||||
Block block = event.getBlock();
|
Block block = event.getBlock();
|
||||||
if(p.getItemInHand().getType()== Material.BLAZE_ROD && p.hasPermission("HungerArena.Chest.Store")){
|
if(p.hasPermission("HungerArena.Chest.Break")){
|
||||||
if(block.getState() instanceof Chest){
|
Location blocklocation = block.getLocation();
|
||||||
event.setCancelled(true);
|
|
||||||
ItemStack[] itemsinchest = ((Chest) block.getState()).getInventory().getContents();
|
|
||||||
int blockx = block.getX();
|
|
||||||
int blocky = block.getY();
|
|
||||||
int blockz = block.getZ();
|
|
||||||
String blockw = block.getWorld().getName().toString();
|
|
||||||
if(!plugin.getConfig().contains("Storage." + blockx + "," + blocky + "," + blockz + ".Location.X")){
|
|
||||||
plugin.getConfig().addDefault("Storage." + blockx + "," + blocky + "," + blockz + ".Location.X", blockx);
|
|
||||||
plugin.getConfig().addDefault("Storage." + blockx + "," + blocky + "," + blockz + ".Location.Y", blocky);
|
|
||||||
plugin.getConfig().addDefault("Storage." + blockx + "," + blocky + "," + blockz + ".Location.Z",blockz);
|
|
||||||
plugin.getConfig().addDefault("Storage." + blockx + "," + blocky + "," + blockz + ".Location.W", blockw);
|
|
||||||
plugin.getConfig().addDefault("Storage." + blockx + "," + blocky + "," + blockz + ".ItemsInStorage", itemsinchest);
|
|
||||||
}
|
|
||||||
List<String> list2 = plugin.getConfig().getStringList("StorageXYZ");
|
|
||||||
if(!list2.contains(blockx + "," + blocky + "," + blockz)){
|
|
||||||
list2.add(blockx + "," + blocky + "," + blockz);
|
|
||||||
plugin.getConfig().set("StorageXYZ", list2);
|
|
||||||
plugin.getConfig().options().copyDefaults(true);
|
|
||||||
plugin.saveConfig();
|
|
||||||
p.sendMessage(ChatColor.GREEN + "Chest Stored!");
|
|
||||||
}else{
|
|
||||||
p.sendMessage(ChatColor.GREEN + "Chest already stored!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}else if(p.getItemInHand().getType()== Material.BLAZE_ROD && !p.hasPermission("HungerArena.Chest.Store") && block.getState() instanceof Chest){
|
|
||||||
event.setCancelled(true);
|
|
||||||
p.sendMessage(ChatColor.RED + "You can't store chests!!");
|
|
||||||
}else if(p.hasPermission("HungerArena.Chest.Break")){
|
|
||||||
Location blocklocation = event.getBlock().getLocation();
|
|
||||||
int blockx = blocklocation.getBlockX();
|
int blockx = blocklocation.getBlockX();
|
||||||
int blocky = blocklocation.getBlockY();
|
int blocky = blocklocation.getBlockY();
|
||||||
int blockz = blocklocation.getBlockZ();
|
int blockz = blocklocation.getBlockZ();
|
||||||
if (plugin.getConfig().getStringList("StorageXYZ").contains(blockx + "," + blocky + "," + blockz)) {
|
if (plugin.getConfig().getStringList("StorageXYZ").contains(blockx + "," + blocky + "," + blockz)) {
|
||||||
if(p.hasPermission("HungerArena.Chest.Break")){
|
if(p.hasPermission("HungerArena.Chest.Break") && plugin.getArena(p)== null){
|
||||||
List<String> list2 = plugin.getConfig().getStringList("StorageXYZ");
|
List<String> list2 = plugin.getConfig().getStringList("StorageXYZ");
|
||||||
list2.remove(blockx + "," + blocky + "," + blockz);
|
list2.remove(blockx + "," + blocky + "," + blockz);
|
||||||
plugin.getConfig().set("Storage." + blockx + "," + blocky+ "," + blockz, null);
|
plugin.getConfig().set("Storage." + blockx + "," + blocky+ "," + blockz, null);
|
||||||
@ -80,42 +49,9 @@ public class Chests implements Listener {
|
|||||||
public void ChestSaves(PlayerInteractEvent event){
|
public void ChestSaves(PlayerInteractEvent event){
|
||||||
Block block = event.getClickedBlock();
|
Block block = event.getClickedBlock();
|
||||||
Player p = event.getPlayer();
|
Player p = event.getPlayer();
|
||||||
if(event.getAction()== Action.LEFT_CLICK_BLOCK || event.getAction()== Action.RIGHT_CLICK_BLOCK){
|
if(plugin.getArena(p)!= null){
|
||||||
if(p.getItemInHand().getType()== Material.BLAZE_ROD && event.getAction() == Action.LEFT_CLICK_BLOCK){
|
int a = plugin.getArena(p);
|
||||||
if(!plugin.restricted || (plugin.restricted && plugin.worlds.contains(p.getWorld().getName()))){
|
if(plugin.Playing.get(a).contains(p.getName()) && plugin.canjoin.get(a)){
|
||||||
if(p.getGameMode().equals(GameMode.SURVIVAL)){
|
|
||||||
if(block.getState() instanceof Chest){
|
|
||||||
if(p.hasPermission("HungerArena.Chest.Store")){
|
|
||||||
ItemStack[] itemsinchest = ((Chest) block.getState()).getInventory().getContents();
|
|
||||||
List<String> list2 = plugin.getConfig().getStringList("StorageXYZ");
|
|
||||||
int blockx = block.getX();
|
|
||||||
int blocky = block.getY();
|
|
||||||
int blockz = block.getZ();
|
|
||||||
String blockw = block.getWorld().getName().toString();
|
|
||||||
if(!plugin.getConfig().contains("Storage." + blockx + "," + blocky + "," + blockz + ".Location.X")){
|
|
||||||
plugin.getConfig().addDefault("Storage." + blockx + "," + blocky + "," + blockz + ".Location.X", blockx);
|
|
||||||
plugin.getConfig().addDefault("Storage." + blockx + "," + blocky + "," + blockz + ".Location.Y", blocky);
|
|
||||||
plugin.getConfig().addDefault("Storage." + blockx + "," + blocky + "," + blockz + ".Location.Z",blockz);
|
|
||||||
plugin.getConfig().addDefault("Storage." + blockx + "," + blocky + "," + blockz + ".Location.W", blockw);
|
|
||||||
plugin.getConfig().addDefault("Storage." + blockx + "," + blocky + "," + blockz + ".ItemsInStorage", itemsinchest);
|
|
||||||
}
|
|
||||||
if(!list2.contains(blockx + "," + blocky + "," + blockz)){
|
|
||||||
list2.add(blockx + "," + blocky + "," + blockz);
|
|
||||||
plugin.getConfig().set("StorageXYZ", list2);
|
|
||||||
plugin.getConfig().options().copyDefaults(true);
|
|
||||||
plugin.saveConfig();
|
|
||||||
p.sendMessage(ChatColor.GREEN + "Chest Stored!");
|
|
||||||
}else{
|
|
||||||
p.sendMessage(ChatColor.GREEN + "Chest already stored!");
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
p.sendMessage(ChatColor.RED + "You don't have permission to store chests!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(plugin.Playing.contains(p.getName()) && plugin.canjoin){
|
|
||||||
if(!plugin.restricted || (plugin.restricted && plugin.worlds.contains(p.getWorld().getName()))){
|
if(!plugin.restricted || (plugin.restricted && plugin.worlds.contains(p.getWorld().getName()))){
|
||||||
if(block.getState() instanceof Chest){
|
if(block.getState() instanceof Chest){
|
||||||
ItemStack[] itemsinchest = ((Chest) block.getState()).getInventory().getContents();
|
ItemStack[] itemsinchest = ((Chest) block.getState()).getInventory().getContents();
|
||||||
@ -129,6 +65,7 @@ public class Chests implements Listener {
|
|||||||
plugin.getConfig().addDefault("Storage." + blockx + "," + blocky + "," + blockz + ".Location.Z",blockz);
|
plugin.getConfig().addDefault("Storage." + blockx + "," + blocky + "," + blockz + ".Location.Z",blockz);
|
||||||
plugin.getConfig().addDefault("Storage." + blockx + "," + blocky + "," + blockz + ".Location.W", blockw);
|
plugin.getConfig().addDefault("Storage." + blockx + "," + blocky + "," + blockz + ".Location.W", blockw);
|
||||||
plugin.getConfig().addDefault("Storage." + blockx + "," + blocky + "," + blockz + ".ItemsInStorage", itemsinchest);
|
plugin.getConfig().addDefault("Storage." + blockx + "," + blocky + "," + blockz + ".ItemsInStorage", itemsinchest);
|
||||||
|
plugin.getConfig().addDefault("Storage." + blockx + "," + blocky + "," + blockz + ".Arena", a);
|
||||||
}
|
}
|
||||||
List<String> list2 = plugin.getConfig().getStringList("StorageXYZ");
|
List<String> list2 = plugin.getConfig().getStringList("StorageXYZ");
|
||||||
if(!list2.contains(blockx + "," + blocky + "," + blockz)){
|
if(!list2.contains(blockx + "," + blocky + "," + blockz)){
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package me.Travja.HungerArena;
|
package me.Travja.HungerArena;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
@ -17,14 +18,21 @@ public class CommandBlock implements Listener {
|
|||||||
String cmd = event.getMessage();
|
String cmd = event.getMessage();
|
||||||
Player p = event.getPlayer();
|
Player p = event.getPlayer();
|
||||||
String pname = p.getName();
|
String pname = p.getName();
|
||||||
if(plugin.Playing.contains(pname) || plugin.Watching.contains(pname)){
|
int i = 0;
|
||||||
|
int x = 0;
|
||||||
|
for(x = 1; x < plugin.Watching.size(); x++){
|
||||||
|
if(plugin.Watching.get(x).contains(p.getName())){
|
||||||
if(!p.hasPermission("HungerArena.UseCommands")){
|
if(!p.hasPermission("HungerArena.UseCommands")){
|
||||||
if(!plugin.management.getStringList("commands.whitelist").isEmpty() && !cmd.toLowerCase().contains("/ha")){
|
if(!plugin.management.getStringList("commands.whitelist").isEmpty()){
|
||||||
for(String whitelist: plugin.management.getStringList("commands.whitelist")){
|
for(String whitelist: plugin.management.getStringList("commands.whitelist")){
|
||||||
if(!cmd.toLowerCase().contains(whitelist.toLowerCase()) && !cmd.toLowerCase().contains("/ha")){
|
i = i+1;
|
||||||
|
if(i== plugin.management.getStringList("commands.whitelist").size()){
|
||||||
|
if(!cmd.toLowerCase().startsWith(whitelist.toLowerCase()) || !cmd.toLowerCase().startsWith("/ha")){
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
p.sendMessage(ChatColor.RED + "You are only allowed to perform the following commands:");
|
p.sendMessage(ChatColor.RED + "You are only allowed to perform the following commands:");
|
||||||
p.sendMessage(ChatColor.AQUA + whitelist);
|
for(String whitelistfull: plugin.management.getStringList("commands.whitelist")){
|
||||||
|
p.sendMessage(ChatColor.AQUA + whitelistfull);
|
||||||
|
}
|
||||||
p.sendMessage(ChatColor.AQUA + "/ha");
|
p.sendMessage(ChatColor.AQUA + "/ha");
|
||||||
p.sendMessage(ChatColor.AQUA + "/ha close");
|
p.sendMessage(ChatColor.AQUA + "/ha close");
|
||||||
p.sendMessage(ChatColor.AQUA + "/ha help");
|
p.sendMessage(ChatColor.AQUA + "/ha help");
|
||||||
@ -45,30 +53,94 @@ public class CommandBlock implements Listener {
|
|||||||
p.sendMessage(ChatColor.AQUA + "/ha warpall");
|
p.sendMessage(ChatColor.AQUA + "/ha warpall");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else if(!cmd.toLowerCase().contains("/ha")){
|
}
|
||||||
|
}else if(!cmd.toLowerCase().startsWith("/ha")){
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
p.sendMessage(ChatColor.RED + "You are only allowed to perform /ha commands!");
|
p.sendMessage(ChatColor.RED + "You are only allowed to perform /ha commands!");
|
||||||
}
|
}
|
||||||
}else if(!cmd.toLowerCase().contains("/ha")){
|
}else if(!cmd.toLowerCase().startsWith("/ha")){
|
||||||
if(cmd.toLowerCase().contains("/spawn")){
|
if(cmd.toLowerCase().startsWith("/spawn")){
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
p.sendMessage("You have perms for all commands except this one!");
|
p.sendMessage("You have perms for all commands except this one!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else if(cmd.toLowerCase().equals("/back") && plugin.Dead.contains(pname) && plugin.canjoin== true){
|
}
|
||||||
|
}
|
||||||
|
if(plugin.getArena(p)!= null){
|
||||||
|
if(!p.hasPermission("HungerArena.UseCommands")){
|
||||||
|
if(!plugin.management.getStringList("commands.whitelist").isEmpty()){
|
||||||
|
for(String whitelist: plugin.management.getStringList("commands.whitelist")){
|
||||||
|
i = i+1;
|
||||||
|
if(i== plugin.management.getStringList("commands.whitelist").size()){
|
||||||
|
if(!cmd.toLowerCase().startsWith(whitelist.toLowerCase()) || !cmd.toLowerCase().startsWith("/ha")){
|
||||||
|
event.setCancelled(true);
|
||||||
|
p.sendMessage(ChatColor.RED + "You are only allowed to perform the following commands:");
|
||||||
|
for(String whitelistfull: plugin.management.getStringList("commands.whitelist")){
|
||||||
|
p.sendMessage(ChatColor.AQUA + whitelistfull);
|
||||||
|
}
|
||||||
|
p.sendMessage(ChatColor.AQUA + "/ha");
|
||||||
|
p.sendMessage(ChatColor.AQUA + "/ha close");
|
||||||
|
p.sendMessage(ChatColor.AQUA + "/ha help");
|
||||||
|
p.sendMessage(ChatColor.AQUA + "/ha join");
|
||||||
|
p.sendMessage(ChatColor.AQUA + "/ha kick [Player]");
|
||||||
|
p.sendMessage(ChatColor.AQUA + "/ha leave");
|
||||||
|
p.sendMessage(ChatColor.AQUA + "/ha list");
|
||||||
|
p.sendMessage(ChatColor.AQUA + "/ha open");
|
||||||
|
p.sendMessage(ChatColor.AQUA + "/ha ready");
|
||||||
|
p.sendMessage(ChatColor.AQUA + "/ha refill");
|
||||||
|
p.sendMessage(ChatColor.AQUA + "/ha reload");
|
||||||
|
p.sendMessage(ChatColor.AQUA + "/ha restart");
|
||||||
|
p.sendMessage(ChatColor.AQUA + "/ha rlist");
|
||||||
|
p.sendMessage(ChatColor.AQUA + "/ha setspawn");
|
||||||
|
p.sendMessage(ChatColor.AQUA + "/ha start");
|
||||||
|
p.sendMessage(ChatColor.AQUA + "/ha tp");
|
||||||
|
p.sendMessage(ChatColor.AQUA + "/ha watch");
|
||||||
|
p.sendMessage(ChatColor.AQUA + "/ha warpall");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else if(!cmd.toLowerCase().startsWith("/ha")){
|
||||||
|
event.setCancelled(true);
|
||||||
|
p.sendMessage(ChatColor.RED + "You are only allowed to perform /ha commands!");
|
||||||
|
}
|
||||||
|
}else if(!cmd.toLowerCase().startsWith("/ha")){
|
||||||
|
if(cmd.toLowerCase().startsWith("/spawn")){
|
||||||
|
event.setCancelled(true);
|
||||||
|
p.sendMessage("You have perms for all commands except this one!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else if(cmd.toLowerCase().equals("/back")){
|
||||||
|
for(i = 1; i < plugin.Dead.size(); i++){
|
||||||
|
if(plugin.Dead.get(i).contains(pname) && plugin.canjoin.get(i))
|
||||||
plugin.Tele.add(p);
|
plugin.Tele.add(p);
|
||||||
}else if(!plugin.Playing.contains(pname) || !plugin.Watching.contains(pname)){
|
}
|
||||||
if(cmd.contains("/tp") || cmd.contains("/tpa") || cmd.contains("/tpo")){
|
}else if(cmd.startsWith("/tp") || cmd.startsWith("/tpa") || cmd.startsWith("/tpo")){
|
||||||
String[] args = cmd.split(" ");
|
String[] args = cmd.split(" ");
|
||||||
if(args.length == 3){
|
Player arg1 = null;
|
||||||
if(plugin.Playing.contains(plugin.getServer().getPlayer(args[1]).getName()) || plugin.Playing.contains(plugin.getServer().getPlayer(args[2]).getName())){
|
Player arg2 = null;
|
||||||
|
if(args.length == 2){
|
||||||
|
if(Bukkit.getPlayer(args[0]) != null && Bukkit.getPlayer(args[1]) != null){
|
||||||
|
arg1 = Bukkit.getPlayer(args[0]);
|
||||||
|
arg2 = Bukkit.getPlayer(args[1]);
|
||||||
|
if(plugin.isSpectating(p)){
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
p.sendMessage(ChatColor.RED + "You can't teleport to tributes unless you've run /ha watch!");
|
p.sendMessage(ChatColor.RED + "Invalid command for spectating, using /ha tp " + arg2);
|
||||||
}
|
p.performCommand("/ha tp " + arg2);
|
||||||
}else if(args.length == 2){
|
}else if(plugin.getArena(arg1)!= null || plugin.getArena(arg2)!= null){
|
||||||
if(plugin.Playing.contains(plugin.getServer().getPlayer(args[1]).getName())){
|
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
p.sendMessage(ChatColor.RED + "You can't teleport to tributes unless you've run /ha watch!");
|
p.sendMessage(ChatColor.RED + "You can't teleport to other tributes!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else if(args.length == 1){
|
||||||
|
if(Bukkit.getPlayer(args[0]) != null){
|
||||||
|
arg1 = Bukkit.getPlayer(args[0]);
|
||||||
|
if(plugin.isSpectating(p)){
|
||||||
|
event.setCancelled(true);
|
||||||
|
p.sendMessage(ChatColor.RED + "Invalid command for spectating, using /ha tp " + arg1);
|
||||||
|
p.performCommand("/ha tp " + arg1);
|
||||||
|
}else if(plugin.getArena(arg1)!= null || plugin.getArena(p)!= null){
|
||||||
|
event.setCancelled(true);
|
||||||
|
p.sendMessage(ChatColor.RED + "You can't teleport to other tributes!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,6 @@ package me.Travja.HungerArena;
|
|||||||
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.Server;
|
import org.bukkit.Server;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.configuration.file.FileConfiguration;
|
import org.bukkit.configuration.file.FileConfiguration;
|
||||||
@ -20,11 +19,13 @@ public class DeathListener implements Listener{
|
|||||||
}
|
}
|
||||||
public FileConfiguration config;
|
public FileConfiguration config;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
int a = 0;
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerRespawn(PlayerRespawnEvent event){
|
public void onPlayerRespawn(PlayerRespawnEvent event){
|
||||||
final Player p = event.getPlayer();
|
final Player p = event.getPlayer();
|
||||||
String pname = p.getName();
|
String pname = p.getName();
|
||||||
if(plugin.Dead.contains(pname)){
|
for(i = 1; i < plugin.Dead.size(); i++){
|
||||||
|
if(plugin.Dead.get(i).contains(pname)){
|
||||||
String[] Spawncoords = plugin.spawns.getString("Spawn_coords").split(",");
|
String[] Spawncoords = plugin.spawns.getString("Spawn_coords").split(",");
|
||||||
World spawnw = plugin.getServer().getWorld(Spawncoords[3]);
|
World spawnw = plugin.getServer().getWorld(Spawncoords[3]);
|
||||||
double spawnx = Double.parseDouble(Spawncoords[0]);
|
double spawnx = Double.parseDouble(Spawncoords[0]);
|
||||||
@ -38,6 +39,7 @@ public class DeathListener implements Listener{
|
|||||||
}, 10L);
|
}, 10L);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerDeath(PlayerDeathEvent event){
|
public void onPlayerDeath(PlayerDeathEvent event){
|
||||||
Player p = event.getEntity();
|
Player p = event.getEntity();
|
||||||
@ -45,7 +47,10 @@ public class DeathListener implements Listener{
|
|||||||
String pname = p.getName();
|
String pname = p.getName();
|
||||||
int players = plugin.Playing.size()-1;
|
int players = plugin.Playing.size()-1;
|
||||||
String leftmsg = ChatColor.BLUE + "There are now " + players + " tributes left!";
|
String leftmsg = ChatColor.BLUE + "There are now " + players + " tributes left!";
|
||||||
if(plugin.Frozen.contains(pname) && plugin.Playing.contains(pname)){
|
for(i = 1; i < plugin.Frozen.size(); i++){
|
||||||
|
if(plugin.Frozen.get(i).contains(pname)){
|
||||||
|
if(plugin.getArena(p)!= null){
|
||||||
|
a = plugin.getArena(p);
|
||||||
if(plugin.config.getString("Cannon_Death").equalsIgnoreCase("True")){
|
if(plugin.config.getString("Cannon_Death").equalsIgnoreCase("True")){
|
||||||
double y = p.getLocation().getY();
|
double y = p.getLocation().getY();
|
||||||
double newy = y+200;
|
double newy = y+200;
|
||||||
@ -55,13 +60,29 @@ public class DeathListener implements Listener{
|
|||||||
p.getWorld().strikeLightning(strike);
|
p.getWorld().strikeLightning(strike);
|
||||||
}
|
}
|
||||||
event.setDeathMessage("");
|
event.setDeathMessage("");
|
||||||
|
if(plugin.config.getBoolean("broadcastAll")){
|
||||||
p.getServer().broadcastMessage(pname + ChatColor.LIGHT_PURPLE + " Stepped off their pedestal too early!");
|
p.getServer().broadcastMessage(pname + ChatColor.LIGHT_PURPLE + " Stepped off their pedestal too early!");
|
||||||
plugin.Frozen.remove(pname);
|
}else{
|
||||||
plugin.Playing.remove(pname);
|
for(String gn: plugin.Playing.get(a)){
|
||||||
plugin.Dead.add(pname);
|
Player g = plugin.getServer().getPlayer(gn);
|
||||||
s.broadcastMessage(leftmsg);
|
g.sendMessage(pname + ChatColor.LIGHT_PURPLE + " Stepped off their pedestal too early!");
|
||||||
plugin.winner();
|
}
|
||||||
}else if(plugin.Playing.contains(pname)){
|
}
|
||||||
|
plugin.Frozen.get(a).remove(pname);
|
||||||
|
plugin.Playing.get(a).remove(pname);
|
||||||
|
plugin.Dead.get(a).add(pname);
|
||||||
|
if(plugin.config.getBoolean("broadcastAll")){
|
||||||
|
p.getServer().broadcastMessage(leftmsg);
|
||||||
|
}else{
|
||||||
|
for(String gn: plugin.Playing.get(a)){
|
||||||
|
Player g = plugin.getServer().getPlayer(gn);
|
||||||
|
g.sendMessage(leftmsg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
plugin.winner(a);
|
||||||
|
}
|
||||||
|
}else if(plugin.getArena(p)!= null){
|
||||||
|
a = plugin.getArena(p);
|
||||||
if(plugin.config.getString("Cannon_Death").equalsIgnoreCase("True")){
|
if(plugin.config.getString("Cannon_Death").equalsIgnoreCase("True")){
|
||||||
double y = p.getLocation().getY();
|
double y = p.getLocation().getY();
|
||||||
double newy = y+200;
|
double newy = y+200;
|
||||||
@ -70,31 +91,56 @@ public class DeathListener implements Listener{
|
|||||||
Location strike = new Location(p.getWorld(), x, newy, z);
|
Location strike = new Location(p.getWorld(), x, newy, z);
|
||||||
p.getWorld().strikeLightning(strike);
|
p.getWorld().strikeLightning(strike);
|
||||||
}
|
}
|
||||||
plugin.Dead.add(pname);
|
plugin.Dead.get(a).add(pname);
|
||||||
plugin.Playing.remove(pname);
|
plugin.Playing.get(a).remove(pname);
|
||||||
if(p.getKiller() instanceof Player){
|
if(p.getKiller() instanceof Player){
|
||||||
if(p.getKiller().getItemInHand().getType().getId()== 0){
|
if(p.getKiller().getItemInHand().getType().getId()== 0){
|
||||||
Player killer = p.getKiller();
|
Player killer = p.getKiller();
|
||||||
String killername = killer.getName();
|
String killername = killer.getName();
|
||||||
event.setDeathMessage("");
|
event.setDeathMessage("");
|
||||||
|
if(plugin.config.getBoolean("broadcastAll")){
|
||||||
s.broadcastMessage(ChatColor.LIGHT_PURPLE + "**BOOM** Tribute " + pname + " was killed by tribute " + killername + " with their FIST!");
|
s.broadcastMessage(ChatColor.LIGHT_PURPLE + "**BOOM** Tribute " + pname + " was killed by tribute " + killername + " with their FIST!");
|
||||||
s.broadcastMessage(leftmsg);
|
s.broadcastMessage(leftmsg);
|
||||||
plugin.winner();
|
}else{
|
||||||
|
for(String gn: plugin.Playing.get(a)){
|
||||||
|
Player g = plugin.getServer().getPlayer(gn);
|
||||||
|
g.sendMessage(ChatColor.LIGHT_PURPLE + "**BOOM** Tribute " + pname + " was killed by tribute " + killername + " with their FIST!");
|
||||||
|
g.sendMessage(leftmsg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
plugin.winner(a);
|
||||||
}else{
|
}else{
|
||||||
Player killer = p.getKiller();
|
Player killer = p.getKiller();
|
||||||
String killername = killer.getName();
|
String killername = killer.getName();
|
||||||
Material weapon = killer.getItemInHand().getType();
|
String weapon = killer.getItemInHand().getType().toString().replace('_', ' ');
|
||||||
String msg = ChatColor.LIGHT_PURPLE + "**BOOM** Tribute " + pname + " was killed by tribute " + killername + " with a(n) " + weapon;
|
String msg = ChatColor.LIGHT_PURPLE + "**BOOM** Tribute " + pname + " was killed by tribute " + killername + " with a(n) " + weapon;
|
||||||
event.setDeathMessage("");
|
event.setDeathMessage("");
|
||||||
|
if(plugin.config.getBoolean("broadcastAll")){
|
||||||
s.broadcastMessage(msg);
|
s.broadcastMessage(msg);
|
||||||
s.broadcastMessage(leftmsg);
|
s.broadcastMessage(leftmsg);
|
||||||
plugin.winner();
|
}else{
|
||||||
|
for(String gn: plugin.Playing.get(a)){
|
||||||
|
Player g = plugin.getServer().getPlayer(gn);
|
||||||
|
g.sendMessage(msg);
|
||||||
|
g.sendMessage(leftmsg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
plugin.winner(a);
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
event.setDeathMessage("");
|
event.setDeathMessage("");
|
||||||
|
if(plugin.config.getBoolean("broadcastAll")){
|
||||||
s.broadcastMessage(ChatColor.LIGHT_PURPLE + pname + " died of natural causes!");
|
s.broadcastMessage(ChatColor.LIGHT_PURPLE + pname + " died of natural causes!");
|
||||||
s.broadcastMessage(leftmsg);
|
s.broadcastMessage(leftmsg);
|
||||||
plugin.winner();
|
}else{
|
||||||
|
for(String gn: plugin.Playing.get(a)){
|
||||||
|
Player g = plugin.getServer().getPlayer(gn);
|
||||||
|
g.sendMessage(ChatColor.LIGHT_PURPLE + pname + " died of natural causes!");
|
||||||
|
g.sendMessage(leftmsg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
plugin.winner(a);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,14 +16,15 @@ public class DmgListener implements Listener {
|
|||||||
public DmgListener(Main m) {
|
public DmgListener(Main m) {
|
||||||
this.plugin = m;
|
this.plugin = m;
|
||||||
}
|
}
|
||||||
|
int i = 0;
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onDmg(EntityDamageEvent evt) {
|
public void onDmg(EntityDamageEvent evt) {
|
||||||
Entity e = evt.getEntity();
|
Entity e = evt.getEntity();
|
||||||
if (e instanceof Player) {
|
if (e instanceof Player) {
|
||||||
Player p = (Player) e;
|
Player p = (Player) e;
|
||||||
String pn = p.getName();
|
String pn = p.getName();
|
||||||
if (plugin.Frozen.contains(pn)) {
|
for(i= 1; i < plugin.Frozen.size(); i++){
|
||||||
|
if (plugin.Frozen.get(i).contains(pn))
|
||||||
evt.setCancelled(true);
|
evt.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package me.Travja.HungerArena;
|
package me.Travja.HungerArena;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
@ -12,30 +14,33 @@ public class FreezeListener implements Listener {
|
|||||||
this.plugin = m;
|
this.plugin = m;
|
||||||
}
|
}
|
||||||
int i = 0;
|
int i = 0;
|
||||||
private boolean timeUp;
|
int a = 0;
|
||||||
|
private HashMap<Integer, Boolean> timeUp= new HashMap<Integer, Boolean>();
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerMove(PlayerMoveEvent event){
|
public void onPlayerMove(PlayerMoveEvent event){
|
||||||
Player p = event.getPlayer();
|
Player p = event.getPlayer();
|
||||||
String pname = p.getName();
|
String pname = p.getName();
|
||||||
if(plugin.Frozen.contains(pname) && plugin.config.getString("Frozen_Teleport").equalsIgnoreCase("True")){
|
if(plugin.getArena(p)!= null){
|
||||||
|
a = plugin.getArena(p);
|
||||||
|
if(plugin.Frozen.get(a).contains(pname) && plugin.config.getString("Frozen_Teleport").equalsIgnoreCase("True")){
|
||||||
if(plugin.config.getString("Explode_on_Move").equalsIgnoreCase("true")){
|
if(plugin.config.getString("Explode_on_Move").equalsIgnoreCase("true")){
|
||||||
for(String players:plugin.Playing){
|
for(String players: plugin.Playing.get(a)){
|
||||||
final Player playing = plugin.getServer().getPlayerExact(players);
|
final Player playing = plugin.getServer().getPlayerExact(players);
|
||||||
i = plugin.Playing.indexOf(players);
|
i = plugin.Playing.get(a).indexOf(players);
|
||||||
if(!timeUp){
|
if(!timeUp.get(a)){
|
||||||
if(!playing.getLocation().getBlock().getLocation().equals(plugin.location.get(i))){
|
if(!playing.getLocation().getBlock().getLocation().equals(plugin.location.get(a).get(i))){
|
||||||
playing.teleport(plugin.location.get(i));
|
playing.teleport(plugin.location.get(a).get(i));
|
||||||
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable(){
|
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable(){
|
||||||
public void run(){
|
public void run(){
|
||||||
if(!timeUp){
|
if(!timeUp.get(a)){
|
||||||
timeUp = true;
|
timeUp.put(a, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},30L);
|
},30L);
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
if(!playing.getLocation().getBlock().getLocation().equals(plugin.location.get(i))){
|
if(!playing.getLocation().getBlock().getLocation().equals(plugin.location.get(a).get(i))){
|
||||||
if(!plugin.Dead.contains(playing.getName())){
|
if(!plugin.Dead.get(a).contains(playing.getName())){
|
||||||
World world = playing.getLocation().getWorld();
|
World world = playing.getLocation().getWorld();
|
||||||
world.createExplosion(playing.getLocation(), 0.0F, false);
|
world.createExplosion(playing.getLocation(), 0.0F, false);
|
||||||
playing.setHealth(0);
|
playing.setHealth(0);
|
||||||
@ -43,831 +48,16 @@ public class FreezeListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*if(plugin.Playing.size()>=1){
|
|
||||||
String one = plugin.Playing.get(0);
|
|
||||||
if(pname==one){
|
|
||||||
Player tone = plugin.getServer().getPlayerExact(one);
|
|
||||||
String[] onecoords = plugin.spawns.getString("Tribute_one_spawn").split(",");
|
|
||||||
double x = Double.parseDouble(onecoords[0]);
|
|
||||||
double y = Double.parseDouble(onecoords[1]);
|
|
||||||
double z = Double.parseDouble(onecoords[2]);
|
|
||||||
World w = plugin.getServer().getWorld(onecoords[3]);
|
|
||||||
Location onespwn = new Location(w,x,y,z);
|
|
||||||
if(!tone.getLocation().getBlock().getLocation().equals(onespwn)){
|
|
||||||
if(!plugin.Dead.contains(tone.getName())){
|
|
||||||
World world = tone.getLocation().getWorld();
|
|
||||||
world.createExplosion(tone.getLocation(), 0.0F, false);
|
|
||||||
tone.setHealth(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(plugin.Playing.size()>=2){
|
|
||||||
String two = plugin.Playing.get(1);
|
|
||||||
if(pname==two){
|
|
||||||
Player ttwo = plugin.getServer().getPlayerExact(two);
|
|
||||||
String[] twocoords = plugin.spawns.getString("Tribute_two_spawn").split(",");
|
|
||||||
double twox = Double.parseDouble(twocoords[0]);
|
|
||||||
double twoy = Double.parseDouble(twocoords[1]);
|
|
||||||
double twoz = Double.parseDouble(twocoords[2]);
|
|
||||||
World twow = plugin.getServer().getWorld(twocoords[3]);
|
|
||||||
Location twospwn = new Location(twow,twox,twoy,twoz);
|
|
||||||
if(!ttwo.getLocation().getBlock().getLocation().equals(twospwn)){
|
|
||||||
if(!plugin.Dead.contains(ttwo.getName())){
|
|
||||||
World world = ttwo.getLocation().getWorld();
|
|
||||||
world.createExplosion(ttwo.getLocation(), 0.0F, false);
|
|
||||||
ttwo.setHealth(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(plugin.Playing.size()>=3){
|
|
||||||
String three = plugin.Playing.get(2);
|
|
||||||
if(pname==three){
|
|
||||||
Player tthree = plugin.getServer().getPlayerExact(three);
|
|
||||||
String[] threecoords = plugin.spawns.getString("Tribute_three_spawn").split(",");
|
|
||||||
double threex = Double.parseDouble(threecoords[0]);
|
|
||||||
double threey = Double.parseDouble(threecoords[1]);
|
|
||||||
double threez = Double.parseDouble(threecoords[2]);
|
|
||||||
World threew = plugin.getServer().getWorld(threecoords[3]);
|
|
||||||
Location threespwn = new Location(threew,threex,threey,threez);
|
|
||||||
if(!tthree.getLocation().getBlock().getLocation().equals(threespwn)){
|
|
||||||
if(!plugin.Dead.contains(tthree.getName())){
|
|
||||||
World world = tthree.getLocation().getWorld();
|
|
||||||
world.createExplosion(tthree.getLocation(), 0.0F, false);
|
|
||||||
tthree.setHealth(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(plugin.Playing.size()>=4){
|
|
||||||
String four = plugin.Playing.get(3);
|
|
||||||
if(pname==four){
|
|
||||||
Player tfour = plugin.getServer().getPlayerExact(four);
|
|
||||||
String[] fourcoords = plugin.spawns.getString("Tribute_four_spawn").split(",");
|
|
||||||
double fourx = Double.parseDouble(fourcoords[0]);
|
|
||||||
double foury = Double.parseDouble(fourcoords[1]);
|
|
||||||
double fourz = Double.parseDouble(fourcoords[2]);
|
|
||||||
World fourw = plugin.getServer().getWorld(fourcoords[3]);
|
|
||||||
Location fourspwn = new Location(fourw,fourx,foury,fourz);
|
|
||||||
if(!tfour.getLocation().getBlock().getLocation().equals(fourspwn)){
|
|
||||||
if(!plugin.Dead.contains(tfour.getName())){
|
|
||||||
World world = tfour.getLocation().getWorld();
|
|
||||||
world.createExplosion(tfour.getLocation(), 0.0F, false);
|
|
||||||
tfour.setHealth(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(plugin.Playing.size()>=5){
|
|
||||||
String five = plugin.Playing.get(4);
|
|
||||||
if(pname==five){
|
|
||||||
Player tfive = plugin.getServer().getPlayerExact(five);
|
|
||||||
String[] fivecoords = plugin.spawns.getString("Tribute_five_spawn").split(",");
|
|
||||||
double fivex = Double.parseDouble(fivecoords[0]);
|
|
||||||
double fivey = Double.parseDouble(fivecoords[1]);
|
|
||||||
double fivez = Double.parseDouble(fivecoords[2]);
|
|
||||||
World fivew = plugin.getServer().getWorld(fivecoords[3]);
|
|
||||||
Location fivespwn = new Location(fivew,fivex,fivey,fivez);
|
|
||||||
if(!tfive.getLocation().getBlock().getLocation().equals(fivespwn)){
|
|
||||||
if(!plugin.Dead.contains(tfive.getName())){
|
|
||||||
World world = tfive.getLocation().getWorld();
|
|
||||||
world.createExplosion(tfive.getLocation(), 0.0F, false);
|
|
||||||
tfive.setHealth(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(plugin.Playing.size()>=6){
|
|
||||||
String six = plugin.Playing.get(5);
|
|
||||||
if(pname==six){
|
|
||||||
Player tsix = plugin.getServer().getPlayerExact(six);
|
|
||||||
String[] sixcoords = plugin.spawns.getString("Tribute_six_spawn").split(",");
|
|
||||||
double sixx = Double.parseDouble(sixcoords[0]);
|
|
||||||
double sixy = Double.parseDouble(sixcoords[1]);
|
|
||||||
double sixz = Double.parseDouble(sixcoords[2]);
|
|
||||||
World sixw = plugin.getServer().getWorld(sixcoords[3]);
|
|
||||||
Location sixspwn = new Location(sixw,sixx,sixy,sixz);
|
|
||||||
if(!tsix.getLocation().getBlock().getLocation().equals(sixspwn)){
|
|
||||||
if(!plugin.Dead.contains(tsix.getName())){
|
|
||||||
World world = tsix.getLocation().getWorld();
|
|
||||||
world.createExplosion(tsix.getLocation(), 0.0F, false);
|
|
||||||
tsix.setHealth(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(plugin.Playing.size()>=7){
|
|
||||||
String seven = plugin.Playing.get(6);
|
|
||||||
if(pname==seven){
|
|
||||||
Player tseven = plugin.getServer().getPlayerExact(seven);
|
|
||||||
String[] sevencoords = plugin.spawns.getString("Tribute_seven_spawn").split(",");
|
|
||||||
double sevenx = Double.parseDouble(sevencoords[0]);
|
|
||||||
double seveny = Double.parseDouble(sevencoords[1]);
|
|
||||||
double sevenz = Double.parseDouble(sevencoords[2]);
|
|
||||||
World sevenw = plugin.getServer().getWorld(sevencoords[3]);
|
|
||||||
Location sevenspwn = new Location(sevenw,sevenx,seveny,sevenz);
|
|
||||||
if(!tseven.getLocation().getBlock().getLocation().equals(sevenspwn)){
|
|
||||||
if(!plugin.Dead.contains(tseven.getName())){
|
|
||||||
World world = tseven.getLocation().getWorld();
|
|
||||||
world.createExplosion(tseven.getLocation(), 0.0F, false);
|
|
||||||
tseven.setHealth(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(plugin.Playing.size()>=8){
|
|
||||||
String eight = plugin.Playing.get(7);
|
|
||||||
if(pname==eight){
|
|
||||||
Player teight = plugin.getServer().getPlayerExact(eight);
|
|
||||||
String[] eightcoords = plugin.spawns.getString("Tribute_eight_spawn").split(",");
|
|
||||||
double eightx = Double.parseDouble(eightcoords[0]);
|
|
||||||
double eighty = Double.parseDouble(eightcoords[1]);
|
|
||||||
double eightz = Double.parseDouble(eightcoords[2]);
|
|
||||||
World eightw = plugin.getServer().getWorld(eightcoords[3]);
|
|
||||||
Location eightspwn = new Location(eightw,eightx,eighty,eightz);
|
|
||||||
if(!teight.getLocation().getBlock().getLocation().equals(eightspwn)){
|
|
||||||
if(!plugin.Dead.contains(teight.getName())){
|
|
||||||
World world = teight.getLocation().getWorld();
|
|
||||||
world.createExplosion(teight.getLocation(), 0.0F, false);
|
|
||||||
teight.setHealth(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(plugin.Playing.size()>=9){
|
|
||||||
String nine = plugin.Playing.get(8);
|
|
||||||
if(pname==nine){
|
|
||||||
Player tnine = plugin.getServer().getPlayerExact(nine);
|
|
||||||
String[] ninecoords = plugin.spawns.getString("Tribute_nine_spawn").split(",");
|
|
||||||
double ninex = Double.parseDouble(ninecoords[0]);
|
|
||||||
double niney = Double.parseDouble(ninecoords[1]);
|
|
||||||
double ninez = Double.parseDouble(ninecoords[2]);
|
|
||||||
World ninew = plugin.getServer().getWorld(ninecoords[3]);
|
|
||||||
Location ninespwn = new Location(ninew,ninex,niney,ninez);
|
|
||||||
if(!tnine.getLocation().getBlock().getLocation().equals(ninespwn)){
|
|
||||||
if(!plugin.Dead.contains(tnine.getName())){
|
|
||||||
World world = tnine.getLocation().getWorld();
|
|
||||||
world.createExplosion(tnine.getLocation(), 0.0F, false);
|
|
||||||
tnine.setHealth(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(plugin.Playing.size()>=10){
|
|
||||||
String ten = plugin.Playing.get(9);
|
|
||||||
if(pname==ten){
|
|
||||||
Player tten = plugin.getServer().getPlayerExact(ten);
|
|
||||||
String[] tencoords = plugin.spawns.getString("Tribute_ten_spawn").split(",");
|
|
||||||
double tenx = Double.parseDouble(tencoords[0]);
|
|
||||||
double teny = Double.parseDouble(tencoords[1]);
|
|
||||||
double tenz = Double.parseDouble(tencoords[2]);
|
|
||||||
World tenw = plugin.getServer().getWorld(tencoords[3]);
|
|
||||||
Location tenspwn = new Location(tenw,tenx,teny,tenz);
|
|
||||||
if(!tten.getLocation().getBlock().getLocation().equals(tenspwn)){
|
|
||||||
if(!plugin.Dead.contains(tten.getName())){
|
|
||||||
World world = tten.getLocation().getWorld();
|
|
||||||
world.createExplosion(tten.getLocation(), 0.0F, false);
|
|
||||||
tten.setHealth(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(plugin.Playing.size()>=11){
|
|
||||||
String eleven = plugin.Playing.get(10);
|
|
||||||
if(pname==eleven){
|
|
||||||
Player televen = plugin.getServer().getPlayerExact(eleven);
|
|
||||||
String[] elevencoords = plugin.spawns.getString("Tribute_eleven_spawn").split(",");
|
|
||||||
double elevenx = Double.parseDouble(elevencoords[0]);
|
|
||||||
double eleveny = Double.parseDouble(elevencoords[1]);
|
|
||||||
double elevenz = Double.parseDouble(elevencoords[2]);
|
|
||||||
World elevenw = plugin.getServer().getWorld(elevencoords[3]);
|
|
||||||
Location elevenspwn = new Location(elevenw,elevenx,eleveny,elevenz);
|
|
||||||
if(!televen.getLocation().getBlock().getLocation().equals(elevenspwn)){
|
|
||||||
if(!plugin.Dead.contains(televen.getName())){
|
|
||||||
World world = televen.getLocation().getWorld();
|
|
||||||
world.createExplosion(televen.getLocation(), 0.0F, false);
|
|
||||||
televen.setHealth(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(plugin.Playing.size()>=12){
|
|
||||||
String twelve = plugin.Playing.get(11);
|
|
||||||
if(pname==twelve){
|
|
||||||
Player ttwelve = plugin.getServer().getPlayerExact(twelve);
|
|
||||||
String[] twelvecoords = plugin.spawns.getString("Tribute_twelve_spawn").split(",");
|
|
||||||
double twelvex = Double.parseDouble(twelvecoords[0]);
|
|
||||||
double twelvey = Double.parseDouble(twelvecoords[1]);
|
|
||||||
double twelvez = Double.parseDouble(twelvecoords[2]);
|
|
||||||
World twelvew = plugin.getServer().getWorld(twelvecoords[3]);
|
|
||||||
Location twelvespwn = new Location(twelvew,twelvex,twelvey,twelvez);
|
|
||||||
if(!ttwelve.getLocation().getBlock().getLocation().equals(twelvespwn)){
|
|
||||||
if(!plugin.Dead.contains(ttwelve.getName())){
|
|
||||||
World world = ttwelve.getLocation().getWorld();
|
|
||||||
world.createExplosion(ttwelve.getLocation(), 0.0F, false);
|
|
||||||
ttwelve.setHealth(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(plugin.Playing.size()>=13){
|
|
||||||
String thirteen = plugin.Playing.get(12);
|
|
||||||
if(pname==thirteen){
|
|
||||||
Player tthirteen = plugin.getServer().getPlayerExact(thirteen);
|
|
||||||
String[] thirteencoords = plugin.spawns.getString("Tribute_thirteen_spawn").split(",");
|
|
||||||
double thirteenx = Double.parseDouble(thirteencoords[0]);
|
|
||||||
double thirteeny = Double.parseDouble(thirteencoords[1]);
|
|
||||||
double thirteenz = Double.parseDouble(thirteencoords[2]);
|
|
||||||
World thirteenw = plugin.getServer().getWorld(thirteencoords[3]);
|
|
||||||
Location thirteenspwn = new Location(thirteenw,thirteenx,thirteeny,thirteenz);
|
|
||||||
if(!tthirteen.getLocation().getBlock().getLocation().equals(thirteenspwn)){
|
|
||||||
if(!plugin.Dead.contains(tthirteen.getName())){
|
|
||||||
World world = tthirteen.getLocation().getWorld();
|
|
||||||
world.createExplosion(tthirteen.getLocation(), 0.0F, false);
|
|
||||||
tthirteen.setHealth(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(plugin.Playing.size()>=14){
|
|
||||||
String fourteen = plugin.Playing.get(13);
|
|
||||||
if(pname==fourteen){
|
|
||||||
Player tfourteen = plugin.getServer().getPlayerExact(fourteen);
|
|
||||||
String[] fourteencoords = plugin.spawns.getString("Tribute_fourteen_spawn").split(",");
|
|
||||||
double fourteenx = Double.parseDouble(fourteencoords[0]);
|
|
||||||
double fourteeny = Double.parseDouble(fourteencoords[1]);
|
|
||||||
double fourteenz = Double.parseDouble(fourteencoords[2]);
|
|
||||||
World fourteenw = plugin.getServer().getWorld(fourteencoords[3]);
|
|
||||||
Location fourteenspwn = new Location(fourteenw,fourteenx,fourteeny,fourteenz);
|
|
||||||
if(!tfourteen.getLocation().getBlock().getLocation().equals(fourteenspwn)){
|
|
||||||
if(!plugin.Dead.contains(tfourteen.getName())){
|
|
||||||
World world = tfourteen.getLocation().getWorld();
|
|
||||||
world.createExplosion(tfourteen.getLocation(), 0.0F, false);
|
|
||||||
tfourteen.setHealth(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(plugin.Playing.size()>=15){
|
|
||||||
String fifteen = plugin.Playing.get(14);
|
|
||||||
if(pname==fifteen){
|
|
||||||
Player tfifteen = plugin.getServer().getPlayerExact(fifteen);
|
|
||||||
String[] fifteencoords = plugin.spawns.getString("Tribute_fifteen_spawn").split(",");
|
|
||||||
double fifteenx = Double.parseDouble(fifteencoords[0]);
|
|
||||||
double fifteeny = Double.parseDouble(fifteencoords[1]);
|
|
||||||
double fifteenz = Double.parseDouble(fifteencoords[2]);
|
|
||||||
World fifteenw = plugin.getServer().getWorld(fifteencoords[3]);
|
|
||||||
Location fifteenspwn = new Location(fifteenw,fifteenx,fifteeny,fifteenz);
|
|
||||||
if(!tfifteen.getLocation().getBlock().getLocation().equals(fifteenspwn)){
|
|
||||||
if(!plugin.Dead.contains(tfifteen.getName())){
|
|
||||||
World world = tfifteen.getLocation().getWorld();
|
|
||||||
world.createExplosion(tfifteen.getLocation(), 0.0F, false);
|
|
||||||
tfifteen.setHealth(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(plugin.Playing.size()>=16){
|
|
||||||
String sixteen = plugin.Playing.get(15);
|
|
||||||
if(pname==sixteen){
|
|
||||||
Player tsixteen = plugin.getServer().getPlayerExact(sixteen);
|
|
||||||
String[] sixteencoords = plugin.spawns.getString("Tribute_sixteen_spawn").split(",");
|
|
||||||
double sixteenx = Double.parseDouble(sixteencoords[0]);
|
|
||||||
double sixteeny = Double.parseDouble(sixteencoords[1]);
|
|
||||||
double sixteenz = Double.parseDouble(sixteencoords[2]);
|
|
||||||
World sixteenw = plugin.getServer().getWorld(sixteencoords[3]);
|
|
||||||
Location sixteenspwn = new Location(sixteenw,sixteenx,sixteeny,sixteenz);
|
|
||||||
if(!tsixteen.getLocation().getBlock().getLocation().equals(sixteenspwn)){
|
|
||||||
if(!plugin.Dead.contains(tsixteen.getName())){
|
|
||||||
World world = tsixteen.getLocation().getWorld();
|
|
||||||
world.createExplosion(tsixteen.getLocation(), 0.0F, false);
|
|
||||||
tsixteen.setHealth(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(plugin.Playing.size()>=17){
|
|
||||||
String seventeen = plugin.Playing.get(16);
|
|
||||||
if(pname==seventeen){
|
|
||||||
Player tseventeen = plugin.getServer().getPlayerExact(seventeen);
|
|
||||||
String[] seventeencoords = plugin.spawns.getString("Tribute_seventeen_spawn").split(",");
|
|
||||||
double seventeenx = Double.parseDouble(seventeencoords[0]);
|
|
||||||
double seventeeny = Double.parseDouble(seventeencoords[1]);
|
|
||||||
double seventeenz = Double.parseDouble(seventeencoords[2]);
|
|
||||||
World seventeenw = plugin.getServer().getWorld(seventeencoords[3]);
|
|
||||||
Location seventeenspwn = new Location(seventeenw,seventeenx,seventeeny,seventeenz);
|
|
||||||
if(!tseventeen.getLocation().getBlock().getLocation().equals(seventeenspwn)){
|
|
||||||
if(!plugin.Dead.contains(tseventeen.getName())){
|
|
||||||
World world = tseventeen.getLocation().getWorld();
|
|
||||||
world.createExplosion(tseventeen.getLocation(), 0.0F, false);
|
|
||||||
tseventeen.setHealth(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(plugin.Playing.size()>=18){
|
|
||||||
String eighteen = plugin.Playing.get(17);
|
|
||||||
if(pname==eighteen){
|
|
||||||
Player teighteen = plugin.getServer().getPlayerExact(eighteen);
|
|
||||||
String[] eighteencoords = plugin.spawns.getString("Tribute_eighteen_spawn").split(",");
|
|
||||||
double eighteenx = Double.parseDouble(eighteencoords[0]);
|
|
||||||
double eighteeny = Double.parseDouble(eighteencoords[1]);
|
|
||||||
double eighteenz = Double.parseDouble(eighteencoords[2]);
|
|
||||||
World eighteenw = plugin.getServer().getWorld(eighteencoords[3]);
|
|
||||||
Location eighteenspwn = new Location(eighteenw,eighteenx,eighteeny,eighteenz);
|
|
||||||
if(!teighteen.getLocation().getBlock().getLocation().equals(eighteenspwn)){
|
|
||||||
if(!plugin.Dead.contains(teighteen.getName())){
|
|
||||||
World world = teighteen.getLocation().getWorld();
|
|
||||||
world.createExplosion(teighteen.getLocation(), 0.0F, false);
|
|
||||||
teighteen.setHealth(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(plugin.Playing.size()>=19){
|
|
||||||
String nineteen = plugin.Playing.get(18);
|
|
||||||
if(pname==nineteen){
|
|
||||||
Player tnineteen = plugin.getServer().getPlayerExact(nineteen);
|
|
||||||
String[] nineteencoords = plugin.spawns.getString("Tribute_nineteen_spawn").split(",");
|
|
||||||
double nineteenx = Double.parseDouble(nineteencoords[0]);
|
|
||||||
double nineteeny = Double.parseDouble(nineteencoords[1]);
|
|
||||||
double nineteenz = Double.parseDouble(nineteencoords[2]);
|
|
||||||
World nineteenw = plugin.getServer().getWorld(nineteencoords[3]);
|
|
||||||
Location nineteenspwn = new Location(nineteenw,nineteenx,nineteeny,nineteenz);
|
|
||||||
if(!tnineteen.getLocation().getBlock().getLocation().equals(nineteenspwn)){
|
|
||||||
if(!plugin.Dead.contains(tnineteen.getName())){
|
|
||||||
World world = tnineteen.getLocation().getWorld();
|
|
||||||
world.createExplosion(tnineteen.getLocation(), 0.0F, false);
|
|
||||||
tnineteen.setHealth(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(plugin.Playing.size()>=20){
|
|
||||||
String twenty = plugin.Playing.get(19);
|
|
||||||
if(pname==twenty){
|
|
||||||
Player ttwenty = plugin.getServer().getPlayerExact(twenty);
|
|
||||||
String[] twentycoords = plugin.spawns.getString("Tribute_twenty_spawn").split(",");
|
|
||||||
double twentyx = Double.parseDouble(twentycoords[0]);
|
|
||||||
double twentyy = Double.parseDouble(twentycoords[1]);
|
|
||||||
double twentyz = Double.parseDouble(twentycoords[2]);
|
|
||||||
World twentyw = plugin.getServer().getWorld(twentycoords[3]);
|
|
||||||
Location twentyspwn = new Location(twentyw,twentyx,twentyy,twentyz);
|
|
||||||
if(!ttwenty.getLocation().getBlock().getLocation().equals(twentyspwn)){
|
|
||||||
if(!plugin.Dead.contains(ttwenty.getName())){
|
|
||||||
World world = ttwenty.getLocation().getWorld();
|
|
||||||
world.createExplosion(ttwenty.getLocation(), 0.0F, false);
|
|
||||||
ttwenty.setHealth(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(plugin.Playing.size()>=21){
|
|
||||||
String twentyone = plugin.Playing.get(20);
|
|
||||||
if(pname==twentyone){
|
|
||||||
Player ttwentyone = plugin.getServer().getPlayerExact(twentyone);
|
|
||||||
String[] twentyonecoords = plugin.spawns.getString("Tribute_twentyone_spawn").split(",");
|
|
||||||
double twentyonex = Double.parseDouble(twentyonecoords[0]);
|
|
||||||
double twentyoney = Double.parseDouble(twentyonecoords[1]);
|
|
||||||
double twentyonez = Double.parseDouble(twentyonecoords[2]);
|
|
||||||
World twentyonew = plugin.getServer().getWorld(twentyonecoords[3]);
|
|
||||||
Location twentyonespwn = new Location(twentyonew,twentyonex,twentyoney,twentyonez);
|
|
||||||
if(!ttwentyone.getLocation().getBlock().getLocation().equals(twentyonespwn)){
|
|
||||||
if(!plugin.Dead.contains(ttwentyone.getName())){
|
|
||||||
World world = ttwentyone.getLocation().getWorld();
|
|
||||||
world.createExplosion(ttwentyone.getLocation(), 0.0F, false);
|
|
||||||
ttwentyone.setHealth(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(plugin.Playing.size()>=22){
|
|
||||||
String twentytwo = plugin.Playing.get(21);
|
|
||||||
if(pname==twentytwo){
|
|
||||||
Player ttwentytwo = plugin.getServer().getPlayerExact(twentytwo);
|
|
||||||
String[] twentytwocoords = plugin.spawns.getString("Tribute_twentytwo_spawn").split(",");
|
|
||||||
double twentytwox = Double.parseDouble(twentytwocoords[0]);
|
|
||||||
double twentytwoy = Double.parseDouble(twentytwocoords[1]);
|
|
||||||
double twentytwoz = Double.parseDouble(twentytwocoords[2]);
|
|
||||||
World twentytwow = plugin.getServer().getWorld(twentytwocoords[3]);
|
|
||||||
Location twentytwospwn = new Location(twentytwow,twentytwox,twentytwoy,twentytwoz);
|
|
||||||
if(!ttwentytwo.getLocation().getBlock().getLocation().equals(twentytwospwn)){
|
|
||||||
if(!plugin.Dead.contains(ttwentytwo.getName())){
|
|
||||||
World world = ttwentytwo.getLocation().getWorld();
|
|
||||||
world.createExplosion(ttwentytwo.getLocation(), 0.0F, false);
|
|
||||||
ttwentytwo.setHealth(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(plugin.Playing.size()>=23){
|
|
||||||
String twentythree = plugin.Playing.get(22);
|
|
||||||
if(pname==twentythree){
|
|
||||||
Player ttwentythree = plugin.getServer().getPlayerExact(twentythree);
|
|
||||||
String[] twentythreecoords = plugin.spawns.getString("Tribute_twentythree_spawn").split(",");
|
|
||||||
double twentythreex = Double.parseDouble(twentythreecoords[0]);
|
|
||||||
double twentythreey = Double.parseDouble(twentythreecoords[1]);
|
|
||||||
double twentythreez = Double.parseDouble(twentythreecoords[2]);
|
|
||||||
World twentythreew = plugin.getServer().getWorld(twentythreecoords[3]);
|
|
||||||
Location twentythreespwn = new Location(twentythreew,twentythreex,twentythreey,twentythreez);
|
|
||||||
if(!ttwentythree.getLocation().getBlock().getLocation().equals(twentythreespwn)){
|
|
||||||
if(!plugin.Dead.contains(ttwentythree.getName())){
|
|
||||||
World world = ttwentythree.getLocation().getWorld();
|
|
||||||
world.createExplosion(ttwentythree.getLocation(), 0.0F, false);
|
|
||||||
ttwentythree.setHealth(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(plugin.Playing.size()==24){
|
|
||||||
String twentyfour = plugin.Playing.get(23);
|
|
||||||
if(pname==twentyfour){
|
|
||||||
Player ttwentyfour = plugin.getServer().getPlayerExact(twentyfour);
|
|
||||||
String[] twentyfourcoords = plugin.spawns.getString("Tribute_twentyfour_spawn").split(",");
|
|
||||||
double twentyfourx = Double.parseDouble(twentyfourcoords[0]);
|
|
||||||
double twentyfoury = Double.parseDouble(twentyfourcoords[1]);
|
|
||||||
double twentyfourz = Double.parseDouble(twentyfourcoords[2]);
|
|
||||||
World twentyfourw = plugin.getServer().getWorld(twentyfourcoords[3]);
|
|
||||||
Location twentyfourspwn = new Location(twentyfourw,twentyfourx,twentyfoury,twentyfourz);
|
|
||||||
if(!ttwentyfour.getLocation().getBlock().getLocation().equals(twentyfourspwn)){
|
|
||||||
if(!plugin.Dead.contains(ttwentyfour.getName())){
|
|
||||||
World world = ttwentyfour.getLocation().getWorld();
|
|
||||||
world.createExplosion(ttwentyfour.getLocation(), 0.0F, false);
|
|
||||||
ttwentyfour.setHealth(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
}else{
|
}else{
|
||||||
for(String players:plugin.Playing){
|
for(String players:plugin.Playing.get(a)){
|
||||||
Player playing = plugin.getServer().getPlayerExact(players);
|
Player playing = plugin.getServer().getPlayerExact(players);
|
||||||
i = plugin.Playing.indexOf(players);
|
i = plugin.Playing.get(a).indexOf(players)+1;
|
||||||
if(!playing.getLocation().getBlock().getLocation().equals(plugin.location.get(i))){
|
if(!playing.getLocation().getBlock().getLocation().equals(plugin.location.get(a).get(i))){
|
||||||
playing.teleport(plugin.location.get(i));
|
playing.teleport(plugin.location.get(a).get(i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*if(plugin.Playing.size()>=1){
|
|
||||||
String one = plugin.Playing.get(0);
|
|
||||||
if(pname==one){
|
|
||||||
Player tone = plugin.getServer().getPlayerExact(one);
|
|
||||||
String[] onecoords = plugin.spawns.getString("Tribute_one_spawn").split(",");
|
|
||||||
double x = Double.parseDouble(onecoords[0]);
|
|
||||||
double y = Double.parseDouble(onecoords[1]);
|
|
||||||
double z = Double.parseDouble(onecoords[2]);
|
|
||||||
World w = plugin.getServer().getWorld(onecoords[3]);
|
|
||||||
Location onespwn = new Location(w,x,y,z);
|
|
||||||
if(!tone.getLocation().getBlock().getLocation().equals(onespwn)){
|
|
||||||
tone.teleport(onespwn);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(plugin.Playing.size()>=2){
|
|
||||||
String two = plugin.Playing.get(1);
|
|
||||||
if(pname==two){
|
|
||||||
Player ttwo = plugin.getServer().getPlayerExact(two);
|
|
||||||
String[] twocoords = plugin.spawns.getString("Tribute_two_spawn").split(",");
|
|
||||||
double twox = Double.parseDouble(twocoords[0]);
|
|
||||||
double twoy = Double.parseDouble(twocoords[1]);
|
|
||||||
double twoz = Double.parseDouble(twocoords[2]);
|
|
||||||
World twow = plugin.getServer().getWorld(twocoords[3]);
|
|
||||||
Location twospwn = new Location(twow,twox,twoy,twoz);
|
|
||||||
if(!ttwo.getLocation().getBlock().getLocation().equals(twospwn)){
|
|
||||||
ttwo.teleport(twospwn);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(plugin.Playing.size()>=3){
|
|
||||||
String three = plugin.Playing.get(2);
|
|
||||||
if(pname==three){
|
|
||||||
Player tthree = plugin.getServer().getPlayerExact(three);
|
|
||||||
String[] threecoords = plugin.spawns.getString("Tribute_three_spawn").split(",");
|
|
||||||
double threex = Double.parseDouble(threecoords[0]);
|
|
||||||
double threey = Double.parseDouble(threecoords[1]);
|
|
||||||
double threez = Double.parseDouble(threecoords[2]);
|
|
||||||
World threew = plugin.getServer().getWorld(threecoords[3]);
|
|
||||||
Location threespwn = new Location(threew,threex,threey,threez);
|
|
||||||
if(!tthree.getLocation().getBlock().getLocation().equals(threespwn)){
|
|
||||||
tthree.teleport(threespwn);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(plugin.Playing.size()>=4){
|
|
||||||
String four = plugin.Playing.get(3);
|
|
||||||
if(pname==four){
|
|
||||||
Player tfour = plugin.getServer().getPlayerExact(four);
|
|
||||||
String[] fourcoords = plugin.spawns.getString("Tribute_four_spawn").split(",");
|
|
||||||
double fourx = Double.parseDouble(fourcoords[0]);
|
|
||||||
double foury = Double.parseDouble(fourcoords[1]);
|
|
||||||
double fourz = Double.parseDouble(fourcoords[2]);
|
|
||||||
World fourw = plugin.getServer().getWorld(fourcoords[3]);
|
|
||||||
Location fourspwn = new Location(fourw,fourx,foury,fourz);
|
|
||||||
if(!tfour.getLocation().getBlock().getLocation().equals(fourspwn)){
|
|
||||||
tfour.teleport(fourspwn);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(plugin.Playing.size()>=5){
|
|
||||||
String five = plugin.Playing.get(4);
|
|
||||||
if(pname==five){
|
|
||||||
Player tfive = plugin.getServer().getPlayerExact(five);
|
|
||||||
String[] fivecoords = plugin.spawns.getString("Tribute_five_spawn").split(",");
|
|
||||||
double fivex = Double.parseDouble(fivecoords[0]);
|
|
||||||
double fivey = Double.parseDouble(fivecoords[1]);
|
|
||||||
double fivez = Double.parseDouble(fivecoords[2]);
|
|
||||||
World fivew = plugin.getServer().getWorld(fivecoords[3]);
|
|
||||||
Location fivespwn = new Location(fivew,fivex,fivey,fivez);
|
|
||||||
if(!tfive.getLocation().getBlock().getLocation().equals(fivespwn)){
|
|
||||||
tfive.teleport(fivespwn);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(plugin.Playing.size()>=6){
|
|
||||||
String six = plugin.Playing.get(5);
|
|
||||||
if(pname==six){
|
|
||||||
Player tsix = plugin.getServer().getPlayerExact(six);
|
|
||||||
String[] sixcoords = plugin.spawns.getString("Tribute_six_spawn").split(",");
|
|
||||||
double sixx = Double.parseDouble(sixcoords[0]);
|
|
||||||
double sixy = Double.parseDouble(sixcoords[1]);
|
|
||||||
double sixz = Double.parseDouble(sixcoords[2]);
|
|
||||||
World sixw = plugin.getServer().getWorld(sixcoords[3]);
|
|
||||||
Location sixspwn = new Location(sixw,sixx,sixy,sixz);
|
|
||||||
if(!tsix.getLocation().getBlock().getLocation().equals(sixspwn)){
|
|
||||||
tsix.teleport(sixspwn);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(plugin.Playing.size()>=7){
|
|
||||||
String seven = plugin.Playing.get(6);
|
|
||||||
if(pname==seven){
|
|
||||||
Player tseven = plugin.getServer().getPlayerExact(seven);
|
|
||||||
String[] sevencoords = plugin.spawns.getString("Tribute_seven_spawn").split(",");
|
|
||||||
double sevenx = Double.parseDouble(sevencoords[0]);
|
|
||||||
double seveny = Double.parseDouble(sevencoords[1]);
|
|
||||||
double sevenz = Double.parseDouble(sevencoords[2]);
|
|
||||||
World sevenw = plugin.getServer().getWorld(sevencoords[3]);
|
|
||||||
Location sevenspwn = new Location(sevenw,sevenx,seveny,sevenz);
|
|
||||||
if(!tseven.getLocation().getBlock().getLocation().equals(sevenspwn)){
|
|
||||||
tseven.teleport(sevenspwn);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(plugin.Playing.size()>=8){
|
|
||||||
String eight = plugin.Playing.get(7);
|
|
||||||
if(pname==eight){
|
|
||||||
Player teight = plugin.getServer().getPlayerExact(eight);
|
|
||||||
String[] eightcoords = plugin.spawns.getString("Tribute_eight_spawn").split(",");
|
|
||||||
double eightx = Double.parseDouble(eightcoords[0]);
|
|
||||||
double eighty = Double.parseDouble(eightcoords[1]);
|
|
||||||
double eightz = Double.parseDouble(eightcoords[2]);
|
|
||||||
World eightw = plugin.getServer().getWorld(eightcoords[3]);
|
|
||||||
Location eightspwn = new Location(eightw,eightx,eighty,eightz);
|
|
||||||
if(!teight.getLocation().getBlock().getLocation().equals(eightspwn)){
|
|
||||||
teight.teleport(eightspwn);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(plugin.Playing.size()>=9){
|
|
||||||
String nine = plugin.Playing.get(8);
|
|
||||||
if(pname==nine){
|
|
||||||
Player tnine = plugin.getServer().getPlayerExact(nine);
|
|
||||||
String[] ninecoords = plugin.spawns.getString("Tribute_nine_spawn").split(",");
|
|
||||||
double ninex = Double.parseDouble(ninecoords[0]);
|
|
||||||
double niney = Double.parseDouble(ninecoords[1]);
|
|
||||||
double ninez = Double.parseDouble(ninecoords[2]);
|
|
||||||
World ninew = plugin.getServer().getWorld(ninecoords[3]);
|
|
||||||
Location ninespwn = new Location(ninew,ninex,niney,ninez);
|
|
||||||
if(!tnine.getLocation().getBlock().getLocation().equals(ninespwn)){
|
|
||||||
tnine.teleport(ninespwn);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(plugin.Playing.size()>=10){
|
|
||||||
String ten = plugin.Playing.get(9);
|
|
||||||
if(pname==ten){
|
|
||||||
Player tten = plugin.getServer().getPlayerExact(ten);
|
|
||||||
String[] tencoords = plugin.spawns.getString("Tribute_ten_spawn").split(",");
|
|
||||||
double tenx = Double.parseDouble(tencoords[0]);
|
|
||||||
double teny = Double.parseDouble(tencoords[1]);
|
|
||||||
double tenz = Double.parseDouble(tencoords[2]);
|
|
||||||
World tenw = plugin.getServer().getWorld(tencoords[3]);
|
|
||||||
Location tenspwn = new Location(tenw,tenx,teny,tenz);
|
|
||||||
if(!tten.getLocation().getBlock().getLocation().equals(tenspwn)){
|
|
||||||
tten.teleport(tenspwn);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(plugin.Playing.size()>=11){
|
|
||||||
String eleven = plugin.Playing.get(10);
|
|
||||||
if(pname==eleven){
|
|
||||||
Player televen = plugin.getServer().getPlayerExact(eleven);
|
|
||||||
String[] elevencoords = plugin.spawns.getString("Tribute_eleven_spawn").split(",");
|
|
||||||
double elevenx = Double.parseDouble(elevencoords[0]);
|
|
||||||
double eleveny = Double.parseDouble(elevencoords[1]);
|
|
||||||
double elevenz = Double.parseDouble(elevencoords[2]);
|
|
||||||
World elevenw = plugin.getServer().getWorld(elevencoords[3]);
|
|
||||||
Location elevenspwn = new Location(elevenw,elevenx,eleveny,elevenz);
|
|
||||||
if(!televen.getLocation().getBlock().getLocation().equals(elevenspwn)){
|
|
||||||
televen.teleport(elevenspwn);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(plugin.Playing.size()>=12){
|
|
||||||
String twelve = plugin.Playing.get(11);
|
|
||||||
if(pname==twelve){
|
|
||||||
Player ttwelve = plugin.getServer().getPlayerExact(twelve);
|
|
||||||
String[] twelvecoords = plugin.spawns.getString("Tribute_twelve_spawn").split(",");
|
|
||||||
double twelvex = Double.parseDouble(twelvecoords[0]);
|
|
||||||
double twelvey = Double.parseDouble(twelvecoords[1]);
|
|
||||||
double twelvez = Double.parseDouble(twelvecoords[2]);
|
|
||||||
World twelvew = plugin.getServer().getWorld(twelvecoords[3]);
|
|
||||||
Location twelvespwn = new Location(twelvew,twelvex,twelvey,twelvez);
|
|
||||||
if(!ttwelve.getLocation().getBlock().getLocation().equals(twelvespwn)){
|
|
||||||
ttwelve.teleport(twelvespwn);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(plugin.Playing.size()>=13){
|
|
||||||
String thirteen = plugin.Playing.get(12);
|
|
||||||
if(pname==thirteen){
|
|
||||||
Player tthirteen = plugin.getServer().getPlayerExact(thirteen);
|
|
||||||
String[] thirteencoords = plugin.spawns.getString("Tribute_thirteen_spawn").split(",");
|
|
||||||
double thirteenx = Double.parseDouble(thirteencoords[0]);
|
|
||||||
double thirteeny = Double.parseDouble(thirteencoords[1]);
|
|
||||||
double thirteenz = Double.parseDouble(thirteencoords[2]);
|
|
||||||
World thirteenw = plugin.getServer().getWorld(thirteencoords[3]);
|
|
||||||
Location thirteenspwn = new Location(thirteenw,thirteenx,thirteeny,thirteenz);
|
|
||||||
if(!tthirteen.getLocation().getBlock().getLocation().equals(thirteenspwn)){
|
|
||||||
tthirteen.teleport(thirteenspwn);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(plugin.Playing.size()>=14){
|
|
||||||
String fourteen = plugin.Playing.get(13);
|
|
||||||
if(pname==fourteen){
|
|
||||||
Player tfourteen = plugin.getServer().getPlayerExact(fourteen);
|
|
||||||
String[] fourteencoords = plugin.spawns.getString("Tribute_fourteen_spawn").split(",");
|
|
||||||
double fourteenx = Double.parseDouble(fourteencoords[0]);
|
|
||||||
double fourteeny = Double.parseDouble(fourteencoords[1]);
|
|
||||||
double fourteenz = Double.parseDouble(fourteencoords[2]);
|
|
||||||
World fourteenw = plugin.getServer().getWorld(fourteencoords[3]);
|
|
||||||
Location fourteenspwn = new Location(fourteenw,fourteenx,fourteeny,fourteenz);
|
|
||||||
if(!tfourteen.getLocation().getBlock().getLocation().equals(fourteenspwn)){
|
|
||||||
tfourteen.teleport(fourteenspwn);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(plugin.Playing.size()>=15){
|
|
||||||
String fifteen = plugin.Playing.get(14);
|
|
||||||
if(pname==fifteen){
|
|
||||||
Player tfifteen = plugin.getServer().getPlayerExact(fifteen);
|
|
||||||
String[] fifteencoords = plugin.spawns.getString("Tribute_fifteen_spawn").split(",");
|
|
||||||
double fifteenx = Double.parseDouble(fifteencoords[0]);
|
|
||||||
double fifteeny = Double.parseDouble(fifteencoords[1]);
|
|
||||||
double fifteenz = Double.parseDouble(fifteencoords[2]);
|
|
||||||
World fifteenw = plugin.getServer().getWorld(fifteencoords[3]);
|
|
||||||
Location fifteenspwn = new Location(fifteenw,fifteenx,fifteeny,fifteenz);
|
|
||||||
if(!tfifteen.getLocation().getBlock().getLocation().equals(fifteenspwn)){
|
|
||||||
tfifteen.teleport(fifteenspwn);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(plugin.Playing.size()>=16){
|
|
||||||
String sixteen = plugin.Playing.get(15);
|
|
||||||
if(pname==sixteen){
|
|
||||||
Player tsixteen = plugin.getServer().getPlayerExact(sixteen);
|
|
||||||
String[] sixteencoords = plugin.spawns.getString("Tribute_sixteen_spawn").split(",");
|
|
||||||
double sixteenx = Double.parseDouble(sixteencoords[0]);
|
|
||||||
double sixteeny = Double.parseDouble(sixteencoords[1]);
|
|
||||||
double sixteenz = Double.parseDouble(sixteencoords[2]);
|
|
||||||
World sixteenw = plugin.getServer().getWorld(sixteencoords[3]);
|
|
||||||
Location sixteenspwn = new Location(sixteenw,sixteenx,sixteeny,sixteenz);
|
|
||||||
if(!tsixteen.getLocation().getBlock().getLocation().equals(sixteenspwn)){
|
|
||||||
tsixteen.teleport(sixteenspwn);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(plugin.Playing.size()>=17){
|
|
||||||
String seventeen = plugin.Playing.get(16);
|
|
||||||
if(pname==seventeen){
|
|
||||||
Player tseventeen = plugin.getServer().getPlayerExact(seventeen);
|
|
||||||
String[] seventeencoords = plugin.spawns.getString("Tribute_seventeen_spawn").split(",");
|
|
||||||
double seventeenx = Double.parseDouble(seventeencoords[0]);
|
|
||||||
double seventeeny = Double.parseDouble(seventeencoords[1]);
|
|
||||||
double seventeenz = Double.parseDouble(seventeencoords[2]);
|
|
||||||
World seventeenw = plugin.getServer().getWorld(seventeencoords[3]);
|
|
||||||
Location seventeenspwn = new Location(seventeenw,seventeenx,seventeeny,seventeenz);
|
|
||||||
if(!tseventeen.getLocation().getBlock().getLocation().equals(seventeenspwn)){
|
|
||||||
tseventeen.teleport(seventeenspwn);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(plugin.Playing.size()>=18){
|
|
||||||
String eighteen = plugin.Playing.get(17);
|
|
||||||
if(pname==eighteen){
|
|
||||||
Player teighteen = plugin.getServer().getPlayerExact(eighteen);
|
|
||||||
String[] eighteencoords = plugin.spawns.getString("Tribute_eighteen_spawn").split(",");
|
|
||||||
double eighteenx = Double.parseDouble(eighteencoords[0]);
|
|
||||||
double eighteeny = Double.parseDouble(eighteencoords[1]);
|
|
||||||
double eighteenz = Double.parseDouble(eighteencoords[2]);
|
|
||||||
World eighteenw = plugin.getServer().getWorld(eighteencoords[3]);
|
|
||||||
Location eighteenspwn = new Location(eighteenw,eighteenx,eighteeny,eighteenz);
|
|
||||||
if(!teighteen.getLocation().getBlock().getLocation().equals(eighteenspwn)){
|
|
||||||
teighteen.teleport(eighteenspwn);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(plugin.Playing.size()>=19){
|
|
||||||
String nineteen = plugin.Playing.get(18);
|
|
||||||
if(pname==nineteen){
|
|
||||||
Player tnineteen = plugin.getServer().getPlayerExact(nineteen);
|
|
||||||
String[] nineteencoords = plugin.spawns.getString("Tribute_nineteen_spawn").split(",");
|
|
||||||
double nineteenx = Double.parseDouble(nineteencoords[0]);
|
|
||||||
double nineteeny = Double.parseDouble(nineteencoords[1]);
|
|
||||||
double nineteenz = Double.parseDouble(nineteencoords[2]);
|
|
||||||
World nineteenw = plugin.getServer().getWorld(nineteencoords[3]);
|
|
||||||
Location nineteenspwn = new Location(nineteenw,nineteenx,nineteeny,nineteenz);
|
|
||||||
if(!tnineteen.getLocation().getBlock().getLocation().equals(nineteenspwn)){
|
|
||||||
tnineteen.teleport(nineteenspwn);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(plugin.Playing.size()>=20){
|
|
||||||
String twenty = plugin.Playing.get(19);
|
|
||||||
if(pname==twenty){
|
|
||||||
Player ttwenty = plugin.getServer().getPlayerExact(twenty);
|
|
||||||
String[] twentycoords = plugin.spawns.getString("Tribute_twenty_spawn").split(",");
|
|
||||||
double twentyx = Double.parseDouble(twentycoords[0]);
|
|
||||||
double twentyy = Double.parseDouble(twentycoords[1]);
|
|
||||||
double twentyz = Double.parseDouble(twentycoords[2]);
|
|
||||||
World twentyw = plugin.getServer().getWorld(twentycoords[3]);
|
|
||||||
Location twentyspwn = new Location(twentyw,twentyx,twentyy,twentyz);
|
|
||||||
if(!ttwenty.getLocation().getBlock().getLocation().equals(twentyspwn)){
|
|
||||||
ttwenty.teleport(twentyspwn);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(plugin.Playing.size()>=21){
|
|
||||||
String twentyone = plugin.Playing.get(20);
|
|
||||||
if(pname==twentyone){
|
|
||||||
Player ttwentyone = plugin.getServer().getPlayerExact(twentyone);
|
|
||||||
String[] twentyonecoords = plugin.spawns.getString("Tribute_twentyone_spawn").split(",");
|
|
||||||
double twentyonex = Double.parseDouble(twentyonecoords[0]);
|
|
||||||
double twentyoney = Double.parseDouble(twentyonecoords[1]);
|
|
||||||
double twentyonez = Double.parseDouble(twentyonecoords[2]);
|
|
||||||
World twentyonew = plugin.getServer().getWorld(twentyonecoords[3]);
|
|
||||||
Location twentyonespwn = new Location(twentyonew,twentyonex,twentyoney,twentyonez);
|
|
||||||
if(!ttwentyone.getLocation().getBlock().getLocation().equals(twentyonespwn)){
|
|
||||||
ttwentyone.teleport(twentyonespwn);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(plugin.Playing.size()>=22){
|
|
||||||
String twentytwo = plugin.Playing.get(21);
|
|
||||||
if(pname==twentytwo){
|
|
||||||
Player ttwentytwo = plugin.getServer().getPlayerExact(twentytwo);
|
|
||||||
String[] twentytwocoords = plugin.spawns.getString("Tribute_twentytwo_spawn").split(",");
|
|
||||||
double twentytwox = Double.parseDouble(twentytwocoords[0]);
|
|
||||||
double twentytwoy = Double.parseDouble(twentytwocoords[1]);
|
|
||||||
double twentytwoz = Double.parseDouble(twentytwocoords[2]);
|
|
||||||
World twentytwow = plugin.getServer().getWorld(twentytwocoords[3]);
|
|
||||||
Location twentytwospwn = new Location(twentytwow,twentytwox,twentytwoy,twentytwoz);
|
|
||||||
if(!ttwentytwo.getLocation().getBlock().getLocation().equals(twentytwospwn)){
|
|
||||||
ttwentytwo.teleport(twentytwospwn);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(plugin.Playing.size()>=23){
|
|
||||||
String twentythree = plugin.Playing.get(22);
|
|
||||||
if(pname==twentythree){
|
|
||||||
Player ttwentythree = plugin.getServer().getPlayerExact(twentythree);
|
|
||||||
String[] twentythreecoords = plugin.spawns.getString("Tribute_twentythree_spawn").split(",");
|
|
||||||
double twentythreex = Double.parseDouble(twentythreecoords[0]);
|
|
||||||
double twentythreey = Double.parseDouble(twentythreecoords[1]);
|
|
||||||
double twentythreez = Double.parseDouble(twentythreecoords[2]);
|
|
||||||
World twentythreew = plugin.getServer().getWorld(twentythreecoords[3]);
|
|
||||||
Location twentythreespwn = new Location(twentythreew,twentythreex,twentythreey,twentythreez);
|
|
||||||
if(!ttwentythree.getLocation().getBlock().getLocation().equals(twentythreespwn)){
|
|
||||||
ttwentythree.teleport(twentythreespwn);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(plugin.Playing.size()==24){
|
|
||||||
String twentyfour = plugin.Playing.get(23);
|
|
||||||
if(pname==twentyfour){
|
|
||||||
Player ttwentyfour = plugin.getServer().getPlayerExact(twentyfour);
|
|
||||||
String[] twentyfourcoords = plugin.spawns.getString("Tribute_twentyfour_spawn").split(",");
|
|
||||||
double twentyfourx = Double.parseDouble(twentyfourcoords[0]);
|
|
||||||
double twentyfoury = Double.parseDouble(twentyfourcoords[1]);
|
|
||||||
double twentyfourz = Double.parseDouble(twentyfourcoords[2]);
|
|
||||||
World twentyfourw = plugin.getServer().getWorld(twentyfourcoords[3]);
|
|
||||||
Location twentyfourspwn = new Location(twentyfourw,twentyfourx,twentyfoury,twentyfourz);
|
|
||||||
if(!ttwentyfour.getLocation().getBlock().getLocation().equals(twentyfourspwn)){
|
|
||||||
ttwentyfour.teleport(twentyfourspwn);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -15,38 +15,46 @@ public class JoinAndQuitListener implements Listener {
|
|||||||
public JoinAndQuitListener(Main m) {
|
public JoinAndQuitListener(Main m) {
|
||||||
this.plugin = m;
|
this.plugin = m;
|
||||||
}
|
}
|
||||||
|
public HaCommands commands;
|
||||||
|
public JoinAndQuitListener(HaCommands h){
|
||||||
|
this.commands = h;
|
||||||
|
}
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
int a = 0;
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onJoin(PlayerJoinEvent evt) {
|
public void onJoin(PlayerJoinEvent evt) {
|
||||||
Player p = evt.getPlayer();
|
Player p = evt.getPlayer();
|
||||||
for (String s : plugin.Watching) {
|
for(i = 1; i <= plugin.Watching.size(); i++){
|
||||||
|
for (String s : plugin.Watching.get(i)) {
|
||||||
Player spectator = Bukkit.getServer().getPlayerExact(s);
|
Player spectator = Bukkit.getServer().getPlayerExact(s);
|
||||||
p.hidePlayer(spectator);
|
p.hidePlayer(spectator);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerJoin(PlayerJoinEvent event){
|
public void onPlayerJoin(PlayerJoinEvent event){
|
||||||
final Player p = event.getPlayer();
|
final Player p = event.getPlayer();
|
||||||
String pname = p.getName();
|
final String pname = p.getName();
|
||||||
if(!plugin.Watching.isEmpty()){
|
for(i = 1; i <= plugin.Watching.size(); i++){
|
||||||
for(i = 0; i < plugin.Watching.size(); i++){
|
for(String s: plugin.Watching.get(i)){
|
||||||
String s = plugin.Watching.get(i++);
|
|
||||||
Player spectator = plugin.getServer().getPlayerExact(s);
|
Player spectator = plugin.getServer().getPlayerExact(s);
|
||||||
p.hidePlayer(spectator);
|
p.hidePlayer(spectator);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(plugin.Out.contains(pname)){
|
for(i = 1; i <= plugin.Out.size(); i++){
|
||||||
plugin.Playing.add(pname);
|
if(plugin.Out.get(i).contains(pname)){
|
||||||
|
plugin.Playing.get(i).add(pname);
|
||||||
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable(){
|
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable(){
|
||||||
public void run(){
|
public void run(){
|
||||||
p.sendMessage(ChatColor.AQUA + "You have saved yourself from being ejected from the arena!");
|
p.sendMessage(ChatColor.AQUA + "You have saved yourself from being ejected from the arena!");
|
||||||
}
|
}
|
||||||
}, 40L);
|
}, 40L);
|
||||||
plugin.Out.remove(pname);
|
plugin.Out.get(i).remove(pname);
|
||||||
}
|
}
|
||||||
if(plugin.Quit.contains(pname) || plugin.Dead.contains(pname)){
|
}
|
||||||
|
for(i = 1; i <= plugin.Quit.size(); i++){
|
||||||
|
if(plugin.Quit.get(i).contains(pname)){
|
||||||
String[] Spawncoords = plugin.spawns.getString("Spawn_coords").split(",");
|
String[] Spawncoords = plugin.spawns.getString("Spawn_coords").split(",");
|
||||||
String w = Spawncoords[3];
|
String w = Spawncoords[3];
|
||||||
World spawnw = plugin.getServer().getWorld(w);
|
World spawnw = plugin.getServer().getWorld(w);
|
||||||
@ -62,12 +70,55 @@ public class JoinAndQuitListener implements Listener {
|
|||||||
}, 40L);
|
}, 40L);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for(i = 1; i <= plugin.Dead.size(); i++){
|
||||||
|
if(plugin.Dead.get(i).contains(pname)){
|
||||||
|
String[] Spawncoords = plugin.spawns.getString("Spawn_coords").split(",");
|
||||||
|
String w = Spawncoords[3];
|
||||||
|
World spawnw = plugin.getServer().getWorld(w);
|
||||||
|
double spawnx = Double.parseDouble(Spawncoords[0]);
|
||||||
|
double spawny = Double.parseDouble(Spawncoords[1]);
|
||||||
|
double spawnz = Double.parseDouble(Spawncoords[2]);
|
||||||
|
final Location Spawn = new Location(spawnw, spawnx, spawny, spawnz);
|
||||||
|
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable(){
|
||||||
|
public void run(){
|
||||||
|
p.teleport(Spawn);
|
||||||
|
p.sendMessage(ChatColor.RED + "You have been teleported to spawn because you quit/forfeited!");
|
||||||
|
}
|
||||||
|
}, 40L);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for(i = 1; i <= plugin.inArena.size(); i++){
|
||||||
|
if(plugin.inArena.get(i)!= null){
|
||||||
|
if(plugin.inArena.get(i).contains(pname)){
|
||||||
|
String[] Spawncoords = plugin.spawns.getString("Spawn_coords").split(",");
|
||||||
|
String w = Spawncoords[3];
|
||||||
|
World spawnw = plugin.getServer().getWorld(w);
|
||||||
|
double spawnx = Double.parseDouble(Spawncoords[0]);
|
||||||
|
double spawny = Double.parseDouble(Spawncoords[1]);
|
||||||
|
double spawnz = Double.parseDouble(Spawncoords[2]);
|
||||||
|
final Location Spawn = new Location(spawnw, spawnx, spawny, spawnz);
|
||||||
|
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable(){
|
||||||
|
public void run(){
|
||||||
|
p.teleport(Spawn);
|
||||||
|
p.getInventory().clear();
|
||||||
|
p.getInventory().setBoots(null);
|
||||||
|
p.getInventory().setLeggings(null);
|
||||||
|
p.getInventory().setChestplate(null);
|
||||||
|
p.getInventory().setHelmet(null);
|
||||||
|
plugin.inArena.remove(pname);
|
||||||
|
p.sendMessage(ChatColor.RED + "You were still in the arena when you left and now the games are over.");
|
||||||
|
}
|
||||||
|
}, 40L);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onQuit(PlayerQuitEvent evt) {
|
public void onQuit(PlayerQuitEvent evt) {
|
||||||
Player p = evt.getPlayer();
|
Player p = evt.getPlayer();
|
||||||
String pname = p.getName();
|
String pname = p.getName();
|
||||||
if (plugin.Frozen.contains(pname)) {
|
for(i = 1; i <= plugin.Frozen.size(); i++){
|
||||||
|
if (plugin.Frozen.get(i).contains(pname)) {
|
||||||
plugin.Frozen.remove(pname);
|
plugin.Frozen.remove(pname);
|
||||||
String[] Spawncoords = plugin.spawns.getString("Spawn_coords").split(",");
|
String[] Spawncoords = plugin.spawns.getString("Spawn_coords").split(",");
|
||||||
String w = Spawncoords[3];
|
String w = Spawncoords[3];
|
||||||
@ -79,21 +130,24 @@ public class JoinAndQuitListener implements Listener {
|
|||||||
p.teleport(Spawn);
|
p.teleport(Spawn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerQuit(PlayerQuitEvent event){
|
public void onPlayerQuit(PlayerQuitEvent event){
|
||||||
final Player p = event.getPlayer();
|
final Player p = event.getPlayer();
|
||||||
final String pname = p.getName();
|
final String pname = p.getName();
|
||||||
if(plugin.Playing.contains(pname)){
|
if(plugin.getArena(p)!= null){
|
||||||
plugin.Out.add(pname);
|
a = plugin.getArena(p);
|
||||||
plugin.Playing.remove(pname);
|
plugin.Out.get(a).add(pname);
|
||||||
|
plugin.Playing.get(a).remove(pname);
|
||||||
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable(){
|
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable(){
|
||||||
public void run(){
|
public void run(){
|
||||||
if(plugin.Out.contains(pname)){
|
if(plugin.Out.get(a).contains(pname)){
|
||||||
plugin.Quit.add(pname);
|
plugin.Quit.get(a).add(pname);
|
||||||
plugin.Out.remove(pname);
|
plugin.Out.remove(pname);
|
||||||
plugin.winner();
|
plugin.winner(a);
|
||||||
}else{
|
plugin.inArena.get(a).add(pname);
|
||||||
plugin.Quit.add(pname);
|
}else if(plugin.getArena(p)== null){
|
||||||
|
plugin.Quit.get(a).add(pname);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, 1200L);
|
}, 1200L);
|
||||||
|
@ -4,8 +4,10 @@ import java.io.File;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashSet;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Map.Entry;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
@ -27,17 +29,22 @@ import org.bukkit.potion.PotionEffect;
|
|||||||
import org.bukkit.potion.PotionEffectType;
|
import org.bukkit.potion.PotionEffectType;
|
||||||
|
|
||||||
public class Main extends JavaPlugin{
|
public class Main extends JavaPlugin{
|
||||||
static final Logger log = Logger.getLogger("Minecraft");
|
static Logger log;
|
||||||
public ArrayList<String> Playing = new ArrayList<String>();
|
public HashMap<Integer, List<String>> Playing = new HashMap<Integer, List<String>>();
|
||||||
public ArrayList<String> Ready = new ArrayList<String>();
|
public HashMap<Integer, List<String>> Ready = new HashMap<Integer, List<String>>();
|
||||||
public ArrayList<String> Dead = new ArrayList<String>();
|
public HashMap<Integer, List<String>> Dead = new HashMap<Integer, List<String>>();
|
||||||
public ArrayList<String> Quit = new ArrayList<String>();
|
public HashMap<Integer, List<String>> Quit = new HashMap<Integer, List<String>>();
|
||||||
public ArrayList<String> Out = new ArrayList<String>();
|
public HashMap<Integer, List<String>> Out = new HashMap<Integer, List<String>>();
|
||||||
public ArrayList<String> Watching = new ArrayList<String>();
|
public HashMap<Integer, List<String>> Watching = new HashMap<Integer, List<String>>();
|
||||||
public ArrayList<String> NeedConfirm = new ArrayList<String>();
|
public HashMap<Integer, List<String>> NeedConfirm = new HashMap<Integer, List<String>>();
|
||||||
public ArrayList<Location> location = new ArrayList<Location>();
|
public HashMap<Integer, HashMap<Integer, Location>> location = new HashMap<Integer, HashMap<Integer, Location>>();
|
||||||
public ArrayList<Player> Tele = new ArrayList<Player>();
|
public ArrayList<Player> Tele = new ArrayList<Player>();
|
||||||
public HashSet<String> Frozen = new HashSet<String>();
|
public HashMap<Integer, List<String>> inArena = new HashMap<Integer, List<String>>();
|
||||||
|
public HashMap<Integer, List<String>> Frozen = new HashMap<Integer, List<String>>();
|
||||||
|
public HashMap<Integer, List<String>> arena = new HashMap<Integer, List<String>>();
|
||||||
|
public HashMap<Integer, Boolean> canjoin = new HashMap<Integer, Boolean>();
|
||||||
|
public HashMap<Integer, Integer> maxPlayers = new HashMap<Integer, Integer>();
|
||||||
|
public HashMap<Integer, Boolean> open = new HashMap<Integer, Boolean>();
|
||||||
public List<String> worlds;
|
public List<String> worlds;
|
||||||
public Listener DeathListener = new DeathListener(this);
|
public Listener DeathListener = new DeathListener(this);
|
||||||
public Listener SpectatorListener = new SpectatorListener(this);
|
public Listener SpectatorListener = new SpectatorListener(this);
|
||||||
@ -55,10 +62,8 @@ public class Main extends JavaPlugin{
|
|||||||
public CommandExecutor HaCommands = new HaCommands(this);
|
public CommandExecutor HaCommands = new HaCommands(this);
|
||||||
public CommandExecutor SponsorCommands = new SponsorCommands(this);
|
public CommandExecutor SponsorCommands = new SponsorCommands(this);
|
||||||
public CommandExecutor SpawnsCommand = new SpawnsCommand(this);
|
public CommandExecutor SpawnsCommand = new SpawnsCommand(this);
|
||||||
public boolean canjoin;
|
|
||||||
public boolean exists;
|
public boolean exists;
|
||||||
public boolean restricted;
|
public boolean restricted;
|
||||||
public boolean open = true;
|
|
||||||
public FileConfiguration config;
|
public FileConfiguration config;
|
||||||
public FileConfiguration spawns = null;
|
public FileConfiguration spawns = null;
|
||||||
public File spawnsFile = null;
|
public File spawnsFile = null;
|
||||||
@ -73,7 +78,13 @@ public class Main extends JavaPlugin{
|
|||||||
public boolean eco = false;
|
public boolean eco = false;
|
||||||
public Economy econ = null;
|
public Economy econ = null;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
int v = 0;
|
||||||
|
int start = 0;
|
||||||
|
int deathtime = 0;
|
||||||
|
int timetodeath = 0;
|
||||||
|
int a = 0;
|
||||||
public void onEnable(){
|
public void onEnable(){
|
||||||
|
log = this.getLogger();
|
||||||
config = this.getConfig();
|
config = this.getConfig();
|
||||||
config.options().copyDefaults(true);
|
config.options().copyDefaults(true);
|
||||||
this.saveDefaultConfig();
|
this.saveDefaultConfig();
|
||||||
@ -86,7 +97,6 @@ public class Main extends JavaPlugin{
|
|||||||
management = this.getManagement();
|
management = this.getManagement();
|
||||||
management.options().copyDefaults(true);
|
management.options().copyDefaults(true);
|
||||||
this.saveManagement();
|
this.saveManagement();
|
||||||
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);
|
||||||
@ -102,21 +112,52 @@ public class Main extends JavaPlugin{
|
|||||||
getCommand("Ha").setExecutor(HaCommands);
|
getCommand("Ha").setExecutor(HaCommands);
|
||||||
getCommand("Sponsor").setExecutor(SponsorCommands);
|
getCommand("Sponsor").setExecutor(SponsorCommands);
|
||||||
getCommand("Startpoint").setExecutor(SpawnsCommand);
|
getCommand("Startpoint").setExecutor(SpawnsCommand);
|
||||||
for(String spawnlocations:spawns.getStringList("Spawns")){
|
i = 1;
|
||||||
String[] coords = spawnlocations.split(",");
|
//TODO THIS CRAP
|
||||||
if(coords[4].equalsIgnoreCase("true")){
|
if(spawns.getConfigurationSection("Spawns")!= null){
|
||||||
double x = Double.parseDouble(coords[0]);
|
Map<String, Object> temp = spawns.getConfigurationSection("Spawns").getValues(false);
|
||||||
double y = Double.parseDouble(coords[1]);
|
for(Entry<String, Object> entry: temp.entrySet()){
|
||||||
double z = Double.parseDouble(coords[2]);
|
if(spawns.getConfigurationSection("Spawns." + entry.getKey())!= null){
|
||||||
String world = coords[3];
|
Map<String, Object> temp2 = spawns.getConfigurationSection("Spawns." + entry.getKey()).getValues(false);
|
||||||
World w = getServer().getWorld(world);
|
for(Map.Entry<String, Object> e: temp2.entrySet()){
|
||||||
Location loc = new Location(w, x, y, z);
|
if(spawns.get("Spawns." + entry.getKey() + "." + e.getKey())!= null){
|
||||||
location.add(loc);
|
String[] coords = ((String) spawns.get("Spawns." + entry.getKey() + "." + e.getKey())).split(",");
|
||||||
|
Integer a = Integer.parseInt(entry.getKey());
|
||||||
|
Integer s = Integer.parseInt(e.getKey());
|
||||||
|
if(location.get(a)== null)
|
||||||
|
location.put(a, new HashMap<Integer, Location>());
|
||||||
|
log.info("Added spawn number " + s + " in arena " + a + "!");
|
||||||
|
location.get(a).put(s, new Location(getServer().getWorld(coords[0]), Double.parseDouble(coords[1]), Double.parseDouble(coords[2]), Double.parseDouble(coords[3])));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
System.out.println("[HungerArena] Loaded " + location.size() + " tribute spawns!");
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for(i = 1; i <= location.size(); i++){
|
||||||
|
log.info("Loaded " + location.get(i).size() + " tribute spawns for arena " + i + "!");
|
||||||
|
Playing.put(i, new ArrayList<String>());
|
||||||
|
Ready.put(i, new ArrayList<String>());
|
||||||
|
Dead.put(i, new ArrayList<String>());
|
||||||
|
Quit.put(i, new ArrayList<String>());
|
||||||
|
Out.put(i, new ArrayList<String>());
|
||||||
|
Watching.put(i, new ArrayList<String>());
|
||||||
|
NeedConfirm.put(i, new ArrayList<String>());
|
||||||
|
inArena.put(i, new ArrayList<String>());
|
||||||
|
Frozen.put(i, new ArrayList<String>());
|
||||||
|
arena.put(i, new ArrayList<String>());
|
||||||
|
canjoin.put(i, false);
|
||||||
|
if(location.get(i).size()== config.getInt("maxPlayers")){
|
||||||
|
maxPlayers.put(i, location.get(i).size());
|
||||||
|
}else if(location.size()< config.getInt("maxPlayers")){
|
||||||
|
maxPlayers.put(i, location.get(i).size());
|
||||||
|
}else if(location.size()> config.getInt("maxPlayers")){
|
||||||
|
maxPlayers.put(i, config.getInt("maxPlayers"));
|
||||||
|
}
|
||||||
|
log.info("Max players is for arena " + i + " is " + maxPlayers.get(i));
|
||||||
|
open.put(i, true);
|
||||||
|
}
|
||||||
if (setupEconomy()) {
|
if (setupEconomy()) {
|
||||||
log.info("[HungerArena] Found Vault! Hooking in for economy!");
|
log.info("Found Vault! Hooking in for economy!");
|
||||||
}
|
}
|
||||||
if (config.getDouble("config.version") != 1.3) {
|
if (config.getDouble("config.version") != 1.3) {
|
||||||
config.set("config.version", 1.3);
|
config.set("config.version", 1.3);
|
||||||
@ -133,7 +174,7 @@ public class Main extends JavaPlugin{
|
|||||||
}
|
}
|
||||||
if (!eco) {
|
if (!eco) {
|
||||||
if (vault == true) {
|
if (vault == true) {
|
||||||
log.info(ChatColor.GREEN + "We see that you have Vault on your server. To set economy support to true, enable it in the config.");
|
log.info("We see that you have Vault on your server. To set economy support to true, enable it in the config.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
try{
|
try{
|
||||||
@ -160,10 +201,11 @@ public class Main extends JavaPlugin{
|
|||||||
}else if(!worlds.isEmpty()){
|
}else if(!worlds.isEmpty()){
|
||||||
restricted = true;
|
restricted = true;
|
||||||
}
|
}
|
||||||
|
log.info("Enabled v" + getDescription().getVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onDisable(){
|
public void onDisable(){
|
||||||
log.info("[HungerArena] disabled v" + getDescription().getVersion());
|
log.info("Disabled v" + getDescription().getVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean setupEconomy() {
|
public boolean setupEconomy() {
|
||||||
@ -265,17 +307,17 @@ public class Main extends JavaPlugin{
|
|||||||
this.getLogger().log(Level.SEVERE, "Could not save config to " + managementFile, ex);
|
this.getLogger().log(Level.SEVERE, "Could not save config to " + managementFile, ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void winner(){
|
public void winner(Integer a){
|
||||||
String[] Spawncoords = spawns.getString("Spawn_coords").split(",");
|
String[] Spawncoords = spawns.getString("Spawn_coords").split(",");
|
||||||
World spawnw = getServer().getWorld(Spawncoords[3]);
|
World spawnw = 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]);
|
||||||
Location Spawn = new Location(spawnw, spawnx, spawny, spawnz);
|
Location Spawn = new Location(spawnw, spawnx, spawny, spawnz);
|
||||||
if(Playing.size()== 1 && canjoin== false){
|
if(Playing.size()== 1 && canjoin.get(a)== true){
|
||||||
//Announce winner
|
//Announce winner
|
||||||
for(i = 0; i < Playing.size(); i++){
|
for(i = 1; i < Playing.get(a).size(); i++){
|
||||||
String winnername = Playing.get(i++);
|
String winnername = Playing.get(a).get(i++);
|
||||||
Player winner = getServer().getPlayerExact(winnername);
|
Player winner = getServer().getPlayerExact(winnername);
|
||||||
String winnername2 = winner.getName();
|
String winnername2 = winner.getName();
|
||||||
getServer().broadcastMessage(ChatColor.GREEN + winnername2 + " is the victor of this Hunger Games!");
|
getServer().broadcastMessage(ChatColor.GREEN + winnername2 + " is the victor of this Hunger Games!");
|
||||||
@ -284,6 +326,7 @@ public class Main extends JavaPlugin{
|
|||||||
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.setLevel(0);
|
||||||
for(PotionEffect pe: winner.getActivePotionEffects()){
|
for(PotionEffect pe: winner.getActivePotionEffects()){
|
||||||
PotionEffectType potion = pe.getType();
|
PotionEffectType potion = pe.getType();
|
||||||
winner.removePotionEffect(potion);
|
winner.removePotionEffect(potion);
|
||||||
@ -295,12 +338,16 @@ public class Main extends JavaPlugin{
|
|||||||
winner.getInventory().addItem(Rewards);
|
winner.getInventory().addItem(Rewards);
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
econ.depositPlayer(winner.getName(), config.getDouble("eco.reward"));
|
for(ItemStack Rewards: Reward){
|
||||||
|
winner.getInventory().addItem(Rewards);
|
||||||
|
}
|
||||||
|
econ.depositPlayer(winner.getName(), config.getDouble("rewardEco.reward"));
|
||||||
}
|
}
|
||||||
Playing.clear();
|
Playing.clear();
|
||||||
|
getServer().getScheduler().cancelTask(deathtime);
|
||||||
}
|
}
|
||||||
//Show spectators
|
//Show spectators
|
||||||
for(String s1: Watching){
|
for(String s1: Watching.get(a)){
|
||||||
Player spectator = getServer().getPlayerExact(s1);
|
Player spectator = getServer().getPlayerExact(s1);
|
||||||
spectator.setAllowFlight(false);
|
spectator.setAllowFlight(false);
|
||||||
spectator.teleport(Spawn);
|
spectator.teleport(Spawn);
|
||||||
@ -318,4 +365,139 @@ public class Main extends JavaPlugin{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public void startGames(final Integer a){
|
||||||
|
String begin = config.getString("Start_Message");
|
||||||
|
begin = begin.replaceAll("(&([a-f0-9]))", "\u00A7$2");
|
||||||
|
final String msg = begin;
|
||||||
|
i = 10;
|
||||||
|
if(config.getString("Countdown").equalsIgnoreCase("true")){
|
||||||
|
start = getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable(){
|
||||||
|
public void run(){
|
||||||
|
if(i > 0){
|
||||||
|
if(worlds.isEmpty()){
|
||||||
|
if(config.getBoolean("broadcastAll")){
|
||||||
|
getServer().broadcastMessage(String.valueOf(i));
|
||||||
|
}else{
|
||||||
|
for(String gn: Playing.get(a)){
|
||||||
|
Player g = getServer().getPlayer(gn);
|
||||||
|
g.sendMessage(String.valueOf(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
for(String world: worlds){
|
||||||
|
World w = getServer().getWorld(world);
|
||||||
|
if(config.getBoolean("broadcastAll")){
|
||||||
|
for(Player wp: w.getPlayers()){
|
||||||
|
wp.sendMessage(String.valueOf(i));
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
for(String gn: Playing.get(a)){
|
||||||
|
Player g = getServer().getPlayer(gn);
|
||||||
|
g.sendMessage(String.valueOf(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
i = i-1;
|
||||||
|
canjoin.put(a, true);
|
||||||
|
if(i== -1){
|
||||||
|
Frozen.get(a).clear();
|
||||||
|
if(config.getBoolean("broadcastAll")){
|
||||||
|
getServer().broadcastMessage(msg);
|
||||||
|
}else{
|
||||||
|
for(String gn: Playing.get(a)){
|
||||||
|
Player g = getServer().getPlayer(gn);
|
||||||
|
g.sendMessage(msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
getServer().dispatchCommand(Bukkit.getConsoleSender(), "ha Refill " + a);
|
||||||
|
getServer().getScheduler().cancelTask(start);
|
||||||
|
if(config.getInt("DeathMatch")!= 0){
|
||||||
|
int death = config.getInt("DeathMatch");
|
||||||
|
timetodeath = death;
|
||||||
|
deathtime = getServer().getScheduler().scheduleSyncRepeatingTask(Bukkit.getPluginManager().getPlugin("HungerArena"), new Runnable(){
|
||||||
|
public void run(){
|
||||||
|
timetodeath = timetodeath-1;
|
||||||
|
if(config.getBoolean("broadcastAll")){
|
||||||
|
for(Player wp: location.get(a).get(0).getWorld().getPlayers()){
|
||||||
|
if(timetodeath!= 0){
|
||||||
|
wp.sendMessage(ChatColor.RED + String.valueOf(timetodeath) + " mins till the death match!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
for(String gn: Playing.get(a)){
|
||||||
|
Player g = getServer().getPlayer(gn);
|
||||||
|
g.sendMessage(ChatColor.RED + String.valueOf(timetodeath) + " mins till the death match!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(timetodeath== 0){
|
||||||
|
for(String playing: Playing.get(a)){
|
||||||
|
Player tribute = getServer().getPlayerExact(playing);
|
||||||
|
tribute.teleport(location.get(a).get(i));
|
||||||
|
i = i+1;
|
||||||
|
for(PotionEffect pe: tribute.getActivePotionEffects()){
|
||||||
|
PotionEffectType potion = pe.getType();
|
||||||
|
tribute.removePotionEffect(potion);
|
||||||
|
}
|
||||||
|
if(tribute.getAllowFlight()){
|
||||||
|
tribute.setAllowFlight(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(config.getBoolean("broadcastAll")){
|
||||||
|
for(Player wp: location.get(a).get(0).getWorld().getPlayers()){
|
||||||
|
wp.sendMessage(ChatColor.RED + "The final battle has begun! " + Playing.size() + " tributes will be facing off!");
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
for(String gn: Playing.get(a)){
|
||||||
|
Player g = getServer().getPlayer(gn);
|
||||||
|
g.sendMessage(ChatColor.RED + "The final battle has begun! " + Playing.size() + " tributes will be facing off!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
getServer().getScheduler().cancelTask(deathtime);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, 1200L, 1200L);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, 20L, 20L);
|
||||||
|
}else{
|
||||||
|
Frozen.get(a).clear();
|
||||||
|
if(config.getBoolean("broadcastAll")){
|
||||||
|
getServer().broadcastMessage(msg);
|
||||||
|
}else{
|
||||||
|
for(String gn: Playing.get(a)){
|
||||||
|
Player g = getServer().getPlayer(gn);
|
||||||
|
g.sendMessage(msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
canjoin.put(a, true);
|
||||||
|
getServer().dispatchCommand(Bukkit.getConsoleSender(), "ha Refill " + a);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public Integer getArena(Player p){
|
||||||
|
int x = 0;
|
||||||
|
for(x = 1; x < Playing.size(); x++){
|
||||||
|
if(Playing.get(x)!= null){
|
||||||
|
if(Playing.get(x).contains(p.getName())){
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
public boolean isSpectating(Player p){
|
||||||
|
int x = 0;
|
||||||
|
if(!Watching.isEmpty()){
|
||||||
|
for(x= 1; x <= Watching.size(); x++){
|
||||||
|
if(Watching.get(x).contains(p.getName())){
|
||||||
|
x = Watching.size()+1;
|
||||||
|
return true;
|
||||||
|
}else if(Watching.size()== x)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,44 +14,49 @@ public class PvP implements Listener {
|
|||||||
public PvP(Main m) {
|
public PvP(Main m) {
|
||||||
this.plugin = m;
|
this.plugin = m;
|
||||||
}
|
}
|
||||||
|
int a = 0;
|
||||||
@EventHandler(priority= EventPriority.MONITOR)
|
@EventHandler(priority= EventPriority.MONITOR)
|
||||||
public void PlayerPvP(EntityDamageByEntityEvent event){
|
public void PlayerPvP(EntityDamageByEntityEvent event){
|
||||||
Entity p = event.getEntity();
|
Entity pl = event.getEntity();
|
||||||
Entity d = event.getDamager();
|
Entity dl = event.getDamager();
|
||||||
if(p instanceof Player && d instanceof Player){
|
if(pl instanceof Player && dl instanceof Player){
|
||||||
String pname = ((Player) p).getName();
|
Player p = (Player) pl;
|
||||||
String dname = ((Player) d).getName();
|
Player d = (Player) dl;
|
||||||
if(plugin.Playing.contains(pname) && plugin.Playing.contains(dname)){
|
if(plugin.getArena(p)!= null && plugin.getArena(d)!= null){
|
||||||
if(plugin.canjoin){
|
a = plugin.getArena(p);
|
||||||
|
if(plugin.canjoin.get(a)){
|
||||||
if(event.isCancelled()){
|
if(event.isCancelled()){
|
||||||
event.setCancelled(false);
|
event.setCancelled(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else if(plugin.Playing.contains(pname)){
|
}
|
||||||
if(!plugin.canjoin){
|
if(plugin.getArena(p)!= null){
|
||||||
|
a = plugin.getArena(p);
|
||||||
|
if(!plugin.canjoin.get(a)){
|
||||||
if(!event.isCancelled()){
|
if(!event.isCancelled()){
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else if(!plugin.Playing.contains(pname) && plugin.Playing.contains(dname)){
|
}
|
||||||
|
if(plugin.getArena(p)== null && plugin.getArena(d)!= null){
|
||||||
if(!event.isCancelled()){
|
if(!event.isCancelled()){
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else if(p instanceof Player && d instanceof Projectile){
|
}else if(pl instanceof Player && dl instanceof Projectile){
|
||||||
Projectile projectile = (Projectile) d;
|
Projectile projectile = (Projectile) dl;
|
||||||
String pname = ((Player) p).getName();
|
Player p = (Player) pl;
|
||||||
if(projectile.getShooter() instanceof Player){
|
if(projectile.getShooter() instanceof Player){
|
||||||
if(plugin.Playing.contains(pname)){
|
if(plugin.getArena(p) != null){
|
||||||
Player shooter = (Player) projectile.getShooter();
|
Player shooter = (Player) projectile.getShooter();
|
||||||
if(plugin.Playing.contains(shooter.getName())){
|
if(plugin.getArena(shooter)!= null){
|
||||||
event.setCancelled(false);
|
event.setCancelled(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else if(projectile.getShooter() instanceof Entity){
|
}else if(projectile.getShooter() instanceof Entity){
|
||||||
Entity e = projectile.getShooter();
|
Entity e = projectile.getShooter();
|
||||||
if(e instanceof Skeleton){
|
if(e instanceof Skeleton){
|
||||||
if(plugin.Playing.contains(pname)){
|
if(plugin.getArena(p)!= null){
|
||||||
event.setCancelled(false);
|
event.setCancelled(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,11 +30,12 @@ public class Signs implements Listener {
|
|||||||
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");
|
|
||||||
}else{
|
|
||||||
p.performCommand("ha " + line2);
|
p.performCommand("ha " + line2);
|
||||||
}
|
else if(!line3.equals(""))
|
||||||
|
p.performCommand("ha " + line2 + " " + line3);
|
||||||
|
else
|
||||||
|
p.performCommand("ha");
|
||||||
}
|
}
|
||||||
if(line1.equalsIgnoreCase(ChatColor.BLUE + "[Sponsor]")){
|
if(line1.equalsIgnoreCase(ChatColor.BLUE + "[Sponsor]")){
|
||||||
p.performCommand("sponsor " + line2 + " " + line3 + " " + line4);
|
p.performCommand("sponsor " + line2 + " " + line3 + " " + line4);
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package me.Travja.HungerArena;
|
package me.Travja.HungerArena;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
@ -11,6 +12,8 @@ import org.bukkit.entity.Player;
|
|||||||
|
|
||||||
public class SpawnsCommand implements CommandExecutor {
|
public class SpawnsCommand implements CommandExecutor {
|
||||||
public Main plugin;
|
public Main plugin;
|
||||||
|
int i = 0;
|
||||||
|
int a = 0;
|
||||||
public SpawnsCommand(Main m) {
|
public SpawnsCommand(Main m) {
|
||||||
this.plugin = m;
|
this.plugin = m;
|
||||||
}
|
}
|
||||||
@ -20,251 +23,57 @@ public class SpawnsCommand implements CommandExecutor {
|
|||||||
if(cmd.getName().equalsIgnoreCase("StartPoint")){
|
if(cmd.getName().equalsIgnoreCase("StartPoint")){
|
||||||
if(p.hasPermission("HungerArena.StartPoint")){
|
if(p.hasPermission("HungerArena.StartPoint")){
|
||||||
if(!plugin.restricted || (plugin.restricted && plugin.worlds.contains(p.getWorld().getName()))){
|
if(!plugin.restricted || (plugin.restricted && plugin.worlds.contains(p.getWorld().getName()))){
|
||||||
|
if(args.length>= 2){
|
||||||
try{
|
try{
|
||||||
int i = Integer.parseInt(args[0]);
|
i = Integer.valueOf(args[1]);
|
||||||
if(i >= 1 && i <= 24){
|
a = Integer.valueOf(args[0]);
|
||||||
|
}catch(Exception e){
|
||||||
|
p.sendMessage(ChatColor.RED + "Argument not an integer!");
|
||||||
|
}
|
||||||
|
if(i >= 1 && i <= plugin.config.getInt("maxPlayers")){
|
||||||
if(plugin.restricted && !plugin.worlds.contains(p.getWorld().getName())){
|
if(plugin.restricted && !plugin.worlds.contains(p.getWorld().getName())){
|
||||||
p.sendMessage(ChatColor.GOLD + "We ran the command, however, this isn't a world you defined in the config...");
|
p.sendMessage(ChatColor.GOLD + "We ran the command, however, this isn't a world you defined in the config...");
|
||||||
p.sendMessage(ChatColor.GOLD + "If this is the right world, please disregard this message.");
|
p.sendMessage(ChatColor.GOLD + "If this is the right world, please disregard this message.");
|
||||||
}
|
}
|
||||||
Location ploc = p.getLocation().getBlock().getLocation();
|
Location ploc = p.getLocation().getBlock().getLocation();
|
||||||
List<String> locations = plugin.spawns.getStringList("Spawns");
|
|
||||||
double x = ploc.getX();
|
double x = ploc.getX();
|
||||||
double y = ploc.getY();
|
double y = ploc.getY();
|
||||||
double z = ploc.getZ();
|
double z = ploc.getZ();
|
||||||
String w = ploc.getWorld().getName();
|
if(plugin.location.get(a)!= null){
|
||||||
String coords = x + "," + y + "," + z + "," + w + ",true";
|
if(plugin.location.get(a).size()>= i){
|
||||||
locations.set(i-1, coords);
|
plugin.location.get(a).put(i, new Location(ploc.getWorld(), x, y, z));
|
||||||
plugin.spawns.set("Spawns", locations);
|
|
||||||
plugin.saveSpawns();
|
|
||||||
plugin.location.add(new Location(ploc.getWorld(), x, y, z));
|
|
||||||
p.sendMessage(ChatColor.AQUA + "You have set the spawn location of Tribute " + i);
|
|
||||||
}else{
|
}else{
|
||||||
p.sendMessage(ChatColor.RED + "You can't go past 24 or below 1!");
|
plugin.location.get(a).put(i, new Location(ploc.getWorld(), x, y, z));
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
plugin.location.put(a, new HashMap<Integer, Location>());
|
||||||
|
plugin.location.get(a).put(i, new Location(ploc.getWorld(), x, y, z));
|
||||||
|
plugin.Playing.put(a, new ArrayList<String>());
|
||||||
|
plugin.Ready.put(a, new ArrayList<String>());
|
||||||
|
plugin.Dead.put(a, new ArrayList<String>());
|
||||||
|
plugin.Quit.put(a, new ArrayList<String>());
|
||||||
|
plugin.Out.put(a, new ArrayList<String>());
|
||||||
|
plugin.Watching.put(a, new ArrayList<String>());
|
||||||
|
plugin.NeedConfirm.put(a, new ArrayList<String>());
|
||||||
|
plugin.inArena.put(a, new ArrayList<String>());
|
||||||
|
plugin.Frozen.put(a, new ArrayList<String>());
|
||||||
|
plugin.arena.put(a, new ArrayList<String>());
|
||||||
|
plugin.canjoin.put(a, false);
|
||||||
|
plugin.open.put(a, true);
|
||||||
|
}
|
||||||
|
String coords = plugin.location.get(a).get(i).getWorld().getName() + "," + plugin.location.get(a).get(i).getX() + "," + plugin.location.get(a).get(i).getY() + "," + plugin.location.get(a).get(i).getZ();
|
||||||
|
plugin.spawns.set("Spawns." + a + "." + i, coords);
|
||||||
|
plugin.saveSpawns();
|
||||||
|
plugin.maxPlayers.put(a, plugin.location.get(a).size());
|
||||||
|
p.sendMessage(ChatColor.AQUA + "You have set the spawn location of Tribute " + i + " in arena " + a + "!");
|
||||||
|
}else{
|
||||||
|
p.sendMessage(ChatColor.RED + "You can't go past " + plugin.maxPlayers + " players!");
|
||||||
}
|
}
|
||||||
}catch(Exception e){
|
|
||||||
p.sendMessage(ChatColor.RED + "Argument not an integer!");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
p.sendMessage(ChatColor.RED + "You don't have permission!");
|
p.sendMessage(ChatColor.RED + "You don't have permission!");
|
||||||
}
|
}
|
||||||
/*if(args[0].equalsIgnoreCase("1")){
|
|
||||||
double x = ploc.getX();
|
|
||||||
double y = ploc.getY();
|
|
||||||
double z = ploc.getZ();
|
|
||||||
String w = ploc.getWorld().getName();
|
|
||||||
plugin.spawns.set("Tribute_one_spawn", x + "," + y + "," + z + "," + w);
|
|
||||||
plugin.saveSpawns();
|
|
||||||
p.sendMessage(ChatColor.AQUA + "You have set the spawn location of Tribute one!");
|
|
||||||
}
|
|
||||||
if(args[0].equalsIgnoreCase("2")){
|
|
||||||
double x = ploc.getX();
|
|
||||||
double y = ploc.getY();
|
|
||||||
double z = ploc.getZ();
|
|
||||||
String w = ploc.getWorld().getName();
|
|
||||||
plugin.spawns.set("Tribute_two_spawn", x + "," + y + "," + z + "," + w);
|
|
||||||
plugin.saveSpawns();
|
|
||||||
p.sendMessage(ChatColor.AQUA + "You have set the spawn location of Tribute two!");
|
|
||||||
}
|
|
||||||
if(args[0].equalsIgnoreCase("3")){
|
|
||||||
double x = ploc.getX();
|
|
||||||
double y = ploc.getY();
|
|
||||||
double z = ploc.getZ();
|
|
||||||
String w = ploc.getWorld().getName();
|
|
||||||
plugin.spawns.set("Tribute_three_spawn", x + "," + y + "," + z + "," + w);
|
|
||||||
plugin.saveSpawns();
|
|
||||||
p.sendMessage(ChatColor.AQUA + "You have set the spawn location of Tribute three!");
|
|
||||||
}
|
|
||||||
if(args[0].equalsIgnoreCase("4")){
|
|
||||||
double x = ploc.getX();
|
|
||||||
double y = ploc.getY();
|
|
||||||
double z = ploc.getZ();
|
|
||||||
String w = ploc.getWorld().getName();
|
|
||||||
plugin.spawns.set("Tribute_four_spawn", x + "," + y + "," + z + "," + w);
|
|
||||||
plugin.saveSpawns();
|
|
||||||
p.sendMessage(ChatColor.AQUA + "You have set the spawn location of Tribute four!");
|
|
||||||
}
|
|
||||||
if(args[0].equalsIgnoreCase("5")){
|
|
||||||
double x = ploc.getX();
|
|
||||||
double y = ploc.getY();
|
|
||||||
double z = ploc.getZ();
|
|
||||||
String w = ploc.getWorld().getName();
|
|
||||||
plugin.spawns.set("Tribute_five_spawn", x + "," + y + "," + z + "," + w);
|
|
||||||
plugin.saveSpawns();
|
|
||||||
p.sendMessage(ChatColor.AQUA + "You have set the spawn location of Tribute five!");
|
|
||||||
}
|
|
||||||
if(args[0].equalsIgnoreCase("6")){
|
|
||||||
double x = ploc.getX();
|
|
||||||
double y = ploc.getY();
|
|
||||||
double z = ploc.getZ();
|
|
||||||
String w = ploc.getWorld().getName();
|
|
||||||
plugin.spawns.set("Tribute_six_spawn", x + "," + y + "," + z + "," + w);
|
|
||||||
plugin.saveSpawns();
|
|
||||||
p.sendMessage(ChatColor.AQUA + "You have set the spawn location of Tribute six!");
|
|
||||||
}
|
|
||||||
if(args[0].equalsIgnoreCase("7")){
|
|
||||||
double x = ploc.getX();
|
|
||||||
double y = ploc.getY();
|
|
||||||
double z = ploc.getZ();
|
|
||||||
String w = ploc.getWorld().getName();
|
|
||||||
plugin.spawns.set("Tribute_seven_spawn", x + "," + y + "," + z + "," + w);
|
|
||||||
plugin.saveSpawns();
|
|
||||||
p.sendMessage(ChatColor.AQUA + "You have set the spawn location of Tribute seven!");
|
|
||||||
}
|
|
||||||
if(args[0].equalsIgnoreCase("8")){
|
|
||||||
double x = ploc.getX();
|
|
||||||
double y = ploc.getY();
|
|
||||||
double z = ploc.getZ();
|
|
||||||
String w = ploc.getWorld().getName();
|
|
||||||
plugin.spawns.set("Tribute_eight_spawn", x + "," + y + "," + z + "," + w);
|
|
||||||
plugin.saveSpawns();
|
|
||||||
p.sendMessage(ChatColor.AQUA + "You have set the spawn location of Tribute eight!");
|
|
||||||
}
|
|
||||||
if(args[0].equalsIgnoreCase("9")){
|
|
||||||
double x = ploc.getX();
|
|
||||||
double y = ploc.getY();
|
|
||||||
double z = ploc.getZ();
|
|
||||||
String w = ploc.getWorld().getName();
|
|
||||||
plugin.spawns.set("Tribute_nine_spawn", x + "," + y + "," + z + "," + w);
|
|
||||||
plugin.saveSpawns();
|
|
||||||
p.sendMessage(ChatColor.AQUA + "You have set the spawn location of Tribute nine!");
|
|
||||||
}
|
|
||||||
if(args[0].equalsIgnoreCase("10")){
|
|
||||||
double x = ploc.getX();
|
|
||||||
double y = ploc.getY();
|
|
||||||
double z = ploc.getZ();
|
|
||||||
String w = ploc.getWorld().getName();
|
|
||||||
plugin.spawns.set("Tribute_ten_spawn", x + "," + y + "," + z + "," + w);
|
|
||||||
plugin.saveSpawns();
|
|
||||||
p.sendMessage(ChatColor.AQUA + "You have set the spawn location of Tribute ten!");
|
|
||||||
}
|
|
||||||
if(args[0].equalsIgnoreCase("11")){
|
|
||||||
double x = ploc.getX();
|
|
||||||
double y = ploc.getY();
|
|
||||||
double z = ploc.getZ();
|
|
||||||
String w = ploc.getWorld().getName();
|
|
||||||
plugin.spawns.set("Tribute_eleven_spawn", x + "," + y + "," + z + "," + w);
|
|
||||||
plugin.saveSpawns();
|
|
||||||
p.sendMessage(ChatColor.AQUA + "You have set the spawn location of Tribute eleven!");
|
|
||||||
}
|
|
||||||
if(args[0].equalsIgnoreCase("12")){
|
|
||||||
double x = ploc.getX();
|
|
||||||
double y = ploc.getY();
|
|
||||||
double z = ploc.getZ();
|
|
||||||
String w = ploc.getWorld().getName();
|
|
||||||
plugin.spawns.set("Tribute_twelve_spawn", x + "," + y + "," + z + "," + w);
|
|
||||||
plugin.saveSpawns();
|
|
||||||
p.sendMessage(ChatColor.AQUA + "You have set the spawn location of Tribute twelve!");
|
|
||||||
}
|
|
||||||
if(args[0].equalsIgnoreCase("13")){
|
|
||||||
double x = ploc.getX();
|
|
||||||
double y = ploc.getY();
|
|
||||||
double z = ploc.getZ();
|
|
||||||
String w = ploc.getWorld().getName();
|
|
||||||
plugin.spawns.set("Tribute_thirteen_spawn", x + "," + y + "," + z + "," + w);
|
|
||||||
plugin.saveSpawns();
|
|
||||||
p.sendMessage(ChatColor.AQUA + "You have set the spawn location of Tribute thirteen!");
|
|
||||||
}
|
|
||||||
if(args[0].equalsIgnoreCase("14")){
|
|
||||||
double x = ploc.getX();
|
|
||||||
double y = ploc.getY();
|
|
||||||
double z = ploc.getZ();
|
|
||||||
String w = ploc.getWorld().getName();
|
|
||||||
plugin.spawns.set("Tribute_fourteen_spawn", x + "," + y + "," + z + "," + w);
|
|
||||||
plugin.saveSpawns();
|
|
||||||
p.sendMessage(ChatColor.AQUA + "You have set the spawn location of Tribute fourteen!");
|
|
||||||
}
|
|
||||||
if(args[0].equalsIgnoreCase("15")){
|
|
||||||
double x = ploc.getX();
|
|
||||||
double y = ploc.getY();
|
|
||||||
double z = ploc.getZ();
|
|
||||||
String w = ploc.getWorld().getName();
|
|
||||||
plugin.spawns.set("Tribute_fifteen_spawn", x + "," + y + "," + z + "," + w);
|
|
||||||
plugin.saveSpawns();
|
|
||||||
p.sendMessage(ChatColor.AQUA + "You have set the spawn location of Tribute fifteen!");
|
|
||||||
}
|
|
||||||
if(args[0].equalsIgnoreCase("16")){
|
|
||||||
double x = ploc.getX();
|
|
||||||
double y = ploc.getY();
|
|
||||||
double z = ploc.getZ();
|
|
||||||
String w = ploc.getWorld().getName();
|
|
||||||
plugin.spawns.set("Tribute_sixteen_spawn", x + "," + y + "," + z + "," + w);
|
|
||||||
plugin.saveSpawns();
|
|
||||||
p.sendMessage(ChatColor.AQUA + "You have set the spawn location of Tribute sixteen!");
|
|
||||||
}
|
|
||||||
if(args[0].equalsIgnoreCase("17")){
|
|
||||||
double x = ploc.getX();
|
|
||||||
double y = ploc.getY();
|
|
||||||
double z = ploc.getZ();
|
|
||||||
String w = ploc.getWorld().getName();
|
|
||||||
plugin.spawns.set("Tribute_seventeen_spawn", x + "," + y + "," + z + "," + w);
|
|
||||||
plugin.saveSpawns();
|
|
||||||
p.sendMessage(ChatColor.AQUA + "You have set the spawn location of Tribute seventeen!");
|
|
||||||
}
|
|
||||||
if(args[0].equalsIgnoreCase("18")){
|
|
||||||
double x = ploc.getX();
|
|
||||||
double y = ploc.getY();
|
|
||||||
double z = ploc.getZ();
|
|
||||||
String w = ploc.getWorld().getName();
|
|
||||||
plugin.spawns.set("Tribute_eighteen_spawn", x + "," + y + "," + z + "," + w);
|
|
||||||
plugin.saveSpawns();
|
|
||||||
p.sendMessage(ChatColor.AQUA + "You have set the spawn location of Tribute eighteen!");
|
|
||||||
}
|
|
||||||
if(args[0].equalsIgnoreCase("19")){
|
|
||||||
double x = ploc.getX();
|
|
||||||
double y = ploc.getY();
|
|
||||||
double z = ploc.getZ();
|
|
||||||
String w = ploc.getWorld().getName();
|
|
||||||
plugin.spawns.set("Tribute_nineteen_spawn", x + "," + y + "," + z + "," + w);
|
|
||||||
plugin.saveSpawns();
|
|
||||||
p.sendMessage(ChatColor.AQUA + "You have set the spawn location of Tribute nineteen!");
|
|
||||||
}
|
|
||||||
if(args[0].equalsIgnoreCase("20")){
|
|
||||||
double x = ploc.getX();
|
|
||||||
double y = ploc.getY();
|
|
||||||
double z = ploc.getZ();
|
|
||||||
String w = ploc.getWorld().getName();
|
|
||||||
plugin.spawns.set("Tribute_twenty_spawn", x + "," + y + "," + z + "," + w);
|
|
||||||
plugin.saveSpawns();
|
|
||||||
p.sendMessage(ChatColor.AQUA + "You have set the spawn location of Tribute twenty!");
|
|
||||||
}
|
|
||||||
if(args[0].equalsIgnoreCase("21")){
|
|
||||||
double x = ploc.getX();
|
|
||||||
double y = ploc.getY();
|
|
||||||
double z = ploc.getZ();
|
|
||||||
String w = ploc.getWorld().getName();
|
|
||||||
plugin.spawns.set("Tribute_twentyone_spawn", x + "," + y + "," + z + "," + w);
|
|
||||||
plugin.saveSpawns();
|
|
||||||
p.sendMessage(ChatColor.AQUA + "You have set the spawn location of Tribute twentyone!");
|
|
||||||
}
|
|
||||||
if(args[0].equalsIgnoreCase("22")){
|
|
||||||
double x = ploc.getX();
|
|
||||||
double y = ploc.getY();
|
|
||||||
double z = ploc.getZ();
|
|
||||||
String w = ploc.getWorld().getName();
|
|
||||||
plugin.spawns.set("Tribute_twentytwo_spawn", x + "," + y + "," + z + "," + w);
|
|
||||||
plugin.saveSpawns();
|
|
||||||
p.sendMessage(ChatColor.AQUA + "You have set the spawn location of Tribute twentytwo!");
|
|
||||||
}
|
|
||||||
if(args[0].equalsIgnoreCase("23")){
|
|
||||||
double x = ploc.getX();
|
|
||||||
double y = ploc.getY();
|
|
||||||
double z = ploc.getZ();
|
|
||||||
String w = ploc.getWorld().getName();
|
|
||||||
plugin.spawns.set("Tribute_twentythree_spawn", x + "," + y + "," + z + "," + w);
|
|
||||||
plugin.saveSpawns();
|
|
||||||
p.sendMessage(ChatColor.AQUA + "You have set the spawn location of Tribute twentythree!");
|
|
||||||
}
|
|
||||||
if(args[0].equalsIgnoreCase("24")){
|
|
||||||
double x = ploc.getX();
|
|
||||||
double y = ploc.getY();
|
|
||||||
double z = ploc.getZ();
|
|
||||||
String w = ploc.getWorld().getName();
|
|
||||||
plugin.spawns.set("Tribute_twentyfour_spawn", x + "," + y + "," + z + "," + w);
|
|
||||||
plugin.saveSpawns();
|
|
||||||
p.sendMessage(ChatColor.AQUA + "You have set the spawn location of Tribute twentyfour!");
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -19,91 +19,124 @@ public class SpectatorListener implements Listener {
|
|||||||
public SpectatorListener(Main m){
|
public SpectatorListener(Main m){
|
||||||
this.plugin = m;
|
this.plugin = m;
|
||||||
}
|
}
|
||||||
|
int i = 0;
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void SpectatorDrops(PlayerDropItemEvent event){
|
public void SpectatorDrops(PlayerDropItemEvent event){
|
||||||
Player p = event.getPlayer();
|
Player p = event.getPlayer();
|
||||||
String pname = p.getName();
|
String pname = p.getName();
|
||||||
if(plugin.Watching.contains(pname)){
|
for(i = 0; i < plugin.Watching.size(); i++){
|
||||||
|
if(plugin.Watching.get(i)!= null){
|
||||||
|
if(plugin.Watching.get(i).contains(pname)){
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
p.sendMessage(ChatColor.RED + "You are spectating, you can't interfere with the game!");
|
p.sendMessage(ChatColor.RED + "You are spectating, you can't interfere with the game!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void SpectatorInteractBlock(PlayerInteractEvent event){
|
public void SpectatorInteractBlock(PlayerInteractEvent event){
|
||||||
Player p = event.getPlayer();
|
Player p = event.getPlayer();
|
||||||
String pname = p.getName();
|
String pname = p.getName();
|
||||||
if(plugin.Watching.contains(pname)){
|
for(i = 0; i < plugin.Watching.size(); i++){
|
||||||
|
if(plugin.Watching.get(i)!= null){
|
||||||
|
if(plugin.Watching.get(i).contains(pname)){
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
p.sendMessage(ChatColor.RED + "You are spectating, you can't interfere with the game!");
|
p.sendMessage(ChatColor.RED + "You are spectating, you can't interfere with the game!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void SpectatorInteractEntity(PlayerInteractEntityEvent event){
|
public void SpectatorInteractEntity(PlayerInteractEntityEvent event){
|
||||||
Player p = event.getPlayer();
|
Player p = event.getPlayer();
|
||||||
String pname = p.getName();
|
String pname = p.getName();
|
||||||
if(plugin.Watching.contains(pname)){
|
for(i = 0; i < plugin.Watching.size(); i++){
|
||||||
|
if(plugin.Watching.get(i)!= null){
|
||||||
|
if(plugin.Watching.get(i).contains(pname)){
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
p.sendMessage(ChatColor.RED + "You are spectating, you can't interfere with the game!");
|
p.sendMessage(ChatColor.RED + "You are spectating, you can't interfere with the game!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void SpectatorItems(PlayerPickupItemEvent event){
|
public void SpectatorItems(PlayerPickupItemEvent event){
|
||||||
Player p = event.getPlayer();
|
Player p = event.getPlayer();
|
||||||
String pname = p.getName();
|
String pname = p.getName();
|
||||||
if(plugin.Watching.contains(pname)){
|
for(i = 0; i < plugin.Watching.size(); i++){
|
||||||
|
if(plugin.Watching.get(i)!= null){
|
||||||
|
if(plugin.Watching.get(i).contains(pname)){
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
p.sendMessage(ChatColor.RED + "You are spectating, you can't interfere with the game!");
|
p.sendMessage(ChatColor.RED + "You are spectating, you can't interfere with the game!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void SpectatorPvP(EntityDamageByEntityEvent event){
|
public void SpectatorPvP(EntityDamageByEntityEvent event){
|
||||||
Entity offense = event.getDamager();
|
Entity offense = event.getDamager();
|
||||||
if(offense instanceof Player){
|
if(offense instanceof Player){
|
||||||
Player Attacker = (Player) event.getDamager();
|
Player Attacker = (Player) event.getDamager();
|
||||||
String attackerName = Attacker.getName();
|
String attackerName = Attacker.getName();
|
||||||
if(plugin.Watching.contains(attackerName)){
|
for(i = 0; i < plugin.Watching.size(); i++){
|
||||||
|
if(plugin.Watching.get(i)!= null){
|
||||||
|
if(plugin.Watching.get(i).contains(attackerName)){
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
Attacker.sendMessage(ChatColor.RED + "You are spectating, you can't interfere with the game!");
|
Attacker.sendMessage(ChatColor.RED + "You are spectating, you can't interfere with the game!");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}else if(event.getDamager() instanceof Projectile){
|
}else if(event.getDamager() instanceof Projectile){
|
||||||
Projectile arrow = (Projectile) offense;
|
Projectile arrow = (Projectile) offense;
|
||||||
if(arrow.getShooter() instanceof Player){
|
if(arrow.getShooter() instanceof Player){
|
||||||
Player BowMan = (Player) arrow.getShooter();
|
Player BowMan = (Player) arrow.getShooter();
|
||||||
String bowManName = BowMan.getName();
|
String bowManName = BowMan.getName();
|
||||||
if(plugin.Watching.contains(bowManName)){
|
for(i = 0; i < plugin.Watching.size(); i++){
|
||||||
|
if(plugin.Watching.get(i)!= null){
|
||||||
|
if(plugin.Watching.get(i).contains(bowManName)){
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
BowMan.sendMessage(ChatColor.RED + "You are spectating, you can't interfere with the game!");
|
BowMan.sendMessage(ChatColor.RED + "You are spectating, you can't interfere with the game!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void SpectatorBlockBreak(BlockBreakEvent event){
|
public void SpectatorBlockBreak(BlockBreakEvent event){
|
||||||
Player p = event.getPlayer();
|
Player p = event.getPlayer();
|
||||||
String pname = p.getName();
|
String pname = p.getName();
|
||||||
if(plugin.Watching.contains(pname)){
|
for(i = 0; i < plugin.Watching.size(); i++){
|
||||||
|
if(plugin.Watching.get(i)!= null){
|
||||||
|
if(plugin.Watching.get(i).contains(pname)){
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
p.sendMessage(ChatColor.RED + "You are spectating, you can't interfere with the game!");
|
p.sendMessage(ChatColor.RED + "You are spectating, you can't interfere with the game!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void SpectatorBlockPlace(BlockPlaceEvent event){
|
public void SpectatorBlockPlace(BlockPlaceEvent event){
|
||||||
Player p = event.getPlayer();
|
Player p = event.getPlayer();
|
||||||
String pname = p.getName();
|
String pname = p.getName();
|
||||||
if(plugin.Watching.contains(pname)){
|
for(i = 0; i < plugin.Watching.size(); i++){
|
||||||
|
if(plugin.Watching.get(i)!= null){
|
||||||
|
if(plugin.Watching.get(i).contains(pname)){
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
p.sendMessage(ChatColor.RED + "You are spectating, you can't interfere with the game!");
|
p.sendMessage(ChatColor.RED + "You are spectating, you can't interfere with the game!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void SpectatorQuit(PlayerQuitEvent event){
|
public void SpectatorQuit(PlayerQuitEvent event){
|
||||||
Player p = event.getPlayer();
|
Player p = event.getPlayer();
|
||||||
String pname = p.getName();
|
String pname = p.getName();
|
||||||
if(plugin.Watching.contains(pname)){
|
for(i = 0; i < plugin.Watching.size(); i++){
|
||||||
plugin.Watching.remove(pname);
|
if(plugin.Watching.get(i)!= null){
|
||||||
|
if(plugin.Watching.get(i).contains(pname)){
|
||||||
|
plugin.Watching.get(i).remove(pname);
|
||||||
String[] Spawncoords = plugin.spawns.getString("Spawn_coords").split(",");
|
String[] Spawncoords = plugin.spawns.getString("Spawn_coords").split(",");
|
||||||
String w = Spawncoords[3];
|
String w = Spawncoords[3];
|
||||||
World spawnw = plugin.getServer().getWorld(w);
|
World spawnw = plugin.getServer().getWorld(w);
|
||||||
@ -114,6 +147,8 @@ public class SpectatorListener implements Listener {
|
|||||||
p.teleport(Spawn);
|
p.teleport(Spawn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void MobNerf(EntityTargetEvent event){
|
public void MobNerf(EntityTargetEvent event){
|
||||||
@ -124,9 +159,13 @@ public class SpectatorListener implements Listener {
|
|||||||
}
|
}
|
||||||
if(target instanceof Player){
|
if(target instanceof Player){
|
||||||
String targetName = ((Player) target).getName();
|
String targetName = ((Player) target).getName();
|
||||||
if(plugin.Watching.contains(targetName)){
|
for(i = 0; i < plugin.Watching.size(); i++){
|
||||||
|
if(plugin.Watching.get(i)!= null){
|
||||||
|
if(plugin.Watching.get(i).contains(targetName)){
|
||||||
event.setTarget(null);
|
event.setTarget(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -22,9 +22,8 @@ public class SponsorCommands implements CommandExecutor {
|
|||||||
int i = 0;
|
int i = 0;
|
||||||
Player p = (Player) sender;
|
Player p = (Player) sender;
|
||||||
String pname = p.getName();
|
String pname = p.getName();
|
||||||
String epname = p.getName();
|
|
||||||
if(p.hasPermission("HungerArena.Sponsor")){
|
if(p.hasPermission("HungerArena.Sponsor")){
|
||||||
if(!plugin.Playing.contains(epname)){
|
if(plugin.getArena(p)== null){
|
||||||
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!");
|
||||||
return false;
|
return false;
|
||||||
@ -37,7 +36,7 @@ public class SponsorCommands implements CommandExecutor {
|
|||||||
}
|
}
|
||||||
if(args.length== 3){
|
if(args.length== 3){
|
||||||
Player target = Bukkit.getServer().getPlayer(args[0]);
|
Player target = Bukkit.getServer().getPlayer(args[0]);
|
||||||
if(!plugin.Playing.contains(target.getName())){
|
if(plugin.getArena(target)== null){
|
||||||
p.sendMessage(ChatColor.RED + "That person isn't playing!");
|
p.sendMessage(ChatColor.RED + "That person isn't playing!");
|
||||||
}else{
|
}else{
|
||||||
try{
|
try{
|
||||||
@ -70,10 +69,34 @@ public class SponsorCommands implements CommandExecutor {
|
|||||||
if(args[0].equalsIgnoreCase(pname)){
|
if(args[0].equalsIgnoreCase(pname)){
|
||||||
p.sendMessage(ChatColor.RED + "You can't sponsor yourself!");
|
p.sendMessage(ChatColor.RED + "You can't sponsor yourself!");
|
||||||
}else if(!(plugin.econ.getBalance(pname) < plugin.config.getDouble("sponsorEco.cost"))){
|
}else if(!(plugin.econ.getBalance(pname) < plugin.config.getDouble("sponsorEco.cost"))){
|
||||||
|
if(!plugin.Cost.isEmpty()){
|
||||||
|
for(ItemStack Costs: plugin.Cost){
|
||||||
|
if(p.getInventory().contains(Costs)){
|
||||||
|
i = i+1;
|
||||||
|
if(plugin.Cost.size()== i){
|
||||||
|
if(args[0].equalsIgnoreCase(pname)){
|
||||||
|
p.sendMessage(ChatColor.RED + "You can't sponsor yourself!");
|
||||||
|
}else{
|
||||||
target.sendMessage(ChatColor.AQUA + "You have been Sponsored!");
|
target.sendMessage(ChatColor.AQUA + "You have been Sponsored!");
|
||||||
target.getInventory().addItem(sponsoritem);
|
target.getInventory().addItem(sponsoritem);
|
||||||
p.sendMessage("You have sponsored " + target.getName() + "!");
|
p.sendMessage("You have sponsored " + target.getName() + "!");
|
||||||
plugin.econ.withdrawPlayer(pname, plugin.config.getDouble("sponsorEco.cost"));
|
plugin.econ.withdrawPlayer(pname, plugin.config.getDouble("sponsorEco.cost"));
|
||||||
|
for(ItemStack aCosts: plugin.Cost){
|
||||||
|
p.getInventory().removeItem(aCosts);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(plugin.Cost.size() > i){
|
||||||
|
p.sendMessage(ChatColor.RED + "You don't have the necessary items to sponsor!");
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
target.sendMessage(ChatColor.AQUA + "You have been Sponsored!");
|
||||||
|
target.getInventory().addItem(sponsoritem);
|
||||||
|
p.sendMessage("You have sponsored " + target.getName() + "!");
|
||||||
|
plugin.econ.withdrawPlayer(pname, plugin.config.getDouble("sponsorEco.cost"));
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
p.sendMessage(ChatColor.RED + "You don't have enough money to do that!");
|
p.sendMessage(ChatColor.RED + "You don't have enough money to do that!");
|
||||||
}
|
}
|
||||||
@ -114,7 +137,7 @@ public class SponsorCommands implements CommandExecutor {
|
|||||||
try{
|
try{
|
||||||
if((!plugin.management.getStringList("sponsors.blacklist").isEmpty() && !plugin.management.getStringList("sponsors.blacklist").contains(ID)) || plugin.management.getStringList("sponsors.blacklist").isEmpty()){
|
if((!plugin.management.getStringList("sponsors.blacklist").isEmpty() && !plugin.management.getStringList("sponsors.blacklist").contains(ID)) || plugin.management.getStringList("sponsors.blacklist").isEmpty()){
|
||||||
ItemStack sponsoritem = new ItemStack(ID, Amount);
|
ItemStack sponsoritem = new ItemStack(ID, Amount);
|
||||||
if(!plugin.Playing.contains(target.getName())){
|
if(plugin.getArena(target)== null){
|
||||||
sender.sendMessage(ChatColor.RED + "That person isn't playing!");
|
sender.sendMessage(ChatColor.RED + "That person isn't playing!");
|
||||||
}else{
|
}else{
|
||||||
sender.sendMessage(ChatColor.RED + "You can't sponsor yourself!");
|
sender.sendMessage(ChatColor.RED + "You can't sponsor yourself!");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user