9
0
mirror of https://github.com/Xiao-MoMi/Custom-Fishing.git synced 2025-12-19 15:09:24 +00:00

improve logs

This commit is contained in:
XiaoMoMi
2024-12-11 15:45:54 +08:00
parent 62b6f518e9
commit fb81816b53
2 changed files with 7 additions and 2 deletions

View File

@@ -824,7 +824,7 @@ public class BukkitGameManager implements GameManager {
this.registerGameType("accurate_click", ((id, section) -> {
GameBasics basics = getGameBasics(section);
Set<String> chances = Objects.requireNonNull(section.getSection("success-rate-sections")).getRoutesAsStrings(false);
Set<String> chances = Objects.requireNonNull(section.getSection("success-rate-sections"), "success-rate-sections should not be null").getRoutesAsStrings(false);
double[] successRate = new double[chances.size()];
for(int i = 0; i < chances.size(); i++)
successRate[i] = section.getDouble("success-rate-sections." + (i + 1));

View File

@@ -118,7 +118,12 @@ public class BukkitRequirementManager implements RequirementManager<Player> {
if (hasRequirement(typeOrName)) {
requirements.add(parseRequirement(typeOrName, entry.getValue()));
} else {
requirements.add(parseRequirement(section.getSection(typeOrName), runActions));
Section s = section.getSection(typeOrName);
if (s != null) {
requirements.add(parseRequirement(s, runActions));
} else {
plugin.getPluginLogger().warn("Section: " + section.getRouteAsString() + "." + typeOrName + " is invalid.");
}
}
}
return requirements.toArray(new Requirement[0]);