Still struggling with chests!

This commit is contained in:
Travis Eggett 2012-05-25 23:48:56 -06:00
parent ffd94172db
commit 42825243ea
20 changed files with 33 additions and 39 deletions

View File

@ -3,5 +3,6 @@
<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="lib" path="C:/Documents and Settings/TJ/Desktop/bukkit-1.2.5-R0.1-20120330.213519-1.jar"/>
<classpathentry kind="lib" path="C:/Documents and Settings/TJ/Desktop/iConomy.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>

Binary file not shown.

View File

@ -1,6 +1,7 @@
# default config.yml
Start_Message: '&bLet The Games Begin!'
Auto_Restart: 'false'
iConomy_Support: 'false'
Reward:
ID: 264
Amount: 10

View File

@ -1,6 +1,6 @@
name: HungerArena
main: me.Travja.HungerArena.Main
version: 1.2.2.2
version: 1.3alpha
description: A plugin to help with playing The Hunger Games!
commands:
Ha:

View File

@ -184,6 +184,9 @@ public class Main extends JavaPlugin{
p.getInventory().setHelmet(null);
p.getInventory().setLeggings(null);
getServer().broadcastMessage(ChatColor.AQUA + pname + " has Joined the Game!");
if(Playing.size()== 24){
p.performCommand("ha warpall");
}
}
}
if(args[0].equalsIgnoreCase("Ready")){
@ -1173,7 +1176,7 @@ class DeathListener implements Listener{
final Location Spawn = new Location(spawnw, spawnx, spawny, spawnz);
if(plugin.Playing.contains(p)){
if(plugin.Playing.size()== 1){
}
plugin.Out.add(p);
}
@ -1184,33 +1187,33 @@ class DeathListener implements Listener{
public void run(){
if(plugin.Playing.contains(p) && plugin.Out.contains(p)){
if(plugin.canjoin== true){
plugin.Playing.remove(p);
plugin.Quit.add(p);
plugin.Out.remove(p);
if(plugin.Playing.size()== 1){
for(Player winner:plugin.Playing){
String winnername = winner.getName();
p.getServer().broadcastMessage(ChatColor.GREEN + winnername + " is the victor of this Hunger Games!");
winner.getInventory().clear();
winner.getInventory().setBoots(null);
winner.getInventory().setChestplate(null);
winner.getInventory().setHelmet(null);
winner.getInventory().setLeggings(null);
winner.getInventory().addItem(plugin.Reward);
plugin.Playing.remove(p);
plugin.Quit.add(p);
plugin.Out.remove(p);
if(plugin.Playing.size()== 1){
for(Player winner:plugin.Playing){
String winnername = winner.getName();
p.getServer().broadcastMessage(ChatColor.GREEN + winnername + " is the victor of this Hunger Games!");
winner.getInventory().clear();
winner.getInventory().setBoots(null);
winner.getInventory().setChestplate(null);
winner.getInventory().setHelmet(null);
winner.getInventory().setLeggings(null);
winner.getInventory().addItem(plugin.Reward);
}
for(Player spectator:plugin.Watching){
spectator.setAllowFlight(false);
spectator.teleport(Spawn);
}
if(plugin.config.getString("Auto_Restart").equalsIgnoreCase("True")){
plugin.Dead.clear();
plugin.Playing.clear();
plugin.Quit.clear();
plugin.Watching.clear();
plugin.Frozen.clear();
plugin.canjoin = false;
}
}
for(Player spectator:plugin.Watching){
spectator.setAllowFlight(false);
spectator.teleport(Spawn);
}
if(plugin.config.getString("Auto_Restart").equalsIgnoreCase("True")){
plugin.Dead.clear();
plugin.Playing.clear();
plugin.Quit.clear();
plugin.Watching.clear();
plugin.Frozen.clear();
plugin.canjoin = false;
}
}
}else if(plugin.canjoin== false){
plugin.Playing.remove(p);
plugin.Quit.add(p);
@ -1349,15 +1352,4 @@ class DeathListener implements Listener{
}
}
}
@EventHandler
public void SpectatorJoining(PlayerJoinEvent event){
Player spectator = event.getPlayer();
if(plugin.Watching.contains(spectator)){
spectator.setAllowFlight(true);
spectator.setFlying(true);
for(Player everyone:plugin.getServer().getOnlinePlayers()){
everyone.hidePlayer(spectator);
}
}
}
}