mirror of
				https://github.com/Aust1n46/VentureChat.git
				synced 2025-10-30 21:52:23 +00:00 
			
		
		
		
	Added common mute times to tab completion.
This commit is contained in:
		
							parent
							
								
									72153b57c6
								
							
						
					
					
						commit
						a867c2d23a
					
				| @ -3,6 +3,7 @@ package mineverse.Aust1n46.chat.command.mute; | |||||||
| import java.io.ByteArrayOutputStream; | import java.io.ByteArrayOutputStream; | ||||||
| import java.io.DataOutputStream; | import java.io.DataOutputStream; | ||||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||||
|  | import java.util.Arrays; | ||||||
| import java.util.Collections; | import java.util.Collections; | ||||||
| import java.util.List; | import java.util.List; | ||||||
| import java.util.stream.Collectors; | import java.util.stream.Collectors; | ||||||
| @ -23,6 +24,8 @@ import mineverse.Aust1n46.chat.utilities.Format; | |||||||
| public class Mute extends MineverseCommand { | public class Mute extends MineverseCommand { | ||||||
| 	private MineverseChat plugin = MineverseChat.getInstance(); | 	private MineverseChat plugin = MineverseChat.getInstance(); | ||||||
| 	 | 	 | ||||||
|  | 	private static final List<String> COMMON_MUTE_TIMES = Collections.unmodifiableList(Arrays.asList(new String[]{"12h", "15m", "1d", "1h", "1m", "30s"})); | ||||||
|  | 
 | ||||||
| 	public Mute(String name) { | 	public Mute(String name) { | ||||||
| 		super(name); | 		super(name); | ||||||
| 	} | 	} | ||||||
| @ -130,6 +133,12 @@ public class Mute extends MineverseCommand { | |||||||
| 			StringUtil.copyPartialMatches(args[1], ChatChannel.getChatChannels().stream().map(ChatChannel::getName).collect(Collectors.toList()), completions); | 			StringUtil.copyPartialMatches(args[1], ChatChannel.getChatChannels().stream().map(ChatChannel::getName).collect(Collectors.toList()), completions); | ||||||
| 			Collections.sort(completions); | 			Collections.sort(completions); | ||||||
| 	        return completions; | 	        return completions; | ||||||
|  | 		} | ||||||
|  | 		if(args.length == 3) { | ||||||
|  | 			StringUtil.copyPartialMatches(args[2], COMMON_MUTE_TIMES, completions); | ||||||
|  | 			Collections.sort(completions); | ||||||
|  | 	        return completions; | ||||||
|  | 			 | ||||||
| 		} | 		} | ||||||
| 		return Collections.emptyList(); | 		return Collections.emptyList(); | ||||||
| 	} | 	} | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Aust1n46
						Aust1n46