Fix the confirm not working.
This commit is contained in:
		@@ -525,6 +525,7 @@ public class JailManager {
 | 
				
			|||||||
	
 | 
						
 | 
				
			||||||
	/** Adds something to the confirming list. */
 | 
						/** Adds something to the confirming list. */
 | 
				
			||||||
	public void addConfirming(String name, ConfirmPlayer confirmer) {
 | 
						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);
 | 
							this.confirms.put(name, confirmer);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
@@ -536,7 +537,11 @@ public class JailManager {
 | 
				
			|||||||
	/** Checks if the given name is confirming something. */
 | 
						/** Checks if the given name is confirming something. */
 | 
				
			||||||
	public boolean isConfirming(String name) {
 | 
						public boolean isConfirming(String name) {
 | 
				
			||||||
		if(this.confirms.containsKey(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);
 | 
								return this.confirms.containsKey(name);
 | 
				
			||||||
		}else {
 | 
							}else {
 | 
				
			||||||
			return false;
 | 
								return false;
 | 
				
			||||||
@@ -545,7 +550,7 @@ public class JailManager {
 | 
				
			|||||||
	
 | 
						
 | 
				
			||||||
	/** Returns true if the confirmation has expired, false if it is still valid. */
 | 
						/** Returns true if the confirmation has expired, false if it is still valid. */
 | 
				
			||||||
	public boolean confirmingHasExpired(String name) {
 | 
						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. */
 | 
						/** Returns the original arguments for what we are confirming. */
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -27,7 +27,7 @@ public class ConfirmPlayer {
 | 
				
			|||||||
		return this.name;
 | 
							return this.name;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
	/** Returns the inital arguments they sent with their command. */
 | 
						/** Returns the initial arguments they sent with their command. */
 | 
				
			||||||
	public String[] getArguments() {
 | 
						public String[] getArguments() {
 | 
				
			||||||
		return this.args;
 | 
							return this.args;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -18,7 +18,7 @@ language:
 | 
				
			|||||||
    cellremoved: '&9Cell %0% has been successfully removed from the jail %1%.'
 | 
					    cellremoved: '&9Cell %0% has been successfully removed from the jail %1%.'
 | 
				
			||||||
    jailing: '&9jailing'
 | 
					    jailing: '&9jailing'
 | 
				
			||||||
    jailremovalunsuccessful: '&cThe removal of the jail %0% was unsuccessful because there are prisoners in there, please release or transfer them first.'
 | 
					    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%.'
 | 
					    nocell: '&cNo cell found by the name of %0% in the jail %1%.'
 | 
				
			||||||
    nocells: '&cNo cells found in the jail %0%.'
 | 
					    nocells: '&cNo cells found in the jail %0%.'
 | 
				
			||||||
    nojail: '&cNo jail found by the name of %0%.'
 | 
					    nojail: '&cNo jail found by the name of %0%.'
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user