mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 15:16:45 +01:00
Made Party.isInParty safer
This commit is contained in:
parent
e97fec802c
commit
b9c8fed01f
@ -12,6 +12,8 @@ import java.io.ObjectInputStream;
|
|||||||
import java.io.ObjectOutputStream;
|
import java.io.ObjectOutputStream;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gmail.nossr50.Users;
|
import com.gmail.nossr50.Users;
|
||||||
@ -542,7 +544,14 @@ public class Party {
|
|||||||
* @return true if this player is in the right party, false otherwise
|
* @return true if this player is in the right party, false otherwise
|
||||||
*/
|
*/
|
||||||
public boolean isInParty(Player player, PlayerProfile PP) {
|
public boolean isInParty(Player player, PlayerProfile PP) {
|
||||||
return partyPlayers.get(PP.getParty()).containsKey(player.getName());
|
Map<String, Boolean> party = partyPlayers.get(PP.getParty());
|
||||||
|
|
||||||
|
if (party != null && party.containsKey(player.getName())) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user