78 lines
1.7 KiB
Markdown
78 lines
1.7 KiB
Markdown
---
|
||
sidebarDepth: 1
|
||
---
|
||
# 告示牌
|
||
|
||
## GetSignBlockText
|
||
|
||
<span style="display:inline;color:#ff5555">服务端</span>
|
||
|
||
method in mod.server.component.blockInfoCompServer.BlockInfoComponentServer
|
||
|
||
- 描述
|
||
|
||
获取告示牌(方块)的文本内容
|
||
|
||
- 参数
|
||
|
||
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
|
||
| :--- | :--- | :--- |
|
||
| pos | tuple(int,int,int) | 告示牌的位置坐标 |
|
||
|
||
- 返回值
|
||
|
||
| <div style="width: 4em">数据类型</div> | 说明 |
|
||
| :--- | :--- |
|
||
| str | 告示牌上的文本内容 |
|
||
|
||
- 备注
|
||
- 当输入的坐标位置的方块不是告示牌的时候,返回None
|
||
|
||
- 示例
|
||
|
||
```python
|
||
import mod.server.extraServerApi as serverApi
|
||
comp = serverApi.GetEngineCompFactory().CreateBlockInfo(playerId)
|
||
pos = (-1, 4, 34)
|
||
text = comp.GetSignBlockText(pos)
|
||
print "GetSignBlockText text={}".format(text)
|
||
```
|
||
|
||
|
||
|
||
## SetSignBlockText
|
||
|
||
<span style="display:inline;color:#ff5555">服务端</span>
|
||
|
||
method in mod.server.component.blockInfoCompServer.BlockInfoComponentServer
|
||
|
||
- 描述
|
||
|
||
设置告示牌(方块)的文本内容
|
||
|
||
- 参数
|
||
|
||
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
|
||
| :--- | :--- | :--- |
|
||
| pos | tuple(int,int,int) | 告示牌的位置坐标 |
|
||
| text | str | 想要设置的文本内容 |
|
||
|
||
- 返回值
|
||
|
||
| <div style="width: 4em">数据类型</div> | 说明 |
|
||
| :--- | :--- |
|
||
| bool | 是否设置成功 |
|
||
|
||
- 示例
|
||
|
||
```python
|
||
import mod.server.extraServerApi as serverApi
|
||
comp = serverApi.GetEngineCompFactory().CreateBlockInfo(playerId)
|
||
pos = (-1, 4, 34)
|
||
suc = comp.SetSignBlockText(pos, "文本内容")
|
||
print "SetSignBlockText suc={}".format(suc)
|
||
```
|
||
|
||
|
||
|