levistone 0.6.1__cp312-cp312-win_amd64.whl → 0.7.1__cp312-cp312-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of levistone might be problematic. Click here for more details.
- endstone/__init__.py +1 -1
- endstone/_internal/bootstrap/__init__.py +6 -1
- endstone/_internal/bootstrap/base.py +40 -48
- endstone/_internal/bootstrap/linux.py +24 -5
- endstone/_internal/bootstrap/windows.py +19 -167
- endstone/_internal/endstone_python.pyd +0 -0
- endstone/_internal/endstone_python.pyi +251 -56
- endstone/_internal/metrics.py +2 -2
- endstone/_internal/plugin_loader.py +10 -4
- endstone/_internal/version.py +2 -2
- endstone/command.py +8 -2
- endstone/event.py +4 -0
- endstone/inventory.py +2 -2
- endstone/plugin.py +7 -2
- endstone_runtime.dll +0 -0
- endstone_runtime.pdb +0 -0
- levistone-0.7.1.dist-info/METADATA +250 -0
- levistone-0.7.1.dist-info/RECORD +37 -0
- {levistone-0.6.1.dist-info → levistone-0.7.1.dist-info}/WHEEL +1 -1
- levistone-0.7.1.dist-info/licenses/LICENSE +201 -0
- manifest.json +1 -1
- endstone/network.py +0 -3
- levistone-0.6.1.dist-info/METADATA +0 -39
- levistone-0.6.1.dist-info/RECORD +0 -37
- {levistone-0.6.1.dist-info → levistone-0.7.1.dist-info}/entry_points.txt +0 -0
- {levistone-0.6.1.dist-info → levistone-0.7.1.dist-info}/top_level.txt +0 -0
|
@@ -4,7 +4,7 @@ import numpy
|
|
|
4
4
|
import os
|
|
5
5
|
import typing
|
|
6
6
|
import uuid
|
|
7
|
-
__all__ = ['ActionForm', 'Actor', 'ActorDamageEvent', 'ActorDeathEvent', 'ActorEvent', 'ActorExplodeEvent', 'ActorKnockbackEvent', 'ActorRemoveEvent', 'ActorSpawnEvent', 'ActorTeleportEvent', 'BanEntry', 'BarColor', 'BarFlag', 'BarStyle', 'Block', 'BlockBreakEvent', 'BlockData', 'BlockEvent', 'BlockFace', 'BlockPlaceEvent', 'BlockState', 'BossBar', 'BroadcastMessageEvent', 'Cancellable', 'Chunk', 'ColorFormat', 'Command', 'CommandExecutor', 'CommandSender', 'CommandSenderWrapper', 'ConsoleCommandSender', 'Criteria', 'DamageSource', 'Dimension', 'DisplaySlot', 'Dropdown', 'Event', 'EventPriority', 'GameMode', 'Inventory', 'IpBanEntry', 'IpBanList', 'ItemStack', 'Label', 'Language', 'Level', 'Location', 'Logger', 'MessageForm', 'Mob', 'MobEvent', 'ModalForm', 'Objective', 'ObjectiveSortOrder', 'OfflinePlayer', '
|
|
7
|
+
__all__ = ['ActionForm', 'Actor', 'ActorDamageEvent', 'ActorDeathEvent', 'ActorEvent', 'ActorExplodeEvent', 'ActorKnockbackEvent', 'ActorRemoveEvent', 'ActorSpawnEvent', 'ActorTeleportEvent', 'BanEntry', 'BarColor', 'BarFlag', 'BarStyle', 'Block', 'BlockBreakEvent', 'BlockData', 'BlockEvent', 'BlockFace', 'BlockPlaceEvent', 'BlockState', 'BossBar', 'BroadcastMessageEvent', 'Cancellable', 'Chunk', 'ColorFormat', 'Command', 'CommandExecutor', 'CommandSender', 'CommandSenderWrapper', 'ConsoleCommandSender', 'Criteria', 'DamageSource', 'Dimension', 'DisplaySlot', 'Dropdown', 'Event', 'EventPriority', 'GameMode', 'Inventory', 'IpBanEntry', 'IpBanList', 'ItemMeta', 'ItemStack', 'Label', 'Language', 'Level', 'Location', 'Logger', 'MapMeta', 'MessageForm', 'Mob', 'MobEvent', 'ModalForm', 'Objective', 'ObjectiveSortOrder', 'OfflinePlayer', 'PacketReceiveEvent', 'PacketSendEvent', 'Permissible', 'Permission', 'PermissionAttachment', 'PermissionAttachmentInfo', 'PermissionDefault', 'Player', 'PlayerBanEntry', 'PlayerBanList', 'PlayerChatEvent', 'PlayerCommandEvent', 'PlayerDeathEvent', 'PlayerEmoteEvent', 'PlayerEvent', 'PlayerGameModeChangeEvent', 'PlayerInteractActorEvent', 'PlayerInteractEvent', 'PlayerInventory', 'PlayerJoinEvent', 'PlayerKickEvent', 'PlayerLoginEvent', 'PlayerQuitEvent', 'PlayerRespawnEvent', 'PlayerTeleportEvent', 'Plugin', 'PluginCommand', 'PluginDescription', 'PluginDisableEvent', 'PluginEnableEvent', 'PluginLoadOrder', 'PluginLoader', 'PluginManager', 'Position', 'ProxiedCommandSender', 'RenderType', 'Scheduler', 'Score', 'Scoreboard', 'ScriptMessageEvent', 'Server', 'ServerCommandEvent', 'ServerEvent', 'ServerListPingEvent', 'ServerLoadEvent', 'Service', 'ServiceManager', 'ServicePriority', 'Skin', 'Slider', 'SocketAddress', 'StepSlider', 'Task', 'TextInput', 'ThunderChangeEvent', 'Toggle', 'Translatable', 'Vector', 'WeatherChangeEvent', 'WeatherEvent']
|
|
8
8
|
class ActionForm:
|
|
9
9
|
"""
|
|
10
10
|
Represents a form with buttons that let the player take action.
|
|
@@ -102,6 +102,10 @@ class Actor(CommandSender):
|
|
|
102
102
|
"""
|
|
103
103
|
Adds a tag to this actor.
|
|
104
104
|
"""
|
|
105
|
+
def remove(self) -> None:
|
|
106
|
+
"""
|
|
107
|
+
Remove this actor from the level.
|
|
108
|
+
"""
|
|
105
109
|
def remove_scoreboard_tag(self, tag: str) -> bool:
|
|
106
110
|
"""
|
|
107
111
|
Removes a given tag from this actor.
|
|
@@ -175,6 +179,11 @@ class Actor(CommandSender):
|
|
|
175
179
|
Returns true if the actor is supported by a block, i.e. on ground.
|
|
176
180
|
"""
|
|
177
181
|
@property
|
|
182
|
+
def is_valid(self) -> bool:
|
|
183
|
+
"""
|
|
184
|
+
Returns false if the entity has died, been despawned for some other reason, or has not been added to the level.
|
|
185
|
+
"""
|
|
186
|
+
@property
|
|
178
187
|
def level(self) -> Level:
|
|
179
188
|
"""
|
|
180
189
|
Gets the current Level this actor resides in.
|
|
@@ -526,11 +535,8 @@ class Block:
|
|
|
526
535
|
@property
|
|
527
536
|
def data(self) -> BlockData:
|
|
528
537
|
"""
|
|
529
|
-
Gets
|
|
538
|
+
Gets the complete data for this block
|
|
530
539
|
"""
|
|
531
|
-
@data.setter
|
|
532
|
-
def data(self, arg1: BlockData) -> None:
|
|
533
|
-
...
|
|
534
540
|
@property
|
|
535
541
|
def dimension(self) -> Dimension:
|
|
536
542
|
"""
|
|
@@ -546,9 +552,6 @@ class Block:
|
|
|
546
552
|
"""
|
|
547
553
|
Gets or sets the type of the block.
|
|
548
554
|
"""
|
|
549
|
-
@type.setter
|
|
550
|
-
def type(self, arg1: str) -> None:
|
|
551
|
-
...
|
|
552
555
|
@property
|
|
553
556
|
def x(self) -> int:
|
|
554
557
|
"""
|
|
@@ -1179,6 +1182,20 @@ class Dimension:
|
|
|
1179
1182
|
"""
|
|
1180
1183
|
Gets the Block at the given coordinates
|
|
1181
1184
|
"""
|
|
1185
|
+
@typing.overload
|
|
1186
|
+
def get_highest_block_at(self, location: Location) -> Block:
|
|
1187
|
+
"""
|
|
1188
|
+
Gets the highest non-empty (impassable) block at the given Location.
|
|
1189
|
+
"""
|
|
1190
|
+
@typing.overload
|
|
1191
|
+
def get_highest_block_at(self, x: int, z: int) -> Block:
|
|
1192
|
+
"""
|
|
1193
|
+
Gets the highest non-empty (impassable) block at the given coordinates.
|
|
1194
|
+
"""
|
|
1195
|
+
def get_highest_block_y_at(self, x: int, z: int) -> int:
|
|
1196
|
+
"""
|
|
1197
|
+
Gets the highest non-empty (impassable) coordinate at the given coordinates.
|
|
1198
|
+
"""
|
|
1182
1199
|
@property
|
|
1183
1200
|
def level(self) -> Level:
|
|
1184
1201
|
"""
|
|
@@ -1383,7 +1400,7 @@ class Inventory:
|
|
|
1383
1400
|
"""
|
|
1384
1401
|
Returns the size of the inventory
|
|
1385
1402
|
"""
|
|
1386
|
-
def __set_item__(self, index: int, item: ItemStack
|
|
1403
|
+
def __set_item__(self, index: int, item: ItemStack) -> None:
|
|
1387
1404
|
"""
|
|
1388
1405
|
Stores the ItemStack at the given index of the inventory.
|
|
1389
1406
|
"""
|
|
@@ -1403,7 +1420,7 @@ class Inventory:
|
|
|
1403
1420
|
"""
|
|
1404
1421
|
Returns the ItemStack found in the slot at the given index
|
|
1405
1422
|
"""
|
|
1406
|
-
def set_item(self, index: int, item: ItemStack
|
|
1423
|
+
def set_item(self, index: int, item: ItemStack) -> None:
|
|
1407
1424
|
"""
|
|
1408
1425
|
Stores the ItemStack at the given index of the inventory.
|
|
1409
1426
|
"""
|
|
@@ -1469,6 +1486,43 @@ class IpBanList:
|
|
|
1469
1486
|
"""
|
|
1470
1487
|
Gets a vector of pointers to entries in the ban list.
|
|
1471
1488
|
"""
|
|
1489
|
+
class ItemMeta:
|
|
1490
|
+
"""
|
|
1491
|
+
Represents the metadata of a generic item.
|
|
1492
|
+
"""
|
|
1493
|
+
@staticmethod
|
|
1494
|
+
def _pybind11_conduit_v1_(*args, **kwargs):
|
|
1495
|
+
...
|
|
1496
|
+
def clone(self) -> ItemMeta:
|
|
1497
|
+
"""
|
|
1498
|
+
Creates a clone of the current metadata.
|
|
1499
|
+
"""
|
|
1500
|
+
@property
|
|
1501
|
+
def display_name(self) -> str | None:
|
|
1502
|
+
"""
|
|
1503
|
+
Gets or sets the display name.
|
|
1504
|
+
"""
|
|
1505
|
+
@display_name.setter
|
|
1506
|
+
def display_name(self, arg1: str | None) -> None:
|
|
1507
|
+
...
|
|
1508
|
+
@property
|
|
1509
|
+
def has_display_name(self) -> bool:
|
|
1510
|
+
"""
|
|
1511
|
+
Checks for existence of a display name.
|
|
1512
|
+
"""
|
|
1513
|
+
@property
|
|
1514
|
+
def has_lore(self) -> bool:
|
|
1515
|
+
"""
|
|
1516
|
+
Checks for existence of lore.
|
|
1517
|
+
"""
|
|
1518
|
+
@property
|
|
1519
|
+
def lore(self) -> list[str] | None:
|
|
1520
|
+
"""
|
|
1521
|
+
Gets or sets the lore for this item.
|
|
1522
|
+
"""
|
|
1523
|
+
@lore.setter
|
|
1524
|
+
def lore(self, arg1: list[str] | None) -> None:
|
|
1525
|
+
...
|
|
1472
1526
|
class ItemStack:
|
|
1473
1527
|
"""
|
|
1474
1528
|
Represents a stack of items.
|
|
@@ -1480,6 +1534,10 @@ class ItemStack:
|
|
|
1480
1534
|
...
|
|
1481
1535
|
def __str__(self) -> str:
|
|
1482
1536
|
...
|
|
1537
|
+
def set_item_meta(self, meta: ItemMeta) -> bool:
|
|
1538
|
+
"""
|
|
1539
|
+
Set the ItemMeta of this ItemStack.
|
|
1540
|
+
"""
|
|
1483
1541
|
@property
|
|
1484
1542
|
def amount(self) -> int:
|
|
1485
1543
|
"""
|
|
@@ -1489,6 +1547,11 @@ class ItemStack:
|
|
|
1489
1547
|
def amount(self, arg1: int) -> None:
|
|
1490
1548
|
...
|
|
1491
1549
|
@property
|
|
1550
|
+
def item_meta(self) -> ItemMeta:
|
|
1551
|
+
"""
|
|
1552
|
+
Gets a copy of the ItemMeta of this ItemStack.
|
|
1553
|
+
"""
|
|
1554
|
+
@property
|
|
1492
1555
|
def type(self) -> str:
|
|
1493
1556
|
"""
|
|
1494
1557
|
Gets or sets the type of this item.
|
|
@@ -1685,6 +1748,13 @@ class Logger:
|
|
|
1685
1748
|
"""
|
|
1686
1749
|
Get the name of this Logger instance.
|
|
1687
1750
|
"""
|
|
1751
|
+
class MapMeta(ItemMeta):
|
|
1752
|
+
"""
|
|
1753
|
+
Represents the metadata for a map item.
|
|
1754
|
+
"""
|
|
1755
|
+
@staticmethod
|
|
1756
|
+
def _pybind11_conduit_v1_(*args, **kwargs):
|
|
1757
|
+
...
|
|
1688
1758
|
class MessageForm:
|
|
1689
1759
|
"""
|
|
1690
1760
|
Represents a form with two buttons.
|
|
@@ -1955,53 +2025,56 @@ class OfflinePlayer:
|
|
|
1955
2025
|
"""
|
|
1956
2026
|
Returns the UUID of this player
|
|
1957
2027
|
"""
|
|
1958
|
-
class
|
|
2028
|
+
class PacketReceiveEvent(ServerEvent, Cancellable):
|
|
1959
2029
|
"""
|
|
1960
|
-
|
|
2030
|
+
Called when the server receives a packet from a connected client.
|
|
1961
2031
|
"""
|
|
1962
2032
|
@staticmethod
|
|
1963
2033
|
def _pybind11_conduit_v1_(*args, **kwargs):
|
|
1964
2034
|
...
|
|
1965
2035
|
@property
|
|
1966
|
-
def
|
|
2036
|
+
def packet_id(self) -> int:
|
|
2037
|
+
"""
|
|
2038
|
+
Gets the ID of the packet.
|
|
2039
|
+
"""
|
|
2040
|
+
@property
|
|
2041
|
+
def payload(self) -> bytes:
|
|
2042
|
+
"""
|
|
2043
|
+
Gets or sets the raw packet data **excluding** the header.
|
|
1967
2044
|
"""
|
|
1968
|
-
|
|
2045
|
+
@payload.setter
|
|
2046
|
+
def payload(self, arg1: bytes) -> None:
|
|
2047
|
+
...
|
|
2048
|
+
@property
|
|
2049
|
+
def player(self) -> Player:
|
|
1969
2050
|
"""
|
|
1970
|
-
|
|
2051
|
+
Gets the player involved in this event
|
|
2052
|
+
"""
|
|
2053
|
+
class PacketSendEvent(ServerEvent, Cancellable):
|
|
1971
2054
|
"""
|
|
1972
|
-
|
|
2055
|
+
Called when the server sends a packet to a connected client.
|
|
1973
2056
|
"""
|
|
1974
|
-
SPAWN_PARTICLE_EFFECT: typing.ClassVar[PacketType] # value = <PacketType.SPAWN_PARTICLE_EFFECT: 118>
|
|
1975
|
-
__members__: typing.ClassVar[dict[str, PacketType]] # value = {'SPAWN_PARTICLE_EFFECT': <PacketType.SPAWN_PARTICLE_EFFECT: 118>}
|
|
1976
2057
|
@staticmethod
|
|
1977
2058
|
def _pybind11_conduit_v1_(*args, **kwargs):
|
|
1978
2059
|
...
|
|
1979
|
-
def __eq__(self, other: typing.Any) -> bool:
|
|
1980
|
-
...
|
|
1981
|
-
def __getstate__(self) -> int:
|
|
1982
|
-
...
|
|
1983
|
-
def __hash__(self) -> int:
|
|
1984
|
-
...
|
|
1985
|
-
def __index__(self) -> int:
|
|
1986
|
-
...
|
|
1987
|
-
def __init__(self, value: int) -> None:
|
|
1988
|
-
...
|
|
1989
|
-
def __int__(self) -> int:
|
|
1990
|
-
...
|
|
1991
|
-
def __ne__(self, other: typing.Any) -> bool:
|
|
1992
|
-
...
|
|
1993
|
-
def __repr__(self) -> str:
|
|
1994
|
-
...
|
|
1995
|
-
def __setstate__(self, state: int) -> None:
|
|
1996
|
-
...
|
|
1997
|
-
def __str__(self) -> str:
|
|
1998
|
-
...
|
|
1999
2060
|
@property
|
|
2000
|
-
def
|
|
2001
|
-
|
|
2061
|
+
def packet_id(self) -> int:
|
|
2062
|
+
"""
|
|
2063
|
+
Gets the ID of the packet.
|
|
2064
|
+
"""
|
|
2002
2065
|
@property
|
|
2003
|
-
def
|
|
2066
|
+
def payload(self) -> bytes:
|
|
2067
|
+
"""
|
|
2068
|
+
Gets or sets the raw packet data **excluding** the header.
|
|
2069
|
+
"""
|
|
2070
|
+
@payload.setter
|
|
2071
|
+
def payload(self, arg1: bytes) -> None:
|
|
2004
2072
|
...
|
|
2073
|
+
@property
|
|
2074
|
+
def player(self) -> Player:
|
|
2075
|
+
"""
|
|
2076
|
+
Gets the player involved in this event
|
|
2077
|
+
"""
|
|
2005
2078
|
class Permissible:
|
|
2006
2079
|
"""
|
|
2007
2080
|
Represents an object that may become a server operator and can be assigned permissions.
|
|
@@ -2278,7 +2351,7 @@ class Player(Mob, OfflinePlayer):
|
|
|
2278
2351
|
"""
|
|
2279
2352
|
Sends a form to the player.
|
|
2280
2353
|
"""
|
|
2281
|
-
def send_packet(self,
|
|
2354
|
+
def send_packet(self, packet_id: int, payload: bytes) -> None:
|
|
2282
2355
|
"""
|
|
2283
2356
|
Sends a packet to the player.
|
|
2284
2357
|
"""
|
|
@@ -2653,6 +2726,62 @@ class PlayerInventory(Inventory):
|
|
|
2653
2726
|
@staticmethod
|
|
2654
2727
|
def _pybind11_conduit_v1_(*args, **kwargs):
|
|
2655
2728
|
...
|
|
2729
|
+
@property
|
|
2730
|
+
def boots(self) -> ItemStack:
|
|
2731
|
+
"""
|
|
2732
|
+
Gets or sets the ItemStack in the boots slot
|
|
2733
|
+
"""
|
|
2734
|
+
@boots.setter
|
|
2735
|
+
def boots(self, arg1: ItemStack) -> None:
|
|
2736
|
+
...
|
|
2737
|
+
@property
|
|
2738
|
+
def chestplate(self) -> ItemStack:
|
|
2739
|
+
"""
|
|
2740
|
+
Gets or sets the ItemStack in the chestplate slot
|
|
2741
|
+
"""
|
|
2742
|
+
@chestplate.setter
|
|
2743
|
+
def chestplate(self, arg1: ItemStack) -> None:
|
|
2744
|
+
...
|
|
2745
|
+
@property
|
|
2746
|
+
def held_item_slot(self) -> int:
|
|
2747
|
+
"""
|
|
2748
|
+
Gets or sets the slot number of the currently held item
|
|
2749
|
+
"""
|
|
2750
|
+
@held_item_slot.setter
|
|
2751
|
+
def held_item_slot(self, arg1: int) -> None:
|
|
2752
|
+
...
|
|
2753
|
+
@property
|
|
2754
|
+
def helmet(self) -> ItemStack:
|
|
2755
|
+
"""
|
|
2756
|
+
Gets or sets the ItemStack in the helmet slot
|
|
2757
|
+
"""
|
|
2758
|
+
@helmet.setter
|
|
2759
|
+
def helmet(self, arg1: ItemStack) -> None:
|
|
2760
|
+
...
|
|
2761
|
+
@property
|
|
2762
|
+
def item_in_main_hand(self) -> ItemStack:
|
|
2763
|
+
"""
|
|
2764
|
+
Gets or sets the item the player is currently holding in their main hand.
|
|
2765
|
+
"""
|
|
2766
|
+
@item_in_main_hand.setter
|
|
2767
|
+
def item_in_main_hand(self, arg1: ItemStack) -> None:
|
|
2768
|
+
...
|
|
2769
|
+
@property
|
|
2770
|
+
def item_in_off_hand(self) -> ItemStack:
|
|
2771
|
+
"""
|
|
2772
|
+
Gets or sets the item the player is currently holding in their off hand.
|
|
2773
|
+
"""
|
|
2774
|
+
@item_in_off_hand.setter
|
|
2775
|
+
def item_in_off_hand(self, arg1: ItemStack) -> None:
|
|
2776
|
+
...
|
|
2777
|
+
@property
|
|
2778
|
+
def leggings(self) -> ItemStack:
|
|
2779
|
+
"""
|
|
2780
|
+
Gets or sets the ItemStack in the leg slot
|
|
2781
|
+
"""
|
|
2782
|
+
@leggings.setter
|
|
2783
|
+
def leggings(self, arg1: ItemStack) -> None:
|
|
2784
|
+
...
|
|
2656
2785
|
class PlayerJoinEvent(PlayerEvent):
|
|
2657
2786
|
"""
|
|
2658
2787
|
Called when a player joins a server
|
|
@@ -3508,6 +3637,11 @@ class Server:
|
|
|
3508
3637
|
Gets the primary Scoreboard controlled by the server.
|
|
3509
3638
|
"""
|
|
3510
3639
|
@property
|
|
3640
|
+
def service_manager(self) -> ServiceManager:
|
|
3641
|
+
"""
|
|
3642
|
+
Gets the service manager.
|
|
3643
|
+
"""
|
|
3644
|
+
@property
|
|
3511
3645
|
def start_time(self) -> datetime.datetime:
|
|
3512
3646
|
"""
|
|
3513
3647
|
Gets the start time of the server.
|
|
@@ -3681,6 +3815,81 @@ class ServerLoadEvent(Event):
|
|
|
3681
3815
|
@property
|
|
3682
3816
|
def type(self) -> ServerLoadEvent.LoadType:
|
|
3683
3817
|
...
|
|
3818
|
+
class Service:
|
|
3819
|
+
"""
|
|
3820
|
+
Represents a list of methods.
|
|
3821
|
+
"""
|
|
3822
|
+
@staticmethod
|
|
3823
|
+
def _pybind11_conduit_v1_(*args, **kwargs):
|
|
3824
|
+
...
|
|
3825
|
+
def __init__(self) -> None:
|
|
3826
|
+
...
|
|
3827
|
+
class ServiceManager:
|
|
3828
|
+
"""
|
|
3829
|
+
Represent a service manager that manages services and service providers.
|
|
3830
|
+
"""
|
|
3831
|
+
@staticmethod
|
|
3832
|
+
def _pybind11_conduit_v1_(*args, **kwargs):
|
|
3833
|
+
...
|
|
3834
|
+
def load(self, name: str) -> Service:
|
|
3835
|
+
...
|
|
3836
|
+
def register(self, name: str, provider: Service, plugin: Plugin, priority: ServicePriority) -> None:
|
|
3837
|
+
"""
|
|
3838
|
+
Register a provider of a service.
|
|
3839
|
+
"""
|
|
3840
|
+
@typing.overload
|
|
3841
|
+
def unregister(self, name: str, provider: Service) -> None:
|
|
3842
|
+
"""
|
|
3843
|
+
Unregister a particular provider for a particular service.
|
|
3844
|
+
"""
|
|
3845
|
+
@typing.overload
|
|
3846
|
+
def unregister(self, provider: Service) -> None:
|
|
3847
|
+
"""
|
|
3848
|
+
Unregister a particular provider.
|
|
3849
|
+
"""
|
|
3850
|
+
def unregister_all(self, plugin: Plugin) -> None:
|
|
3851
|
+
"""
|
|
3852
|
+
Unregister all the services registered by a particular plugin.
|
|
3853
|
+
"""
|
|
3854
|
+
class ServicePriority:
|
|
3855
|
+
"""
|
|
3856
|
+
Represents various priorities of a provider.
|
|
3857
|
+
"""
|
|
3858
|
+
HIGH: typing.ClassVar[ServicePriority] # value = <ServicePriority.HIGH: 3>
|
|
3859
|
+
HIGHEST: typing.ClassVar[ServicePriority] # value = <ServicePriority.HIGHEST: 4>
|
|
3860
|
+
LOW: typing.ClassVar[ServicePriority] # value = <ServicePriority.LOW: 1>
|
|
3861
|
+
LOWEST: typing.ClassVar[ServicePriority] # value = <ServicePriority.LOWEST: 0>
|
|
3862
|
+
NORMAL: typing.ClassVar[ServicePriority] # value = <ServicePriority.NORMAL: 2>
|
|
3863
|
+
__members__: typing.ClassVar[dict[str, ServicePriority]] # value = {'LOWEST': <ServicePriority.LOWEST: 0>, 'LOW': <ServicePriority.LOW: 1>, 'NORMAL': <ServicePriority.NORMAL: 2>, 'HIGH': <ServicePriority.HIGH: 3>, 'HIGHEST': <ServicePriority.HIGHEST: 4>}
|
|
3864
|
+
@staticmethod
|
|
3865
|
+
def _pybind11_conduit_v1_(*args, **kwargs):
|
|
3866
|
+
...
|
|
3867
|
+
def __eq__(self, other: typing.Any) -> bool:
|
|
3868
|
+
...
|
|
3869
|
+
def __getstate__(self) -> int:
|
|
3870
|
+
...
|
|
3871
|
+
def __hash__(self) -> int:
|
|
3872
|
+
...
|
|
3873
|
+
def __index__(self) -> int:
|
|
3874
|
+
...
|
|
3875
|
+
def __init__(self, value: int) -> None:
|
|
3876
|
+
...
|
|
3877
|
+
def __int__(self) -> int:
|
|
3878
|
+
...
|
|
3879
|
+
def __ne__(self, other: typing.Any) -> bool:
|
|
3880
|
+
...
|
|
3881
|
+
def __repr__(self) -> str:
|
|
3882
|
+
...
|
|
3883
|
+
def __setstate__(self, state: int) -> None:
|
|
3884
|
+
...
|
|
3885
|
+
def __str__(self) -> str:
|
|
3886
|
+
...
|
|
3887
|
+
@property
|
|
3888
|
+
def name(self) -> str:
|
|
3889
|
+
...
|
|
3890
|
+
@property
|
|
3891
|
+
def value(self) -> int:
|
|
3892
|
+
...
|
|
3684
3893
|
class Skin:
|
|
3685
3894
|
"""
|
|
3686
3895
|
Represents a player skin.
|
|
@@ -3786,20 +3995,6 @@ class SocketAddress:
|
|
|
3786
3995
|
"""
|
|
3787
3996
|
Gets the port number.
|
|
3788
3997
|
"""
|
|
3789
|
-
class SpawnParticleEffectPacket(Packet):
|
|
3790
|
-
"""
|
|
3791
|
-
Represents a packet for spawning a particle effect.
|
|
3792
|
-
"""
|
|
3793
|
-
actor_id: int
|
|
3794
|
-
dimension_id: int
|
|
3795
|
-
effect_name: str
|
|
3796
|
-
molang_variables_json: str | None
|
|
3797
|
-
position: Vector
|
|
3798
|
-
@staticmethod
|
|
3799
|
-
def _pybind11_conduit_v1_(*args, **kwargs):
|
|
3800
|
-
...
|
|
3801
|
-
def __init__(self) -> None:
|
|
3802
|
-
...
|
|
3803
3998
|
class StepSlider:
|
|
3804
3999
|
"""
|
|
3805
4000
|
Represents a step slider with a set of predefined options.
|
endstone/_internal/metrics.py
CHANGED
|
@@ -5,7 +5,7 @@ from typing import Any, Dict
|
|
|
5
5
|
import psutil
|
|
6
6
|
from endstone_bstats import AdvancedPie, DrilldownPie, MetricsBase, MetricsConfig, SimplePie, SingleLineChart
|
|
7
7
|
|
|
8
|
-
from endstone import Server
|
|
8
|
+
from endstone import Server, __minecraft_version__
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
class Metrics(MetricsBase):
|
|
@@ -28,7 +28,7 @@ class Metrics(MetricsBase):
|
|
|
28
28
|
|
|
29
29
|
self.add_custom_chart(SingleLineChart("players", lambda: len(self._server.online_players)))
|
|
30
30
|
self.add_custom_chart(SimplePie("endstone_version", lambda: self._server.version))
|
|
31
|
-
self.add_custom_chart(SimplePie("minecraft_version", lambda:
|
|
31
|
+
self.add_custom_chart(SimplePie("minecraft_version", lambda: __minecraft_version__))
|
|
32
32
|
self.add_custom_chart(DrilldownPie("online_mode", self._get_online_mode))
|
|
33
33
|
self.add_custom_chart(DrilldownPie("python_version", self._get_python_version))
|
|
34
34
|
self.add_custom_chart(AdvancedPie("player_platform", self._get_player_platforms))
|
|
@@ -8,6 +8,7 @@ import shutil
|
|
|
8
8
|
import site
|
|
9
9
|
import subprocess
|
|
10
10
|
import sys
|
|
11
|
+
import traceback
|
|
11
12
|
import warnings
|
|
12
13
|
|
|
13
14
|
import pkginfo
|
|
@@ -26,6 +27,9 @@ warnings.simplefilter(action="always", category=FutureWarning)
|
|
|
26
27
|
|
|
27
28
|
def find_python():
|
|
28
29
|
paths = []
|
|
30
|
+
if os.environ.get("ENDSTONE_PYTHON_EXECUTABLE", None) is not None:
|
|
31
|
+
paths.append(os.environ["ENDSTONE_PYTHON_EXECUTABLE"])
|
|
32
|
+
|
|
29
33
|
if sys.platform == "win32":
|
|
30
34
|
paths.append(os.path.join(sys.base_prefix, "python.exe"))
|
|
31
35
|
else:
|
|
@@ -35,6 +39,7 @@ def find_python():
|
|
|
35
39
|
paths.append(os.path.join(sys.base_prefix, "bin", "python" + f"{sys.version_info.major}"))
|
|
36
40
|
paths.append(os.path.join(sys.base_prefix, "bin", "python"))
|
|
37
41
|
|
|
42
|
+
paths = set(paths)
|
|
38
43
|
for path in paths:
|
|
39
44
|
if os.path.isfile(path):
|
|
40
45
|
return path
|
|
@@ -43,7 +48,7 @@ def find_python():
|
|
|
43
48
|
|
|
44
49
|
|
|
45
50
|
class PythonPluginLoader(PluginLoader):
|
|
46
|
-
SUPPORTED_API = ["0.5", "0.6"]
|
|
51
|
+
SUPPORTED_API = ["0.5", "0.6", "0.7"]
|
|
47
52
|
|
|
48
53
|
def __init__(self, server: Server):
|
|
49
54
|
PluginLoader.__init__(self, server)
|
|
@@ -164,7 +169,7 @@ class PythonPluginLoader(PluginLoader):
|
|
|
164
169
|
f"please change the distribution name from '{ep.dist.name}' to '{dist_name}'."
|
|
165
170
|
)
|
|
166
171
|
self.server.logger.error(
|
|
167
|
-
f"* If not,
|
|
172
|
+
f"* If not, please change the entry point name from '{ep.name}' to '{ep.dist.name[9:]}'."
|
|
168
173
|
)
|
|
169
174
|
return None
|
|
170
175
|
|
|
@@ -172,8 +177,9 @@ class PythonPluginLoader(PluginLoader):
|
|
|
172
177
|
try:
|
|
173
178
|
plugin_metadata = metadata(ep.dist.name).json
|
|
174
179
|
cls = ep.load()
|
|
175
|
-
except
|
|
176
|
-
self.server.logger.error(f"Error occurred when trying to load plugin from entry point '{ep.name}':
|
|
180
|
+
except BaseException as e:
|
|
181
|
+
self.server.logger.error(f"Error occurred when trying to load plugin from entry point '{ep.name}':")
|
|
182
|
+
self.server.logger.error("".join(traceback.format_exception(e)))
|
|
177
183
|
return None
|
|
178
184
|
|
|
179
185
|
# prepare plugin description
|
endstone/_internal/version.py
CHANGED
endstone/command.py
CHANGED
|
@@ -7,5 +7,11 @@ from endstone._internal.endstone_python import (
|
|
|
7
7
|
ProxiedCommandSender,
|
|
8
8
|
)
|
|
9
9
|
|
|
10
|
-
__all__ = [
|
|
11
|
-
|
|
10
|
+
__all__ = [
|
|
11
|
+
"Command",
|
|
12
|
+
"CommandExecutor",
|
|
13
|
+
"CommandSender",
|
|
14
|
+
"CommandSenderWrapper",
|
|
15
|
+
"ConsoleCommandSender",
|
|
16
|
+
"ProxiedCommandSender",
|
|
17
|
+
]
|
endstone/event.py
CHANGED
|
@@ -15,6 +15,8 @@ from endstone._internal.endstone_python import (
|
|
|
15
15
|
Event,
|
|
16
16
|
EventPriority,
|
|
17
17
|
MobEvent,
|
|
18
|
+
PacketReceiveEvent,
|
|
19
|
+
PacketSendEvent,
|
|
18
20
|
PlayerChatEvent,
|
|
19
21
|
PlayerCommandEvent,
|
|
20
22
|
PlayerDeathEvent,
|
|
@@ -58,6 +60,8 @@ __all__ = [
|
|
|
58
60
|
"Event",
|
|
59
61
|
"EventPriority",
|
|
60
62
|
"MobEvent",
|
|
63
|
+
"PacketReceiveEvent",
|
|
64
|
+
"PacketSendEvent",
|
|
61
65
|
"PlayerEvent",
|
|
62
66
|
"PlayerChatEvent",
|
|
63
67
|
"PlayerCommandEvent",
|
endstone/inventory.py
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
from endstone._internal.endstone_python import Inventory, ItemStack, PlayerInventory
|
|
1
|
+
from endstone._internal.endstone_python import Inventory, ItemMeta, ItemStack, MapMeta, PlayerInventory
|
|
2
2
|
|
|
3
|
-
__all__ = ["ItemStack", "Inventory", "PlayerInventory"]
|
|
3
|
+
__all__ = ["ItemStack", "ItemMeta", "Inventory", "MapMeta", "PlayerInventory"]
|
endstone/plugin.py
CHANGED
|
@@ -14,6 +14,9 @@ from endstone._internal.endstone_python import (
|
|
|
14
14
|
PluginLoader,
|
|
15
15
|
PluginLoadOrder,
|
|
16
16
|
PluginManager,
|
|
17
|
+
Service,
|
|
18
|
+
ServiceManager,
|
|
19
|
+
ServicePriority,
|
|
17
20
|
)
|
|
18
21
|
from endstone.event import Event
|
|
19
22
|
|
|
@@ -24,6 +27,9 @@ __all__ = [
|
|
|
24
27
|
"PluginLoader",
|
|
25
28
|
"PluginLoadOrder",
|
|
26
29
|
"PluginManager",
|
|
30
|
+
"Service",
|
|
31
|
+
"ServiceManager",
|
|
32
|
+
"ServicePriority",
|
|
27
33
|
]
|
|
28
34
|
|
|
29
35
|
|
|
@@ -88,8 +94,7 @@ class Plugin(endstone_python.Plugin):
|
|
|
88
94
|
or not issubclass(params[0].annotation, Event)
|
|
89
95
|
):
|
|
90
96
|
self.logger.error(
|
|
91
|
-
f"Plugin {self.name} attempted to register an invalid "
|
|
92
|
-
f"event handler signature: {attr_name}: {sig}"
|
|
97
|
+
f"Plugin {self.name} attempted to register an invalid event handler signature: {attr_name}: {sig}"
|
|
93
98
|
)
|
|
94
99
|
continue
|
|
95
100
|
|
endstone_runtime.dll
CHANGED
|
Binary file
|
endstone_runtime.pdb
CHANGED
|
Binary file
|