Clans

Discussion in 'Plugin Development' started by DamnHippo, May 27, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    DamnHippo

    I'm planning on making a clans plugin, I don't know what methods to use and I'm not asking for the exact code
    I don't know anything about making clans, inviting player to clan, kick from clan and a clan msg that will send everyone in the clan the message. Where would I go about? Any tutorials?
     
  2. Offline

    fireblast709

  3. Offline

    Rocoty

    I like your attitude about not wanting exact code. Please keep it. It will get you far. Learning by doing is way more helpful than getting code written for you :)

    As for your question. You should try writing out a draft or something to try for yourself. If you find yourself unable to do that, you might not have the required Java knowledge to code Bukkit Plugins. I would strongly advise you to have a decent knowledge of Java before plunging into Bukkit.

    Please tell me if my assumption was correct.
     
  4. Offline

    1Achmed1

    If you want config help, use this for ideas:
    Code:
    clans:
      clan1:
        members:
          {$uuid}:
            displayName: 1Achmed1
            prefix: TehBeest
          {$uuid}:
            displayName: DamnHippo
            prefix: TehSupahBeest
        message:
          This is an example clan.
        owner:
          {$uuid}
      clan2:
        members:
          EvilSeph
          Notch
        message:
          So op.
    owner: EvilSeph

    So, you could save people with uuids and have the displayName automatically change if they change their username, and they could also have a prefix like Factions. Alternatively, you could save with usernames, but it's less secure.
     
  5. Offline

    DamnHippo

    1Achmed1 Rocoty the main part I don't get is creating the clan wouldn't I have to add them to a hashmap? How would I make it that when someone creates a clan it creates a new hashmap?
     
  6. Offline

    1Achmed1

  7. Offline

    DamnHippo

  8. Offline

    Garris0n

    ...create a "Clan" class.
     
  9. Garris0n
    Well that's rather broad. If the man doesn't know which methods to use how would he make a clan class.
     
  10. Offline

    Garris0n

    If "the man" doesn't know how to use Java then maybe he should go learn that first?
     
  11. Garris0n
    Yeah I know but throwing a suggestion to create a new class to a person who doesn't create methods is rather inappropriate. I've learnt my way through Tutorials, Source Codes and Videos so those videos will help him out if he's smart enough.
     
  12. Offline

    Garris0n

    It's "inappropriate" that somebody who can't create a class is using the Bukkit API.

    If he doesn't know Java, he should go learn Java. Simple as that. Copying somebody else's code word-for-word is not going to help and will probably end up teaching him some bad habits.
     
  13. Garris0n
    Why do you have to be so mad though? If people want to learn poorly let them, what's it with you? It's like some of you guys in the forums belong to a Java-Grammar-Nazi group. If everyone in these forums knew Java it wouldn't be necessary to help any of them (not like people don't need a little light shed upon them sometimes, but you know what I mean).
     
  14. Offline

    Garris0n

    If I saw somebody burning to death in a house I could drag them out or I could sit there with some popcorn and watch. I'd rather drag them out of the house.
    This is the Bukkit forums, not the Java forums. There are better places for Java questions, like StackOverflow, and most of these questions have been answered.
    If people ask Bukkit questions they can be given answers. This is more of a "please give me free code" post. If the OP does not understand what "create a class" means they are obviously not experienced enough with Java to be working with the Bukkit API. Bukkit is an API, not a language. Java is a prerequisite, and if you don't know it, attempting to use Bukkit is like attempting to run before you are able to walk. It does not work out well. I have personal experience with not learning Java first, and I would never recommend that to anyone.
     
  15. Offline

    Onlineids

    Psuedo code from gangs plugin:
    Code:java
    1. public class Gang
    2. {
    3. private int power;
    4. private List<String> players = new ArrayList();
    5. private String name;
    6. private List<String> invites = new ArrayList();
    7.  
    8. public Gang(int power, List<String> players, String name, List<String> invites) {
    9. this.power = power;
    10. this.players = players;
    11. this.name = name;
    12. this.invites = invites;
    13. }
    14.  
    15. public String getName() {
    16. return this.name;
    17. }
    18. public int getPower() {
    19. return this.power;
    20. }
    21. public List<String> getPlayers() {
    22. return this.players;
    23. }
    24. public List<String> getInvites() {
    25. return this.invites;
    26. }
    27.  
    28. public void setName(String name) {
    29. this.name = name;
    30. }
    31. public void setPower(int power) {
    32. this.power = power;
    33. }
    34. public void setPlayers(List<String> players) {
    35. this.players = players;
    36. }
    37. public void addPlayer(String playerName) {
    38. this.players.add(playerName);
    39. }
    40. public boolean removePlayer(String playerName) {
    41. if (this.players.contains(playerName)) {
    42. this.players.remove(playerName);
    43. return true;
    44. }
    45. return false;
    46. }
    47. public void setInvites(List<String> invites) {
    48. this.invites = invites;
    49. }
    50. public void addInvite(String player) {
    51. this.invites.add(player);
    52. }
    53. public boolean removeInvite(String playerName) {
    54. if (this.invites.contains(playerName)) {
    55. this.invites.remove(playerName);
    56. return true;
    57. }
    58. return false;
    59. }
    60. }
     
  16. Offline

    Iroh

    Removed offtopic conversation.
     
Thread Status:
Not open for further replies.

Share This Page