Improving my little plugin.

Discussion in 'Plugin Development' started by crysis992, Sep 13, 2012.

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

    crysis992

    Hey guys,

    I made a little plugin for my servers parcour arena, i dont want my players to walk back all the time.
    Got any ideas to "improve" the code? (Im still a beginner in Java)
    Plugin is working so far, no problem but im sure the code can be "improved"

    GameListener.java - http://pastebin.com/D0zdycMD
    core.java - http://pastebin.com/xpjUbDJi
     
  2. Offline

    sd5

    That:
    Code:java
    1. public void clearInv(Player p) {
    2. for(int j=0; j<38; j++) {
    3. p.getInventory().setItem(j, null); }
    4. p.getInventory().setHelmet(null);
    5. p.getInventory().setChestplate(null);
    6. p.getInventory().setLeggings(null);
    7. p.getInventory().setBoots(null);
    8. }
    9. }


    You can remove the whole method just do:
    Code:java
    1. player.getInventory().clear();
     
  3. Offline

    andf54

    @crysis992 You can make the game end when the player gets damaged by a certain amount.

    You will also need to add config, because world,530, 64, 805 will have to be changed at some point.

    A way to start the game would also be nice. Instead of forcing all players to play.
     
Thread Status:
Not open for further replies.

Share This Page