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 ===");
|
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());
|
||||||
|
@ -66,8 +66,12 @@ public class FactionsPlayerListener extends PlayerListener{
|
|||||||
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;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user