From fcb4894387a95a9f7a000b5ece0c81fc83d7c511 Mon Sep 17 00:00:00 2001 From: Kengxxiao <11478651+Kengxxiao@users.noreply.github.com> Date: Fri, 29 Apr 2022 03:24:05 +0800 Subject: [PATCH] fix shop config issue --- src/main/java/emu/grasscutter/game/shop/ShopInfo.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/java/emu/grasscutter/game/shop/ShopInfo.java b/src/main/java/emu/grasscutter/game/shop/ShopInfo.java index c0a2a3cf8..ebbeea2cd 100644 --- a/src/main/java/emu/grasscutter/game/shop/ShopInfo.java +++ b/src/main/java/emu/grasscutter/game/shop/ShopInfo.java @@ -23,6 +23,8 @@ public class ShopInfo { private int disableType = 0; private int secondarySheetId = 0; + private String refreshType; + public enum ShopRefreshType { NONE(0), SHOP_REFRESH_DAILY(1), @@ -179,9 +181,14 @@ public class ShopInfo { } public ShopRefreshType getShopRefreshType() { - if (shopRefreshType == null) + if (refreshType == null) return ShopRefreshType.NONE; - return shopRefreshType; + return switch (refreshType) { + case "SHOP_REFRESH_DAILY" -> ShopInfo.ShopRefreshType.SHOP_REFRESH_DAILY; + case "SHOP_REFRESH_WEEKLY" -> ShopInfo.ShopRefreshType.SHOP_REFRESH_WEEKLY; + case "SHOP_REFRESH_MONTHLY" -> ShopInfo.ShopRefreshType.SHOP_REFRESH_MONTHLY; + default -> ShopInfo.ShopRefreshType.NONE; + }; } public void setShopRefreshType(ShopRefreshType shopRefreshType) {