mirror of
https://github.com/cnaude/PurpleIRC-spigot.git
synced 2025-01-22 07:21:34 +01:00
Better error handling with vault group prefix lookup.
This commit is contained in:
parent
68a282690a
commit
0db1b2e9cd
2
pom.xml
2
pom.xml
@ -215,7 +215,7 @@
|
||||
<dependency>
|
||||
<groupId>net.milkbowl.vault</groupId>
|
||||
<artifactId>VaultAPI</artifactId>
|
||||
<version>1.6</version>
|
||||
<version>1.7</version>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
|
@ -1271,19 +1271,19 @@ public class PurpleIRC extends JavaPlugin {
|
||||
*/
|
||||
public String getGroupPrefix(Player player) {
|
||||
String prefix = "";
|
||||
if (vaultHelpers != null) {
|
||||
if (vaultHelpers.chat != null && vaultHelpers.permission != null) {
|
||||
String group = "";
|
||||
try {
|
||||
group = vaultHelpers.permission.getPrimaryGroup(player);
|
||||
} catch (Exception ex) {
|
||||
logDebug("getGroupPrefix (" + player.getName() + "): " + ex.getMessage());
|
||||
try {
|
||||
if (vaultHelpers != null) {
|
||||
if (vaultHelpers.chat != null && vaultHelpers.permission != null) {
|
||||
String group = vaultHelpers.permission.getPrimaryGroup(player);
|
||||
if (group == null) {
|
||||
group = "";
|
||||
}
|
||||
prefix = vaultHelpers.chat.getGroupPrefix(player.getLocation().getWorld(), group);
|
||||
}
|
||||
if (group == null) {
|
||||
group = "";
|
||||
}
|
||||
prefix = vaultHelpers.chat.getGroupPrefix(player.getLocation().getWorld(), group);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
logDebug("getGroupPrefix (" + player.getName() + "): " + ex.getMessage());
|
||||
return "";
|
||||
}
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
|
Loading…
Reference in New Issue
Block a user