Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ private static Path getPluginsFolder(final Plugin plugin) {

@Override
protected boolean preSubmissionStart() {
return ((SimpleConfig) getConfig()).preSubmissionStart();
return ((SimpleConfig) getConfig()).preSubmissionStart(getProjectName());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public Metrics create() throws IllegalStateException {

@Override
protected boolean preSubmissionStart() {
return ((SimpleConfig) getConfig()).preSubmissionStart();
return ((SimpleConfig) getConfig()).preSubmissionStart(getProjectName());
}

@Override
Expand Down
4 changes: 2 additions & 2 deletions config/src/main/java/dev/faststats/config/SimpleConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,15 @@ public static SimpleConfig read(final Path file) throws RuntimeException {
}

@SuppressWarnings("PatternValidation")
public boolean preSubmissionStart() {
public boolean preSubmissionStart(final String name) {
if (Boolean.getBoolean("faststats.first-run")) return false;

if (firstRun()) {
var separatorLength = 0;
final var split = ONBOARDING_MESSAGE.split("\n");
for (final var s : split) if (s.length() > separatorLength) separatorLength = s.length();

final var logger = LoggerFactory.factory().getLogger(getClass());
final var logger = LoggerFactory.factory().getLogger(name);
logger.info("-".repeat(separatorLength));
for (final var s : split) logger.info(s);
logger.info("-".repeat(separatorLength));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public Metrics create() throws IllegalStateException {

@Override
protected boolean preSubmissionStart() {
return ((SimpleConfig) getConfig()).preSubmissionStart();
return ((SimpleConfig) getConfig()).preSubmissionStart(getProjectName());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public Metrics create() throws IllegalStateException {

@Override
protected boolean preSubmissionStart() {
return ((SimpleConfig) getConfig()).preSubmissionStart();
return ((SimpleConfig) getConfig()).preSubmissionStart(getProjectName());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ protected MinestomMetrics.Factory metricsFactory() {

@Override
protected boolean preSubmissionStart() {
return ((SimpleConfig) getConfig()).preSubmissionStart();
return ((SimpleConfig) getConfig()).preSubmissionStart(getProjectName());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public Metrics create() throws IllegalStateException {

@Override
protected boolean preSubmissionStart() {
return ((SimpleConfig) getConfig()).preSubmissionStart();
return ((SimpleConfig) getConfig()).preSubmissionStart(getProjectName());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public Metrics create() throws IllegalStateException {

@Override
protected boolean preSubmissionStart() {
return ((SimpleConfig) getConfig()).preSubmissionStart();
return ((SimpleConfig) getConfig()).preSubmissionStart(getProjectName());
}

@Override
Expand Down