Some bug fixes
This commit is contained in:
parent
77cfa3ef19
commit
4ea9ea0447
@ -3,6 +3,5 @@
|
||||
<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/MC Servers/Survival 1.2/craftbukkit-1.2.5-R1.0.jar"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</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.
@ -61,6 +61,15 @@ public class Main extends JavaPlugin{
|
||||
getServer().getPluginManager().registerEvents(new DeathListener(this), this);
|
||||
Reward = new ItemStack(config.getInt("Reward.ID"), config.getInt("Reward.Amount"));
|
||||
Cost = new ItemStack(config.getInt("Sponsor_Cost.ID"), config.getInt("Sponsor_Cost.Amount"));
|
||||
if(!config.contains("Auto_Restart")){
|
||||
config.addDefault("Auto_Restart", "false");
|
||||
this.saveConfig();
|
||||
}
|
||||
if(!config.contains("Start_Message")){
|
||||
config.addDefault("Start_Message", "&bLet The Games Begin!");
|
||||
this.saveConfig();
|
||||
System.out.println("Saved Start_Message");
|
||||
}
|
||||
}
|
||||
public void onDisable(){
|
||||
log = this.getLogger();
|
||||
@ -170,7 +179,8 @@ public class Main extends JavaPlugin{
|
||||
p.sendMessage(ChatColor.RED + "You don't have permission!");
|
||||
}
|
||||
}
|
||||
if(args[0].equalsIgnoreCase("Confirm") && NeedConfirm.contains(p)){
|
||||
if(args[0].equalsIgnoreCase("Confirm")){
|
||||
if(NeedConfirm.contains(p)){
|
||||
Playing.add(p);
|
||||
NeedConfirm.remove(p);
|
||||
p.getInventory().clear();
|
||||
@ -180,6 +190,7 @@ public class Main extends JavaPlugin{
|
||||
p.getInventory().setLeggings(null);
|
||||
getServer().broadcastMessage(ChatColor.AQUA + pname + " has Joined the Game!");
|
||||
}
|
||||
}
|
||||
if(args[0].equalsIgnoreCase("Ready")){
|
||||
if(Playing.contains(p)){
|
||||
Ready.add(p);
|
||||
@ -1152,16 +1163,19 @@ class DeathListener implements Listener{
|
||||
@EventHandler
|
||||
public void onPlayerQuit(PlayerQuitEvent event){
|
||||
final Player p = event.getPlayer();
|
||||
if(plugin.Playing.contains(p) && plugin.canjoin== true){
|
||||
plugin.Out.add(p);
|
||||
}
|
||||
if(plugin.Playing.contains(p) && plugin.canjoin== false){
|
||||
plugin.Out.add(p);
|
||||
plugin.Playing.remove(p);
|
||||
String[] Spawncoords = plugin.config.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);
|
||||
if(plugin.Watching.contains(p)){
|
||||
System.out.println(p.getName() + " testing");
|
||||
}
|
||||
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable(){
|
||||
public void run(){
|
||||
if(plugin.Playing.contains(p) && plugin.canjoin== true && plugin.Out.contains(p)){
|
||||
if(plugin.Playing.contains(p) && plugin.Out.contains(p) && plugin.canjoin== false){
|
||||
plugin.Playing.remove(p);
|
||||
plugin.Quit.add(p);
|
||||
plugin.Out.remove(p);
|
||||
@ -1178,6 +1192,7 @@ class DeathListener implements Listener{
|
||||
}
|
||||
for(Player spectator:plugin.Watching){
|
||||
spectator.setAllowFlight(false);
|
||||
spectator.teleport(Spawn);
|
||||
}
|
||||
if(plugin.config.getString("Auto_Restart").equalsIgnoreCase("True")){
|
||||
plugin.Dead.clear();
|
||||
@ -1207,24 +1222,33 @@ class DeathListener implements Listener{
|
||||
}
|
||||
}
|
||||
@EventHandler
|
||||
public void Chat(PlayerChatEvent event){
|
||||
public void TributeChat(PlayerChatEvent event){
|
||||
Player p = event.getPlayer();
|
||||
if(plugin.Playing.contains(p)){
|
||||
String msg = "<" + ChatColor.RED + "[Tribute] " + ChatColor.WHITE + p.getName() + ">" + " " + event.getMessage();
|
||||
if(plugin.config.getString("ChatClose").equalsIgnoreCase("True")){
|
||||
double radius = plugin.config.getDouble("ChatClose_Radius");
|
||||
List<Entity> near = p.getNearbyEntities(radius, radius, radius);
|
||||
event.setCancelled(true);
|
||||
if(near.size()== 0){
|
||||
p.sendMessage(msg);
|
||||
p.sendMessage(ChatColor.YELLOW + "No one near!");
|
||||
}else if(!(near.size()== 0)){
|
||||
for(Entity en:near){
|
||||
if(!(en instanceof Player)){
|
||||
p.sendMessage(msg);
|
||||
p.sendMessage(ChatColor.YELLOW + "No one near!");
|
||||
}
|
||||
}
|
||||
}else{
|
||||
for(Entity e:near){
|
||||
if(e instanceof Player){
|
||||
((Player) e).sendMessage(msg);
|
||||
}else if(e instanceof Entity || !(e instanceof Player)){
|
||||
p.sendMessage("Why are you talking to an animal?");
|
||||
}else if(near.size()== 0){
|
||||
p.sendMessage("No one is near");
|
||||
}
|
||||
}
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}else{
|
||||
plugin.getServer().broadcastMessage(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1255,7 +1279,7 @@ class DeathListener implements Listener{
|
||||
}
|
||||
}
|
||||
@EventHandler
|
||||
public void Drops(PlayerDropItemEvent event){
|
||||
public void SpectatorDrops(PlayerDropItemEvent event){
|
||||
Player p = event.getPlayer();
|
||||
if(plugin.Watching.contains(p)){
|
||||
event.setCancelled(true);
|
||||
@ -1263,7 +1287,7 @@ class DeathListener implements Listener{
|
||||
}
|
||||
}
|
||||
@EventHandler
|
||||
public void Interactions(PlayerInteractEvent event){
|
||||
public void SpectatorInteractions(PlayerInteractEvent event){
|
||||
Player p = event.getPlayer();
|
||||
if(plugin.Watching.contains(p)){
|
||||
event.setCancelled(true);
|
||||
@ -1284,8 +1308,8 @@ class DeathListener implements Listener{
|
||||
Player p = event.getPlayer();
|
||||
//currently crashes the server when refilling....
|
||||
//Kinda glitchy through all here...
|
||||
if(block.getState() instanceof Chest && p.getItemInHand().getType()== Material.BLAZE_ROD && event.getAction() == Action.LEFT_CLICK_BLOCK){
|
||||
|
||||
if(p.getItemInHand().getType()== Material.BLAZE_ROD && event.getAction() == Action.LEFT_CLICK_BLOCK){
|
||||
if(block.getState() instanceof Chest){
|
||||
ItemStack[] itemsinchest = ((Chest) block.getState()).getInventory().getContents();
|
||||
int blockx = block.getX();
|
||||
int blocky = block.getY();
|
||||
@ -1311,4 +1335,16 @@ class DeathListener implements Listener{
|
||||
plugin.saveConfig();
|
||||
}
|
||||
}
|
||||
}
|
||||
@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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user