Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- So we need to declare the Array:
- public static ArrayList friendList = new ArrayList();
- So, let’s make a few methods, to add/remove the friends from the Array:
- public static void addFriend(String name){ if(!friendList.contains(name)){
- friendList.add(name);
- }
- }
- public static void remFriend(String name){
- if(friendList.contains(name)){ friendList.remove(friendList.indexOf(name));
- }
- }
- To call this, (in GuiChat or whatever):
- If(s.startsWith(“.friend add”)){
- String split[] = s.split(“ ”);
- String name = split[2];
- If(name != null){
- Vars.addFriend(name);
- mc.thePlayer.addChatMessage(“\2475[PUR] - \247ePlayer ”+name+” added as a friendly.”);
- }
- }
- do the same for remove, but change the add to rem.
- Okay? Simple!:)
Add Comment
Please, Sign In to add comment