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

Commit

Permalink
v2.0.9更新
Browse files Browse the repository at this point in the history
- 适配LL2.5.0
- 修复getOnlinePlayers的返回值错误
- 完善了文档
  • Loading branch information
twoone3 committed Aug 11, 2022
1 parent 2a0fdea commit 4f9903c
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 19 deletions.
2 changes: 1 addition & 1 deletion SDK
Submodule SDK updated from 8444c3 to 2ee36e
16 changes: 15 additions & 1 deletion example/cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,18 @@ def cb(p: CommandOrigin, result):
)
c.overload(['ssss', 'aaa'])
c.setCallback(cb)
c.setup()
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)
8 changes: 4 additions & 4 deletions example/mc.pyi
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -950,7 +950,7 @@ def runCommand(cmd) -> bool:
pass


def runCommandEx(cmd) -> tuple[bool, str]:
def runCommandEx(cmd) -> tuple[str, bool]:
pass


Expand All @@ -965,7 +965,7 @@ def registerCommand(
pass


def getPlayer(name) -> Player:
def getPlayer(name) -> list[Player]:
pass


Expand Down
20 changes: 10 additions & 10 deletions example/pyr_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
2 changes: 1 addition & 1 deletion src/api/event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down

0 comments on commit 4f9903c

Please sign in to comment.