Development Assistance Quicksell boosters

Discussion in 'Plugin Help/Development/Requests' started by UniqueNameDen, Feb 20, 2015.

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

    UniqueNameDen

    Hey, so I'm making infinite multiplier per rankup for Quicksell, but I don't really understand the API of Quicksell boosters, help...?

    Currently I got:
    Code:
    public Multipliers(double multiplier, boolean silent, boolean infinite) {
        super(multiplier, silent, infinite);
        silent = true;
        infinite = true;
    }
    
    //I'm stuck with this, if I can get this part sorted I can do everything else my self
    @Override
    public List<String> getAppliedPlayers() {
        return Arrays.asList(new String[] { this.owner });
    }
    
    EDIT: don't worry that's not against the EULA.

    @mrCookieSlime
     
  2. Offline

    mrCookieSlime

    @UniqueNameDen
    make your super pass two true values instead of two variables, will look nicer and it's going to be more efficient.

    super(multiplier, true, true);

    After all you are anyway setting it to true.

    And the method getAppliedPlayers() returns a List of Names of Players who the Booster is applied to.
    So for example if your Booster should be applied to all Players in your A group, make it return a List of all Names of Players who are in the A group.
     
  3. Offline

    UniqueNameDen

    Code:
    public Multipliers(double multiplier, boolean silent, boolean infinite) {
        super(multiplier, true, true);
    }
    @Override
    public List<String> getAppliedPlayers() {
        return Arrays.asList();
    }
    
    so I understand that, but I don't understand the rest... can I get an example of using it...?

    EDIT: also why don't you jsut add it to the plugin..? you know players can do /pbooster <player> 3 9999999999

    @mrCookieSlime
     
    Last edited: Feb 20, 2015
  4. Offline

    mrCookieSlime

    @UniqueNameDen
    ... Instead of saying "I dont understand it".
    Itd be at least helpful to say what you don't understand.

    And I am not going to discuss with you why Im not going to add it now.
     
  5. Offline

    UniqueNameDen

    Okay so:
    Code:
    @Override
    public List<String> getAppliedPlayers() 
         return Arrays.asList();
    }
    
    So this returns a list of players with that booster, what should I do with it now...?

    I can't just

    Code:
    for(Player p : getApplidedPlayers()) {
        if(p.hasPermission("dmc.rank.B")) {
           this.activate();
        }
    }
     
  6. Offline

    mrCookieSlime

    @UniqueNameDen
    ...
    No, this List returns a List of Players with that Booster, correct.
    But I don't think you are getting how to override methods in Java.
    See you need to return the list of Players who the booster applies to, the activating part is done automaticallly.
     
Thread Status:
Not open for further replies.

Share This Page