Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Commit

Permalink
1.7.8.更新
Browse files Browse the repository at this point in the history
- 修复Entity.md里面的错误
- 新增了pybind11库预备使用
- 修复broadcastText/broadcastTitle未装载问题
  • Loading branch information
twoone3 committed Feb 7, 2022
1 parent 13995e6 commit d2e2207
Show file tree
Hide file tree
Showing 37 changed files with 15,697 additions and 20 deletions.
3 changes: 2 additions & 1 deletion BDSpyrunner.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<LinkIncremental>false</LinkIncremental>
<PublicIncludeDirectories>
</PublicIncludeDirectories>
<IncludePath>SDK\Header;$(IncludePath)</IncludePath>
<IncludePath>include;SDK\Header;$(IncludePath)</IncludePath>
<AllProjectIncludesArePublic>true</AllProjectIncludesArePublic>
<RunCodeAnalysis>false</RunCodeAnalysis>
<EnableClangTidyCodeAnalysis>false</EnableClangTidyCodeAnalysis>
Expand Down Expand Up @@ -75,6 +75,7 @@ copy $(OutputPath)$(ProjectName).pdb ..\BDS\plugins\$(ProjectName).pdb
<ClCompile Include="mod\PyBlockInstance.cpp" />
<ClCompile Include="mod\PyUtils.cpp" />
<ClCompile Include="mod\PyNBT.cpp" />
<ClCompile Include="mod\PyContainer.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="mod\magic_enum.hpp" />
Expand Down
3 changes: 3 additions & 0 deletions BDSpyrunner.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
<ClCompile Include="mod\PyNBT.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="mod\PyContainer.cpp">
<Filter>源文件</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="mod\Main.h">
Expand Down
23 changes: 16 additions & 7 deletions docs/Class/Entity.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
## getPlatformOnlineId() -> str
## getPlatform() -> int
## getIP() -> str
## setHand(nbt:mcNBT) -> None
## setHand(nbt:mc.NBT) -> None
设置玩家手中物品
## addItem(nbt:mcNBT) -> None
## addItem(nbt:mc.NBT) -> None
为玩家新添物品
## removeItem(slot:int, count:int) -> None
移除玩家背包slot格子的count个物品
Expand Down Expand Up @@ -65,12 +65,21 @@
例:`player.setSidebar('自定义侧边栏', '{"第一行":0, "第二行":2, "我在哪行?":3}')`
## removeSidebar() -> None
移除玩家计分板侧边栏
## sendCustomForm(nbt:mcNBT, callback:function) -> None
向指定的玩家发送一个自定义表单,回调函数原型为callback(Entity:player,selected_nbt:mcNBT) -> None<br>
:player.sendCustomForm('{"content":[{"type":"label","text":"这是一个文本标签"},{"placeholder":"水印文本","default":"","type":"input","text":""},{"default":true,"type":"toggle","text":"开关~或许是吧"},{"min":0.0,"max":10.0,"step":2.0,"default":3.0,"type":"slider","text":"游标滑块!?"},{"default":1,"steps":["Step1","Step2","Step 3"],"type":"step_slider","text":"矩阵滑块?!"},{"default":1,"options":["Option 1","Option2","Option3"],"type":"dropdown","text":"如你所见 下拉框"}], "type":"custom_form","title":"这是一个自定义窗体"}',cb)
## sendCustomForm(data:str, callback:function) -> None
向指定的玩家发送一个自定义表单,回调函数原型为callback(Entity:player,selected_data:str) -> None<br>
例:
```py
player.sendCustomForm('{"content":[{"type":"label","text":"这是一个文本标签"},{"placeholder":"水印文本","default":"","type":"input","text":""},{"default":true,"type":"toggle","text":"开关~或许是吧"},{"min":0.0,"max":10.0,"step":2.0,"default":3.0,"type":"slider","text":"游标滑块!?"},{"default":1,"steps":["Step1","Step2","Step 3"],"type":"step_slider","text":"矩阵滑块?!"},{"default":1,"options":["Option 1","Option2","Option3"],"type":"dropdown","text":"如你所见 下拉框"}], "type":"custom_form","title":"这是一个自定义窗体"}',cb)
```
## sendSimpleForm(title:str, content:str, buttons:list, images:list, callback:function) -> None
向指定的玩家发送一个简单表单,回调函数原型为callback(Entity:player,selected_item:int) -> None<br>
:player.sendSimpleForm('标题', '内容', ["生存","死亡","求助"], ['','',''], cb)
例:
```py
player.sendSimpleForm('标题', '内容', ["生存","死亡","求助"], ['','',''], cb)
```
## sendModalForm(title:str, content:str, button1:str, button2:str, callback:function) -> None
向指定的玩家发送一个模式对话框,回调函数原型为callback(Entity:player,selected_item:bool) -> None<br>
:player.sendModalForm('标题', '内容', '按钮1', '按钮2', cb)
例:
```py
player.sendModalForm('标题', '内容', '按钮1', '按钮2', cb)
```
Loading

0 comments on commit d2e2207

Please sign in to comment.