Skip to content

Commit

Permalink
Merge pull request #2 from cons-tan-tan/feature
Browse files Browse the repository at this point in the history
FIx misc
  • Loading branch information
cons-tan-tan authored Mar 26, 2024
2 parents b7eddd1 + 6f0a774 commit ba39dee
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/main/java/bqlogging/BetterQuestLogging.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import betterquesting.api.api.QuestingAPI;
import betterquesting.api.events.QuestEvent;
import betterquesting.api.properties.NativeProps;
import betterquesting.api.questing.IQuest;
Expand All @@ -24,7 +23,8 @@
version = Tags.VERSION,
name = "BetterQuestLogging",
acceptedMinecraftVersions = "[1.7.10]",
dependencies = "required-after:betterquesting")
dependencies = "required-after:betterquesting",
acceptableRemoteVersions = "*")
public class BetterQuestLogging {

public static final String MODID = "bqlogging";
Expand Down Expand Up @@ -56,19 +56,17 @@ public void onQuestEvent(QuestEvent event) {
return;
}

String playerName = QuestingAPI.getPlayer(event.getPlayerID())
.getDisplayName();
questIds.forEach(uuid -> {
IQuest quest = QuestDatabase.INSTANCE.get(uuid);
if (quest == null) {
LOG.error(String.format("Quest with ID %s does not exist", uuid));
return;
} else if (quest.getProperty(NativeProps.SILENT)) {
return;
}
LOG.info(
String.format(
"%s completed the quest %s: %s",
playerName,
quest.getProperty(NativeProps.GLOBAL) ? "[GLOBAL]" : "",
"Quest Completed: %s",
QuestTranslation.translateQuestName(uuid, quest)
.replaceAll("§.", "")));
});
Expand Down

0 comments on commit ba39dee

Please sign in to comment.