Skip to content

Commit

Permalink
v1.1.5.1修复空手交互报错问题
Browse files Browse the repository at this point in the history
  • Loading branch information
yuhangle committed Jan 11, 2025
1 parent 3682920 commit 8b19bd6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "[email protected]" },
Expand Down
13 changes: 11 additions & 2 deletions src/endstone_tianyan/tianyan_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/")
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8b19bd6

Please sign in to comment.