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

@ -3,5 +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:/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/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"/> <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.

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

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

@ -184,6 +184,9 @@ public class Main extends JavaPlugin{
p.getInventory().setHelmet(null); p.getInventory().setHelmet(null);
p.getInventory().setLeggings(null); p.getInventory().setLeggings(null);
getServer().broadcastMessage(ChatColor.AQUA + pname + " has Joined the Game!"); getServer().broadcastMessage(ChatColor.AQUA + pname + " has Joined the Game!");
if(Playing.size()== 24){
p.performCommand("ha warpall");
}
} }
} }
if(args[0].equalsIgnoreCase("Ready")){ if(args[0].equalsIgnoreCase("Ready")){
@ -1184,33 +1187,33 @@ class DeathListener implements Listener{
public void run(){ public void run(){
if(plugin.Playing.contains(p) && plugin.Out.contains(p)){ if(plugin.Playing.contains(p) && plugin.Out.contains(p)){
if(plugin.canjoin== true){ if(plugin.canjoin== true){
plugin.Playing.remove(p); plugin.Playing.remove(p);
plugin.Quit.add(p); plugin.Quit.add(p);
plugin.Out.remove(p); plugin.Out.remove(p);
if(plugin.Playing.size()== 1){ if(plugin.Playing.size()== 1){
for(Player winner:plugin.Playing){ for(Player winner:plugin.Playing){
String winnername = winner.getName(); String winnername = winner.getName();
p.getServer().broadcastMessage(ChatColor.GREEN + winnername + " is the victor of this Hunger Games!"); p.getServer().broadcastMessage(ChatColor.GREEN + winnername + " is the victor of this Hunger Games!");
winner.getInventory().clear(); winner.getInventory().clear();
winner.getInventory().setBoots(null); winner.getInventory().setBoots(null);
winner.getInventory().setChestplate(null); winner.getInventory().setChestplate(null);
winner.getInventory().setHelmet(null); winner.getInventory().setHelmet(null);
winner.getInventory().setLeggings(null); winner.getInventory().setLeggings(null);
winner.getInventory().addItem(plugin.Reward); winner.getInventory().addItem(plugin.Reward);
}
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){ }else if(plugin.canjoin== false){
plugin.Playing.remove(p); plugin.Playing.remove(p);
plugin.Quit.add(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);
}
}
}
} }