1
0
mirror of https://github.com/mcMMO-Dev/mcMMO.git synced 2026-02-21 03:03:02 +01:00

Changes to the party system

This commit is contained in:
nossr50
2011-01-10 12:08:07 -08:00
parent 03f73a0353
commit 25e9d7afcf
2 changed files with 44 additions and 12 deletions

View File

@@ -1,5 +1,6 @@
import java.io.*;
import java.lang.String;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;
public class vmc {
@@ -41,6 +42,37 @@ String location = "groups.txt";
}
}
}
public String[] getPartyMembers(Player player){
int x = 0;
String partyarray[] = null;
ArrayList<String> partymembers = new ArrayList<String>();
for(Player p : etc.getServer().getPlayerList()){
if(vmc.inSameParty(player, p) && p != null){
partymembers.add(p.getName());
x++;
}
}
partymembers.toArray(partyarray);
return partyarray;
}
public static void informPartyMembers(Player player){
int x = 0;
for(Player p : etc.getServer().getPlayerList()){
if(vmc.inSameParty(player, p) && !p.getName().equals(player.getName())){
p.sendMessage(vUsers.getProfile(player).getTag() + player.getName() + Colors.Green + " has joined your party");
x++;
}
}
}
public static void informPartyMembersQuit(Player player){
int x = 0;
for(Player p : etc.getServer().getPlayerList()){
if(vmc.inSameParty(player, p) && !p.getName().equals(player.getName())){
p.sendMessage(vUsers.getProfile(player).getTag() + player.getName() + Colors.Green + " has left your party");
x++;
}
}
}
public String getGroupPrefix(Player player){
String groups[] = player.getGroups();
String groupline[] = null;
@@ -56,12 +88,13 @@ String location = "groups.txt";
}
//Grab the line with the same group as the player
for(String herp : groups){
if(herp != null)
x++;
}
if(x > 0)
if(x != 0)
groupline = properties.getString(groups[0]).split(":");
//Check if the prefix is null or not
if(!groupline[0].isEmpty())
if(!groupline[0].isEmpty() && groupline != null)
{
//vChat.colorChange(groupline[0].charAt(0));
prefix = groupline[0];