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

Commit 4f9903c

Browse files
author
twoone3
committed
v2.0.9更新
- 适配LL2.5.0 - 修复getOnlinePlayers的返回值错误 - 完善了文档
1 parent 2a0fdea commit 4f9903c

File tree

6 files changed

+33
-19
lines changed

6 files changed

+33
-19
lines changed

SDK

Submodule SDK updated from 8444c38 to 2ee36e4

example/cmd.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,18 @@ def cb(p: CommandOrigin, result):
1313
)
1414
c.overload(['ssss', 'aaa'])
1515
c.setCallback(cb)
16-
c.setup()
16+
c.setup()
17+
18+
19+
def ons(e):
20+
print(e)
21+
while (True):
22+
print(getBlock(BlockPos(1, 1, 1), 0))
23+
24+
25+
setListener("onServerStarted", ons)
26+
27+
print(globals())
28+
import mc
29+
30+
print(mc)

example/mc.pyi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# Code completion file for BDSpyrunner
1+
# pyr的代码补全文件
22
# Copyright (c) 2022 twoone3
33
# All rights reserved.
4-
# last change: 2022.8.7
4+
# last change: 2022.7.24
55

66
from enum import Enum
77

@@ -950,7 +950,7 @@ def runCommand(cmd) -> bool:
950950
pass
951951

952952

953-
def runCommandEx(cmd) -> tuple[bool, str]:
953+
def runCommandEx(cmd) -> tuple[str, bool]:
954954
pass
955955

956956

@@ -965,7 +965,7 @@ def registerCommand(
965965
pass
966966

967967

968-
def getPlayer(name) -> Player:
968+
def getPlayer(name) -> list[Player]:
969969
pass
970970

971971

example/pyr_test.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,13 @@ def onAllEvent(e):
8585
for n in events:
8686
setListener(n, onAllEvent)
8787

88-
# nbt = NBT.newCompound()
89-
# nbt['list'] = NBT.newList()
90-
# nbt['string'] = NBT.newString('I am string')
91-
# nbt['list'] = NBT.newList()
92-
# nbt['a24z'] = NBT.fromSNBT('{"a4z":{},"az":[1f,1f,1],"az3":"az2"}')
93-
# logger.warn(str(nbt['a24z']))
94-
# nbt['a24z']['a4z'] = NBT.newByte(2)
95-
# b = nbt.toBinary()
96-
# nbt['二进制'] = NBT.fromBinary(b)
97-
# logger.warn(nbt.toSNBT(4))
88+
nbt = newCompound()
89+
nbt['list'] = NBT.newList()
90+
nbt['string'] = NBT.newString('I am string')
91+
nbt['list'] = NBT.newList()
92+
nbt['a24z'] = NBT.fromSNBT('{"a4z":{},"az":[1f,1f,1],"az3":"az2"}')
93+
logger.warn(str(nbt['a24z']))
94+
nbt['a24z']['a4z'] = NBT.newByte(2)
95+
b = nbt.toBinary()
96+
nbt['二进制'] = NBT.fromBinary(b)
97+
logger.warn(nbt.toSNBT(4))

src/api/event.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,8 +506,8 @@ void EnableEventListener(EventCode event_code) {
506506
EVENT_INSERT(Actor);
507507
EVENT_INSERT(Container);
508508
EVENT_INSERT(Slot);
509-
EVENT_INSERT(NewItemStack);
510509
EVENT_INSERT(PreviousItemStack);
510+
EVENT_INSERT(NewItemStack);
511511
EVENT_END;
512512
});
513513
break;

src/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
constexpr unsigned PYR_VERSION_MAJOR = 2;
99
constexpr unsigned PYR_VERSION_MINOR = 0;
10-
constexpr unsigned PYR_VERSION_MICRO = 8;
11-
constexpr const char* PYR_VERSION = "v2.0.8";
10+
constexpr unsigned PYR_VERSION_MICRO = 9;
11+
constexpr const char* PYR_VERSION = "v2.0.9";
1212

1313
Logger logger("BDSpyrunner");
1414

0 commit comments

Comments
 (0)