Add isJailedForever to the prisoner & use it in pay
This commit is contained in:
parent
e598b0c424
commit
4c7166251f
@ -15,7 +15,7 @@ import com.graywolf336.jail.enums.Lang;
|
|||||||
*
|
*
|
||||||
* @author graywolf336
|
* @author graywolf336
|
||||||
* @since 2.x.x
|
* @since 2.x.x
|
||||||
* @version 3.1.0
|
* @version 3.1.1
|
||||||
*/
|
*/
|
||||||
public class Prisoner {
|
public class Prisoner {
|
||||||
private String uuid, name, jailer, reason, inventory, armor;
|
private String uuid, name, jailer, reason, inventory, armor;
|
||||||
@ -226,6 +226,11 @@ public class Prisoner {
|
|||||||
this.muted = muted;
|
this.muted = muted;
|
||||||
this.changed = true;
|
this.changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Gets whether the prisoner is jailed forever or not. */
|
||||||
|
public boolean isJailedForever() {
|
||||||
|
return this.time == -1;
|
||||||
|
}
|
||||||
|
|
||||||
/** Gets the remaining time the prisoner has. */
|
/** Gets the remaining time the prisoner has. */
|
||||||
public long getRemainingTime() {
|
public long getRemainingTime() {
|
||||||
|
@ -139,13 +139,13 @@ public class JailPayCommand implements Command {
|
|||||||
if(jm.isPlayerJailedByLastKnownUsername(args[2])) {
|
if(jm.isPlayerJailedByLastKnownUsername(args[2])) {
|
||||||
Prisoner p = jm.getPrisonerByLastKnownName(args[2]);
|
Prisoner p = jm.getPrisonerByLastKnownName(args[2]);
|
||||||
|
|
||||||
if(p.getRemainingTime() > 0) {
|
if(p.isJailedForever()) {
|
||||||
if(!pm.isTimedEnabled()) {
|
if(!pm.isInfiniteEnabled()) {
|
||||||
sender.sendMessage(Lang.PAYNOTENABLED.get());
|
sender.sendMessage(Lang.PAYNOTENABLED.get());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
if(!pm.isInfiniteEnabled()) {
|
if(!pm.isTimedEnabled()) {
|
||||||
sender.sendMessage(Lang.PAYNOTENABLED.get());
|
sender.sendMessage(Lang.PAYNOTENABLED.get());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user