mirror of
https://github.com/Zrips/Jobs.git
synced 2024-11-29 14:05:25 +01:00
Trying to avoid issues with missing limit data
This commit is contained in:
parent
15305f18b8
commit
89d6e78551
@ -92,6 +92,8 @@ public class JobsPlayer {
|
||||
if (paymentLimits == null) {
|
||||
paymentLimits = Jobs.getJobsDAO().getPlayersLimits(this);
|
||||
}
|
||||
if (paymentLimits == null)
|
||||
paymentLimits = new PaymentData();
|
||||
return paymentLimits;
|
||||
}
|
||||
|
||||
@ -105,8 +107,8 @@ public class JobsPlayer {
|
||||
if (!limit.isEnabled())
|
||||
return true;
|
||||
PaymentData data = getPaymentLimit();
|
||||
|
||||
if (data.IsReachedLimit(type, this.limits.get(type))) {
|
||||
Integer value = this.limits.get(type);
|
||||
if (data.IsReachedLimit(type, value == null ? 0 : value)) {
|
||||
if (player.isOnline() && !data.isInformed() && !data.isReseted()) {
|
||||
player.sendMessage(Jobs.getLanguage().getMessage("command.limit.output.reached" + type.getName().toLowerCase() + "limit"));
|
||||
player.sendMessage(Jobs.getLanguage().getMessage("command.limit.output.reached" + type.getName().toLowerCase() + "limit2"));
|
||||
|
Loading…
Reference in New Issue
Block a user