mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 13:16:45 +01:00
Added partial name matching
Works with commands such as /party kick <name>, /ptp <name>
This commit is contained in:
parent
145a47c890
commit
92c6a7bfcf
@ -11,6 +11,7 @@ Version 1.4.04-dev
|
||||
+ Added functions to ExperienceAPI for use with offline players
|
||||
+ Added Nether Quartz Ore to Mining
|
||||
+ Added Dropper, Hopper, and Trapped Chest to blocks that shouldn't activate abilities
|
||||
+ Added partial name matching
|
||||
= Fixed bug where trying to activate a Chimaera Wing would require one item too much
|
||||
= Fixed bug where Treefeller would try to cut too many leaves and reach the threshold when it shouldn't
|
||||
= Fixed bug where Mining wasn't awarding double drops
|
||||
|
@ -3,6 +3,7 @@ package com.gmail.nossr50.util.player;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.bukkit.OfflinePlayer;
|
||||
@ -81,12 +82,16 @@ public final class UserManager {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the McMMOPlayer of a player by name.
|
||||
* Get the McMMOPlayer of a player by a partial name.
|
||||
*
|
||||
* @param playerName The name of the player whose McMMOPlayer to retrieve
|
||||
* @param playerName The partial name of the player whose McMMOPlayer to retrieve
|
||||
* @return the player's McMMOPlayer object
|
||||
*/
|
||||
public static McMMOPlayer getPlayer(String playerName) {
|
||||
List<Player> matches = mcMMO.p.getServer().matchPlayer(playerName);
|
||||
if (matches.size() == 1) {
|
||||
playerName = matches.get(0).getName();
|
||||
}
|
||||
return players.get(playerName);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user