1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-11-25 20:16:13 +01:00

maxjobs is not a complexed placeholder

Fixes #894
This commit is contained in:
montlikadani 2020-08-23 20:59:42 +02:00
parent 958329778a
commit 4491966934
3 changed files with 12 additions and 14 deletions

View File

@ -18,7 +18,7 @@
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.16.1-R0.1-SNAPSHOT</version>
<version>1.16.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<!-- Boss -->
@ -33,7 +33,7 @@
<dependency>
<groupId>de.keyle</groupId>
<artifactId>mypet</artifactId>
<version>3.9</version>
<version>3.10</version>
<scope>provided</scope>
</dependency>
<!-- McMMO -->
@ -156,7 +156,7 @@
<dependency>
<groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId>
<version>2.10.8</version>
<version>2.10.9</version>
<scope>provided</scope>
<exclusions>
<exclusion>

View File

@ -20,7 +20,6 @@ package com.gamingmesh.jobs;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map.Entry;
import org.bukkit.Bukkit;
import org.bukkit.World;
@ -140,11 +139,11 @@ public class PermissionManager {
}
Double amount = 0D;
for (Entry<String, Boolean> uno : permissions.entrySet()) {
if (uno.getKey().startsWith(perm)) {
for (String uno : permissions.keySet()) {
if (uno.startsWith(perm)) {
double t = 0d;
try {
t = Double.parseDouble(uno.getKey().replace(perm, ""));
t = Double.parseDouble(uno.replace(perm, ""));
} catch (NumberFormatException e) {
}

View File

@ -519,11 +519,6 @@ public class Placeholder {
return "";
Title title = Jobs.gettitleManager().getTitle(j.getLevel(), j.getJob().getName());
return title == null ? "" : title.getChatColor() + title.getName();
case maxjobs:
Double max = Jobs.getPermissionManager().getMaxPermission(user, "jobs.max");
max = max == 0D ? Jobs.getGCManager().getMaxJobs() : max;
return Double.toString(max);
default:
break;
}
@ -533,10 +528,9 @@ public class Placeholder {
if (user.isOnline()) {
Player player = user.getPlayer();
if (player != null) {
List<String> values;
switch (placeHolder) {
case user_canjoin_$1:
values = placeHolder.getComplexValues(value);
List<String> values = placeHolder.getComplexValues(value);
if (values.isEmpty())
return "";
@ -560,6 +554,11 @@ public class Placeholder {
return convert(true);
case maxjobs:
int max = Jobs.getPermissionManager().getMaxPermission(user, "jobs.max").intValue();
max = max == 0 ? Jobs.getGCManager().getMaxJobs() : max;
return Integer.toString(max);
default:
break;
}