Added check to make sure chatTagInsertIndex is valid, to prevent triggering an exception, commented out a bit of debug output
This commit is contained in:
		@@ -95,7 +95,7 @@ public class Factions extends JavaPlugin {
 | 
				
			|||||||
		log("=== INIT START ===");
 | 
							log("=== INIT START ===");
 | 
				
			||||||
		long timeInitStart = System.currentTimeMillis();
 | 
							long timeInitStart = System.currentTimeMillis();
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
		log("asdfasdas"+MiscUtil.range(-1, 1));
 | 
					//		log("asdfasdas"+MiscUtil.range(-1, 1));
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
		// Add the commands
 | 
							// Add the commands
 | 
				
			||||||
		commands.add(new FCommandHelp());
 | 
							commands.add(new FCommandHelp());
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -65,9 +65,13 @@ public class FactionsPlayerListener extends PlayerListener{
 | 
				
			|||||||
		if ( ! Conf.chatTagEnabled) {
 | 
							if ( ! Conf.chatTagEnabled) {
 | 
				
			||||||
			return;
 | 
								return;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		
 | 
					
 | 
				
			||||||
		String formatStart = event.getFormat().substring(0, Conf.chatTagInsertIndex);
 | 
							int InsertIndex = Conf.chatTagInsertIndex;
 | 
				
			||||||
		String formatEnd = event.getFormat().substring(Conf.chatTagInsertIndex);
 | 
							if (InsertIndex > event.getFormat().length())
 | 
				
			||||||
 | 
								return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							String formatStart = event.getFormat().substring(0, InsertIndex);
 | 
				
			||||||
 | 
							String formatEnd = event.getFormat().substring(InsertIndex);
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
		String nonColoredMsgFormat = formatStart + me.getChatTag() + formatEnd;
 | 
							String nonColoredMsgFormat = formatStart + me.getChatTag() + formatEnd;
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user