Skip to content

Commit

Permalink
perf(bot): ⚡️ improve perf of get_location
Browse files Browse the repository at this point in the history
  • Loading branch information
AnzhiZhang committed Feb 27, 2024
1 parent 17b863f commit a3ebfeb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/bot/bot/plugin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from mcdreforged.api.types import PluginServerInterface

from bot.constants import CONFIG_FILE_NAME
from bot.constants import CONFIG_FILE_NAME, DIMENSION
from bot.config import Config
from bot.bot_manager import BotManager
from bot.command_handler import CommandHandler
Expand Down Expand Up @@ -99,5 +99,5 @@ def get_location(self, name: str) -> Location:
"""
api = self.minecraft_data_api
info = api.get_player_info(name)
dimension = api.get_player_dimension(name)
dimension = DIMENSION.INT_TRANSLATION.get(info['Dimension'])
return Location(info['Pos'], info['Rotation'], dimension)

0 comments on commit a3ebfeb

Please sign in to comment.