新增菜园查看
This commit is contained in:
@@ -508,7 +508,7 @@ class WPSGardenBase(WPSAPI):
|
||||
return crop
|
||||
return None
|
||||
|
||||
def format_garden_overview(self, user_id: int) -> str:
|
||||
def format_garden_overview(self, user_id: int, show_trap: bool = True) -> str:
|
||||
service = self.service()
|
||||
plots = service.list_plots(user_id)
|
||||
config = service.config
|
||||
@@ -527,7 +527,7 @@ class WPSGardenBase(WPSAPI):
|
||||
remaining = plot["remaining_fruit"]
|
||||
theft_users = len(json.loads(plot["theft_users"])) if plot.get("theft_users") else 0
|
||||
trap_info = ""
|
||||
if plot.get("trap_item_id"):
|
||||
if show_trap and plot.get("trap_item_id"):
|
||||
trap_durability = int(plot.get("trap_durability", 0))
|
||||
from .garden_models import GARDEN_TRAPS_DICT
|
||||
trap = GARDEN_TRAPS_DICT.get(plot["trap_item_id"])
|
||||
|
||||
Reference in New Issue
Block a user