Skip to content
Closed
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 @@ -97,7 +97,7 @@ public Set<SpawnerEventType> getEnabledEvents() {
return new HashSet<>(enabledEvents);
}

public boolean isEventEnabled(SpawnerEventType eventType) {
return !enabled || !enabledEvents.contains(eventType);
public boolean shouldLogEvent(SpawnerEventType eventType) {
return enabled && enabledEvents.contains(eventType);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public SpawnerActionLogger(SmartSpawner plugin, LoggingConfig config) {
* Logs a spawner action asynchronously.
*/
public void log(SpawnerLogEntry entry) {
if (!config.isEnabled() || config.isEventEnabled(entry.getEventType())) {
if (!config.isEnabled() || !config.shouldLogEvent(entry.getEventType())) {
return;
}

Expand All @@ -79,7 +79,7 @@ public void log(SpawnerLogEntry entry) {
* Logs a spawner action using a builder pattern.
*/
public void log(SpawnerEventType eventType, LogEntryConsumer consumer) {
if (!config.isEnabled() || config.isEventEnabled(eventType)) {
if (!config.isEnabled() || !config.shouldLogEvent(eventType)) {
return;
}

Expand Down