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:
parent
3820b53d29
commit
8a4463b599
@ -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());
|
||||
|
@ -65,9 +65,13 @@ public class FactionsPlayerListener extends PlayerListener{
|
||||
if ( ! Conf.chatTagEnabled) {
|
||||
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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user