mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 21:26:46 +01:00
parent
45dfc13ebd
commit
933b6f278b
@ -197,6 +197,8 @@ public class Config extends AutoUpdateConfigLoader {
|
|||||||
public String getAdminChatPrefix() { return config.getString("Commands.a.Chat_Prefix_Format", "[[AQUA]][[[WHITE]]{0}[[AQUA]]]"); }
|
public String getAdminChatPrefix() { return config.getString("Commands.a.Chat_Prefix_Format", "[[AQUA]][[[WHITE]]{0}[[AQUA]]]"); }
|
||||||
public boolean getAdminDisplayNames() { return config.getBoolean("Commands.a.Use_Display_Names", true); }
|
public boolean getAdminDisplayNames() { return config.getBoolean("Commands.a.Use_Display_Names", true); }
|
||||||
|
|
||||||
|
public boolean getMatchOfflinePlayers() { return config.getBoolean("Commands.General.Match_OfflinePlayers", false); }
|
||||||
|
|
||||||
/* Mob Healthbar */
|
/* Mob Healthbar */
|
||||||
public MobHealthbarType getMobHealthbarDefault() {
|
public MobHealthbarType getMobHealthbarDefault() {
|
||||||
try {
|
try {
|
||||||
|
@ -22,6 +22,7 @@ import org.bukkit.inventory.Inventory;
|
|||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.metadata.MetadataValue;
|
import org.bukkit.metadata.MetadataValue;
|
||||||
|
|
||||||
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.events.items.McMMOItemSpawnEvent;
|
import com.gmail.nossr50.events.items.McMMOItemSpawnEvent;
|
||||||
import com.gmail.nossr50.util.player.UserManager;
|
import com.gmail.nossr50.util.player.UserManager;
|
||||||
@ -283,15 +284,25 @@ public final class Misc {
|
|||||||
* Get a matched player name if one was found in the database.
|
* Get a matched player name if one was found in the database.
|
||||||
*
|
*
|
||||||
* @param partialName Name to match
|
* @param partialName Name to match
|
||||||
|
*
|
||||||
* @return Matched name or {@code partialName} if no match was found
|
* @return Matched name or {@code partialName} if no match was found
|
||||||
*/
|
*/
|
||||||
public static String getMatchedPlayerName(String partialName) {
|
public static String getMatchedPlayerName(String partialName) {
|
||||||
|
if (Config.getInstance().getMatchOfflinePlayers()) {
|
||||||
List<String> matches = matchPlayer(partialName);
|
List<String> matches = matchPlayer(partialName);
|
||||||
|
|
||||||
if (matches.size() == 1) {
|
if (matches.size() == 1) {
|
||||||
partialName = matches.get(0);
|
partialName = matches.get(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Player player = mcMMO.p.getServer().getPlayer(partialName);
|
||||||
|
if (player != null) {
|
||||||
|
partialName = player.getName();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return partialName;
|
return partialName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -309,6 +309,10 @@ Double_Drops:
|
|||||||
# Settings for commands
|
# Settings for commands
|
||||||
###
|
###
|
||||||
Commands:
|
Commands:
|
||||||
|
General:
|
||||||
|
# If true, when using partial names in commands mcMMO will try to look for a match from
|
||||||
|
# the offline players. Enabling this might slow the server down if there are a lot of offline players.
|
||||||
|
Match_OfflinePlayers: false
|
||||||
mcmmo:
|
mcmmo:
|
||||||
Donate_Message: true
|
Donate_Message: true
|
||||||
inspect:
|
inspect:
|
||||||
|
Loading…
Reference in New Issue
Block a user