Fix the confirm not working.

This commit is contained in:
graywolf336 2014-02-14 23:18:41 -06:00
parent c432dee86f
commit 3784eb6b28
3 changed files with 9 additions and 4 deletions

View File

@ -525,6 +525,7 @@ public class JailManager {
/** Adds something to the confirming list. */
public void addConfirming(String name, ConfirmPlayer confirmer) {
getPlugin().debug("Adding a confirming for " + name + " to confirm " + confirmer.getConfirming().toString().toLowerCase());
this.confirms.put(name, confirmer);
}
@ -536,7 +537,11 @@ public class JailManager {
/** Checks if the given name is confirming something. */
public boolean isConfirming(String name) {
if(this.confirms.containsKey(name)) {
if(this.confirmingHasExpired(name)) this.removeConfirming(name);
if(this.confirmingHasExpired(name)) {
getPlugin().debug("Removing " + name + "'s confirmation as it expired.");
this.removeConfirming(name);
}
return this.confirms.containsKey(name);
}else {
return false;
@ -545,7 +550,7 @@ public class JailManager {
/** Returns true if the confirmation has expired, false if it is still valid. */
public boolean confirmingHasExpired(String name) {
return this.confirms.get(name).getExpiryTime() <= (System.currentTimeMillis() + 5000L);
return this.confirms.get(name).getExpiryTime() >= (System.currentTimeMillis() + 5000L);
}
/** Returns the original arguments for what we are confirming. */

View File

@ -27,7 +27,7 @@ public class ConfirmPlayer {
return this.name;
}
/** Returns the inital arguments they sent with their command. */
/** Returns the initial arguments they sent with their command. */
public String[] getArguments() {
return this.args;
}

View File

@ -18,7 +18,7 @@ language:
cellremoved: '&9Cell %0% has been successfully removed from the jail %1%.'
jailing: '&9jailing'
jailremovalunsuccessful: '&cThe removal of the jail %0% was unsuccessful because there are prisoners in there, please release or transfer them first.'
jailremoved: '&9Jail %0% has been successfully removed.'
jailremoved: '&9Jail %0% has been successfully deleted.'
nocell: '&cNo cell found by the name of %0% in the jail %1%.'
nocells: '&cNo cells found in the jail %0%.'
nojail: '&cNo jail found by the name of %0%.'