Search in sources :

Example 6 with PartyPlayer

use of com.alessiodp.partiesapi.objects.PartyPlayer in project Parties by AlessioDP.

the class ApiHandler method setSpy.

@Deprecated
@Override
public void setSpy(UUID paramUUID, boolean paramSpy) {
    PartyPlayer pp = getPartyPlayer(paramUUID);
    pp.setSpy(paramSpy);
    updatePartyPlayer(pp);
}
Also used : PartyPlayer(com.alessiodp.partiesapi.objects.PartyPlayer)

Example 7 with PartyPlayer

use of com.alessiodp.partiesapi.objects.PartyPlayer in project Parties by AlessioDP.

the class ApiHandler method addPlayerIntoParty.

@Deprecated
@Override
public Status addPlayerIntoParty(UUID paramUUID, String paramParty) {
    Party party = plugin.getPartyManager().getParty(paramParty);
    PartyPlayer player = plugin.getPlayerManager().getPlayer(paramUUID);
    return addPlayerIntoParty(player, party);
}
Also used : Party(com.alessiodp.partiesapi.objects.Party) PartyPlayer(com.alessiodp.partiesapi.objects.PartyPlayer)

Example 8 with PartyPlayer

use of com.alessiodp.partiesapi.objects.PartyPlayer in project Parties by AlessioDP.

the class ApiHandler method setRank.

@Deprecated
@Override
public void setRank(UUID paramUUID, int paramRank) {
    PartyPlayer pp = getPartyPlayer(paramUUID);
    pp.setRank(paramRank);
    updatePartyPlayer(pp);
}
Also used : PartyPlayer(com.alessiodp.partiesapi.objects.PartyPlayer)

Example 9 with PartyPlayer

use of com.alessiodp.partiesapi.objects.PartyPlayer in project Parties by AlessioDP.

the class ApiHandler method createParty.

@Override
public Status createParty(PartyPlayer paramPartyPlayer, String paramPartyName) {
    Status ret = Status.ALREADYINPARTY;
    // Get an instance of PartyPlayerEntity, used to save same player
    PartyPlayerEntity player = null;
    if (paramPartyPlayer instanceof PartyPlayerEntity) {
        player = (PartyPlayerEntity) paramPartyPlayer;
    } else {
        player = (PartyPlayerEntity) getPartyPlayer(paramPartyPlayer.getPlayerUUID());
    }
    if (player.getPartyName().isEmpty()) {
        if (!plugin.getPartyManager().existParty(paramPartyName)) {
            PartyEntity party = new PartyEntity(paramPartyName, plugin);
            party.getMembers().add(player.getPlayerUUID());
            Player p = player.getPlayer();
            if (p != null)
                party.getOnlinePlayers().add(p);
            party.setLeader(player.getPlayerUUID());
            plugin.getPartyManager().getListParties().put(party.getName().toLowerCase(), party);
            player.setRank(ConfigParties.RANK_SET_HIGHER);
            player.setPartyName(party.getName());
            party.updateParty();
            player.updatePlayer();
            party.callChange();
            return Status.SUCCESS;
        } else
            ret = Status.ALREADYEXISTPARTY;
    }
    return ret;
}
Also used : Status(com.alessiodp.partiesapi.enums.Status) PartyPlayerEntity(com.alessiodp.parties.players.objects.PartyPlayerEntity) Player(org.bukkit.entity.Player) PartyPlayer(com.alessiodp.partiesapi.objects.PartyPlayer) PartyEntity(com.alessiodp.parties.parties.objects.PartyEntity)

Example 10 with PartyPlayer

use of com.alessiodp.partiesapi.objects.PartyPlayer in project Parties by AlessioDP.

the class DatabaseManager method getPlayerSync.

public PartyPlayer getPlayerSync(UUID uuid) {
    DebugUtils.debugLog("Data call: getPlayer()");
    long nsTime = System.nanoTime();
    PartyPlayer futureRet = database.getPlayer(uuid);
    DebugUtils.debugDataTiming(nsTime);
    return futureRet;
}
Also used : PartyPlayer(com.alessiodp.partiesapi.objects.PartyPlayer)

Aggregations

PartyPlayer (com.alessiodp.partiesapi.objects.PartyPlayer)16 UUID (java.util.UUID)6 PartyEntity (com.alessiodp.parties.parties.objects.PartyEntity)5 PartyPlayerEntity (com.alessiodp.parties.players.objects.PartyPlayerEntity)5 Party (com.alessiodp.partiesapi.objects.Party)5 Player (org.bukkit.entity.Player)4 DatabaseData (com.alessiodp.parties.storage.DatabaseData)2 PartiesPartyPostDeleteEvent (com.alessiodp.partiesapi.events.PartiesPartyPostDeleteEvent)2 PartiesPartyPreDeleteEvent (com.alessiodp.partiesapi.events.PartiesPartyPreDeleteEvent)2 Rank (com.alessiodp.partiesapi.interfaces.Rank)2 SQLException (java.sql.SQLException)2 HashMap (java.util.HashMap)2 OfflinePlayer (org.bukkit.OfflinePlayer)2 Status (com.alessiodp.partiesapi.enums.Status)1 PartiesPlayerLeaveEvent (com.alessiodp.partiesapi.events.PartiesPlayerLeaveEvent)1 Connection (java.sql.Connection)1 Date (java.sql.Date)1 Time (java.sql.Time)1 Matcher (java.util.regex.Matcher)1