diff --git a/SDK b/SDK index 8444c38..2ee36e4 160000 --- a/SDK +++ b/SDK @@ -1 +1 @@ -Subproject commit 8444c3899d8f31012dd529e8823793d706e471b7 +Subproject commit 2ee36e4043bc3b5648f9119e8bcf6e9bd003dbaf diff --git a/example/cmd.py b/example/cmd.py index 1ece514..907861b 100644 --- a/example/cmd.py +++ b/example/cmd.py @@ -13,4 +13,18 @@ def cb(p: CommandOrigin, result): ) c.overload(['ssss', 'aaa']) c.setCallback(cb) -c.setup() \ No newline at end of file +c.setup() + + +def ons(e): + print(e) + while (True): + print(getBlock(BlockPos(1, 1, 1), 0)) + + +setListener("onServerStarted", ons) + +print(globals()) +import mc + +print(mc) \ No newline at end of file diff --git a/example/mc.pyi b/example/mc.pyi index 757f216..54d7e72 100644 --- a/example/mc.pyi +++ b/example/mc.pyi @@ -1,7 +1,7 @@ -# Code completion file for BDSpyrunner +# pyr的代码补全文件 # Copyright (c) 2022 twoone3 # All rights reserved. -# last change: 2022.8.7 +# last change: 2022.7.24 from enum import Enum @@ -950,7 +950,7 @@ def runCommand(cmd) -> bool: pass -def runCommandEx(cmd) -> tuple[bool, str]: +def runCommandEx(cmd) -> tuple[str, bool]: pass @@ -965,7 +965,7 @@ def registerCommand( pass -def getPlayer(name) -> Player: +def getPlayer(name) -> list[Player]: pass diff --git a/example/pyr_test.py b/example/pyr_test.py index e49ea2c..4cd9b69 100644 --- a/example/pyr_test.py +++ b/example/pyr_test.py @@ -85,13 +85,13 @@ def onAllEvent(e): for n in events: setListener(n, onAllEvent) -# nbt = NBT.newCompound() -# nbt['list'] = NBT.newList() -# nbt['string'] = NBT.newString('I am string') -# nbt['list'] = NBT.newList() -# nbt['a24z'] = NBT.fromSNBT('{"a4z":{},"az":[1f,1f,1],"az3":"az2"}') -# logger.warn(str(nbt['a24z'])) -# nbt['a24z']['a4z'] = NBT.newByte(2) -# b = nbt.toBinary() -# nbt['二进制'] = NBT.fromBinary(b) -# logger.warn(nbt.toSNBT(4)) +nbt = newCompound() +nbt['list'] = NBT.newList() +nbt['string'] = NBT.newString('I am string') +nbt['list'] = NBT.newList() +nbt['a24z'] = NBT.fromSNBT('{"a4z":{},"az":[1f,1f,1],"az3":"az2"}') +logger.warn(str(nbt['a24z'])) +nbt['a24z']['a4z'] = NBT.newByte(2) +b = nbt.toBinary() +nbt['二进制'] = NBT.fromBinary(b) +logger.warn(nbt.toSNBT(4)) diff --git a/src/api/event.cpp b/src/api/event.cpp index 94e2518..825cc62 100644 --- a/src/api/event.cpp +++ b/src/api/event.cpp @@ -506,8 +506,8 @@ void EnableEventListener(EventCode event_code) { EVENT_INSERT(Actor); EVENT_INSERT(Container); EVENT_INSERT(Slot); - EVENT_INSERT(NewItemStack); EVENT_INSERT(PreviousItemStack); + EVENT_INSERT(NewItemStack); EVENT_END; }); break; diff --git a/src/main.cpp b/src/main.cpp index fb69caa..c97bc29 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -7,8 +7,8 @@ constexpr unsigned PYR_VERSION_MAJOR = 2; constexpr unsigned PYR_VERSION_MINOR = 0; -constexpr unsigned PYR_VERSION_MICRO = 8; -constexpr const char* PYR_VERSION = "v2.0.8"; +constexpr unsigned PYR_VERSION_MICRO = 9; +constexpr const char* PYR_VERSION = "v2.0.9"; Logger logger("BDSpyrunner");