Skip to content

Commit

Permalink
Forgot config check
Browse files Browse the repository at this point in the history
  • Loading branch information
4Benj committed Apr 20, 2022
1 parent c08a341 commit a498b81
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/main/java/emu/grasscutter/game/gacha/GachaManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -296,16 +296,18 @@ private synchronized void startWatcher(GameServer server) {

@Subscribe
public synchronized void watchBannerJson(GameServerTickEvent tickEvent) {
try {
for (WatchEvent<?> event : watchKey.pollEvents()) {
final Path changed = (Path) event.context();
if (changed.endsWith("Banners.json")) {
Grasscutter.getLogger().info("Change detected with banners.json. Reloading gacha config");
this.load();
if(Grasscutter.getConfig().getServerOptions().WatchGacha) {
try {
for (WatchEvent<?> event : watchKey.pollEvents()) {
final Path changed = (Path) event.context();
if (changed.endsWith("Banners.json")) {
Grasscutter.getLogger().info("Change detected with banners.json. Reloading gacha config");
this.load();
}
}
} catch (Exception e) {
e.printStackTrace();
}
} catch (Exception e) {
e.printStackTrace();
}
}

Expand Down

0 comments on commit a498b81

Please sign in to comment.