mirror of
https://github.com/Zrips/Jobs.git
synced 2025-01-07 00:38:42 +01:00
Allow negative values for boost permissions
This commit is contained in:
parent
f5d4302717
commit
874fd3ce5c
@ -29,6 +29,7 @@ import org.bukkit.permissions.PermissionAttachmentInfo;
|
|||||||
|
|
||||||
import com.gamingmesh.jobs.container.Job;
|
import com.gamingmesh.jobs.container.Job;
|
||||||
import com.gamingmesh.jobs.container.JobsPlayer;
|
import com.gamingmesh.jobs.container.JobsPlayer;
|
||||||
|
import com.gamingmesh.jobs.stuff.Debug;
|
||||||
|
|
||||||
public class PermissionManager {
|
public class PermissionManager {
|
||||||
|
|
||||||
@ -156,6 +157,7 @@ public class PermissionManager {
|
|||||||
else if (allowMinus || temp > amount)
|
else if (allowMinus || temp > amount)
|
||||||
amount = temp;
|
amount = temp;
|
||||||
} catch (NumberFormatException ignored) {
|
} catch (NumberFormatException ignored) {
|
||||||
|
ignored.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,6 +40,7 @@ import com.gamingmesh.jobs.container.blockOwnerShip.BlockTypes;
|
|||||||
import com.gamingmesh.jobs.dao.JobsDAO;
|
import com.gamingmesh.jobs.dao.JobsDAO;
|
||||||
import com.gamingmesh.jobs.economy.PaymentData;
|
import com.gamingmesh.jobs.economy.PaymentData;
|
||||||
import com.gamingmesh.jobs.resources.jfep.Parser;
|
import com.gamingmesh.jobs.resources.jfep.Parser;
|
||||||
|
import com.gamingmesh.jobs.stuff.Debug;
|
||||||
import com.gamingmesh.jobs.stuff.TimeManage;
|
import com.gamingmesh.jobs.stuff.TimeManage;
|
||||||
|
|
||||||
public class JobsPlayer {
|
public class JobsPlayer {
|
||||||
@ -285,35 +286,24 @@ public class JobsPlayer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Double getPlayerBoostNew(String JobName, CurrencyType type) {
|
private Double getPlayerBoostNew(String JobName, CurrencyType type) {
|
||||||
Double v1 = Jobs.getPermissionManager().getMaxPermission(this, "jobs.boost." + JobName + "." + type.getName(), true);
|
Double v1 = Jobs.getPermissionManager().getMaxPermission(this, "jobs.boost." + JobName + "." + type.getName(), true, false, true);
|
||||||
Double Boost = v1;
|
Double Boost = v1;
|
||||||
|
|
||||||
v1 = Jobs.getPermissionManager().getMaxPermission(this, "jobs.boost." + JobName + ".all");
|
v1 = Jobs.getPermissionManager().getMaxPermission(this, "jobs.boost." + JobName + ".all", false, false, true);
|
||||||
if (v1 != 0d && (v1 > Boost || v1 < Boost))
|
if (v1 != 0d && (v1 > Boost || v1 < Boost))
|
||||||
Boost = v1;
|
Boost = v1;
|
||||||
|
|
||||||
v1 = Jobs.getPermissionManager().getMaxPermission(this, "jobs.boost.all.all");
|
v1 = Jobs.getPermissionManager().getMaxPermission(this, "jobs.boost.all.all", false, false, true);
|
||||||
if (v1 != 0d && (v1 > Boost || v1 < Boost))
|
if (v1 != 0d && (v1 > Boost || v1 < Boost))
|
||||||
Boost = v1;
|
Boost = v1;
|
||||||
|
|
||||||
v1 = Jobs.getPermissionManager().getMaxPermission(this, "jobs.boost.all." + type.getName());
|
v1 = Jobs.getPermissionManager().getMaxPermission(this, "jobs.boost.all." + type.getName(), false, false, true);
|
||||||
if (v1 != 0d && (v1 > Boost || v1 < Boost))
|
if (v1 != 0d && (v1 > Boost || v1 < Boost))
|
||||||
Boost = v1;
|
Boost = v1;
|
||||||
|
|
||||||
return Boost;
|
return Boost;
|
||||||
}
|
}
|
||||||
|
|
||||||
// New method is in use
|
|
||||||
// private Double getPlayerBoost(String JobName, CurrencyType type) {
|
|
||||||
// double Boost = 0D;
|
|
||||||
// if (Perm.hasPermission(player, "jobs.boost." + JobName + "." + type.getName().toLowerCase()) ||
|
|
||||||
// Perm.hasPermission(player, "jobs.boost." + JobName + ".all") ||
|
|
||||||
// Perm.hasPermission(player, "jobs.boost.all.all") ||
|
|
||||||
// Perm.hasPermission(player, "jobs.boost.all." + type.getName().toLowerCase())) {
|
|
||||||
// Boost = Jobs.getGCManager().Boost.get(type);
|
|
||||||
// }
|
|
||||||
// return Boost;
|
|
||||||
// }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reloads max experience for this job.
|
* Reloads max experience for this job.
|
||||||
|
Loading…
Reference in New Issue
Block a user