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 ===");
 | 
			
		||||
		long timeInitStart = System.currentTimeMillis();
 | 
			
		||||
		
 | 
			
		||||
		log("asdfasdas"+MiscUtil.range(-1, 1));
 | 
			
		||||
//		log("asdfasdas"+MiscUtil.range(-1, 1));
 | 
			
		||||
		
 | 
			
		||||
		// Add the commands
 | 
			
		||||
		commands.add(new FCommandHelp());
 | 
			
		||||
 
 | 
			
		||||
@@ -66,8 +66,12 @@ public class FactionsPlayerListener extends PlayerListener{
 | 
			
		||||
			return;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		String formatStart = event.getFormat().substring(0, Conf.chatTagInsertIndex);
 | 
			
		||||
		String formatEnd = event.getFormat().substring(Conf.chatTagInsertIndex);
 | 
			
		||||
		int InsertIndex = 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;
 | 
			
		||||
		
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user