diff --git a/pyproject.toml b/pyproject.toml index fc93aa1..2c857c0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "endstone-tianyan" -version = "1.1.5" +version = "1.1.5.1" description = "一款可进行行为记录与查询、防刷屏、玩家封禁、物品栏查看的endstone插件/A plugin that can perform action logging and querying, prevent spamming, ban players, and view inventories - the Endstone plugin." authors = [ { name = "yuhang", email = "yuhang2006@hotmail.com" }, diff --git a/src/endstone_tianyan/tianyan_plugin.py b/src/endstone_tianyan/tianyan_plugin.py index e1a5b40..3028789 100644 --- a/src/endstone_tianyan/tianyan_plugin.py +++ b/src/endstone_tianyan/tianyan_plugin.py @@ -405,7 +405,7 @@ def on_load(self) -> None: ensure_blockdata_column() def on_enable(self) -> None: - self.logger.info(f"{ColorFormat.YELLOW}{lang["天眼插件已启用 版本"]} V1.1.5") + self.logger.info(f"{ColorFormat.YELLOW}{lang["天眼插件已启用 版本"]} V1.1.5.1") self.logger.info(f"{ColorFormat.YELLOW}{lang["配置文件位于"]}plugins/tianyan_data/config.json") self.logger.info(f"{ColorFormat.YELLOW}{lang["插件语言设定为"]} {language}") self.logger.info(f"{ColorFormat.YELLOW}{lang["其余数据文件位于"]} plugins/tianyan_data/") @@ -1212,7 +1212,16 @@ def record_data(name, action, x, y, z, type,world): world = event.block.location.dimension.name record_data(name, action, x, y, z, type, world) - elif event.item.type in [ + # 解决空手交互时物品为空报错的问题 + try: + if event.item.type: + pass + except: + return + + #玩家使用物品交互 + + if event.item.type in [ "minecraft:flint_and_steel","minecraft:lava_bucket","minecraft:water_bucket","minecraft:powder_snow_bucket","minecraft:cod_bucket","minecraft:salmon_bucket","minecraft:pufferfish_bucket","minecraft:tropical_fish_bucket","minecraft:axolotl_bucket","minecraft:tadpole_bucket" ]: # 打火石、岩浆桶、水桶、鱼桶交互 name = event.player.name