Add a new command /jail time
which has easy access for add/subtract
time from a prisoner's sentence. This command could be useful for commandblocks or something else, as it does not need a player context. This closes Bukkit Dev Ticket: http://dev.bukkit.org/bukkit-plugins/jail/tickets/432/
This commit is contained in:
@ -11,7 +11,7 @@ import org.bukkit.Location;
|
||||
*
|
||||
* @author graywolf336
|
||||
* @since 2.x.x
|
||||
* @version 3.0.0
|
||||
* @version 3.0.1
|
||||
*/
|
||||
public class Prisoner {
|
||||
private String name, jailer, reason, inventory, armor;
|
||||
@ -108,9 +108,22 @@ public class Prisoner {
|
||||
* Adds the given time to the remaining time the prisoner has left.
|
||||
*
|
||||
* @param time to add to the prisoner's remaining time.
|
||||
* @return the new remaining time the prisoner has
|
||||
*/
|
||||
public void addTime(long time) {
|
||||
public long addTime(long time) {
|
||||
this.time += time;
|
||||
return this.time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Subtracts the given time from the remaining time the prisoner has left.
|
||||
*
|
||||
* @param time to subtract from the prisoner's remaining time.
|
||||
* @return the new remaining time the prisoner has
|
||||
*/
|
||||
public long subtractTime(long time) {
|
||||
this.time -= time;
|
||||
return this.time;
|
||||
}
|
||||
|
||||
/** Gets whether the player is offline or not. */
|
||||
|
Reference in New Issue
Block a user