pumpkin-api-py 0.1.0.dev0__py3-none-any.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.
Files changed (75) hide show
  1. pumpkin_api/__init__.py +139 -0
  2. pumpkin_api/app.py +8 -0
  3. pumpkin_api/build.py +35 -0
  4. pumpkin_api/wit/componentize_py_async_support/__init__.py +529 -0
  5. pumpkin_api/wit/componentize_py_async_support/futures.py +93 -0
  6. pumpkin_api/wit/componentize_py_async_support/streams.py +189 -0
  7. pumpkin_api/wit/componentize_py_runtime.pyi +34 -0
  8. pumpkin_api/wit/componentize_py_types.py +19 -0
  9. pumpkin_api/wit/poll_loop.py +440 -0
  10. pumpkin_api/wit/wit_world/__init__.py +70 -0
  11. pumpkin_api/wit/wit_world/exports/__init__.py +19 -0
  12. pumpkin_api/wit/wit_world/exports/metadata.py +22 -0
  13. pumpkin_api/wit/wit_world/imports/__init__.py +0 -0
  14. pumpkin_api/wit/wit_world/imports/command.py +539 -0
  15. pumpkin_api/wit/wit_world/imports/common.py +213 -0
  16. pumpkin_api/wit/wit_world/imports/context.py +70 -0
  17. pumpkin_api/wit/wit_world/imports/entity.py +84 -0
  18. pumpkin_api/wit/wit_world/imports/event.py +434 -0
  19. pumpkin_api/wit/wit_world/imports/gui.py +61 -0
  20. pumpkin_api/wit/wit_world/imports/i18n.py +35 -0
  21. pumpkin_api/wit/wit_world/imports/logging.py +30 -0
  22. pumpkin_api/wit/wit_world/imports/permission.py +71 -0
  23. pumpkin_api/wit/wit_world/imports/player.py +350 -0
  24. pumpkin_api/wit/wit_world/imports/scheduler.py +44 -0
  25. pumpkin_api/wit/wit_world/imports/scoreboard.py +95 -0
  26. pumpkin_api/wit/wit_world/imports/server.py +75 -0
  27. pumpkin_api/wit/wit_world/imports/text.py +89 -0
  28. pumpkin_api/wit/wit_world/imports/world.py +215 -0
  29. pumpkin_api/wit_files/command.wit +189 -0
  30. pumpkin_api/wit_files/common.wit +201 -0
  31. pumpkin_api/wit_files/componentize_py_async_support/__init__.py +529 -0
  32. pumpkin_api/wit_files/componentize_py_async_support/futures.py +93 -0
  33. pumpkin_api/wit_files/componentize_py_async_support/streams.py +189 -0
  34. pumpkin_api/wit_files/componentize_py_runtime.pyi +34 -0
  35. pumpkin_api/wit_files/componentize_py_types.py +19 -0
  36. pumpkin_api/wit_files/context.wit +33 -0
  37. pumpkin_api/wit_files/entity.wit +36 -0
  38. pumpkin_api/wit_files/event.wit +311 -0
  39. pumpkin_api/wit_files/gui.wit +38 -0
  40. pumpkin_api/wit_files/i18n.wit +21 -0
  41. pumpkin_api/wit_files/log.wit +14 -0
  42. pumpkin_api/wit_files/metadata.wit +15 -0
  43. pumpkin_api/wit_files/permission.wit +46 -0
  44. pumpkin_api/wit_files/player.wit +172 -0
  45. pumpkin_api/wit_files/plugin.wit +61 -0
  46. pumpkin_api/wit_files/poll_loop.py +440 -0
  47. pumpkin_api/wit_files/scheduler.wit +24 -0
  48. pumpkin_api/wit_files/scoreboard.wit +72 -0
  49. pumpkin_api/wit_files/server.wit +41 -0
  50. pumpkin_api/wit_files/text.wit +41 -0
  51. pumpkin_api/wit_files/wit_world/__init__.py +70 -0
  52. pumpkin_api/wit_files/wit_world/exports/__init__.py +19 -0
  53. pumpkin_api/wit_files/wit_world/exports/metadata.py +22 -0
  54. pumpkin_api/wit_files/wit_world/imports/__init__.py +0 -0
  55. pumpkin_api/wit_files/wit_world/imports/command.py +539 -0
  56. pumpkin_api/wit_files/wit_world/imports/common.py +213 -0
  57. pumpkin_api/wit_files/wit_world/imports/context.py +70 -0
  58. pumpkin_api/wit_files/wit_world/imports/entity.py +84 -0
  59. pumpkin_api/wit_files/wit_world/imports/event.py +434 -0
  60. pumpkin_api/wit_files/wit_world/imports/gui.py +61 -0
  61. pumpkin_api/wit_files/wit_world/imports/i18n.py +35 -0
  62. pumpkin_api/wit_files/wit_world/imports/logging.py +30 -0
  63. pumpkin_api/wit_files/wit_world/imports/permission.py +71 -0
  64. pumpkin_api/wit_files/wit_world/imports/player.py +350 -0
  65. pumpkin_api/wit_files/wit_world/imports/scheduler.py +44 -0
  66. pumpkin_api/wit_files/wit_world/imports/scoreboard.py +95 -0
  67. pumpkin_api/wit_files/wit_world/imports/server.py +75 -0
  68. pumpkin_api/wit_files/wit_world/imports/text.py +89 -0
  69. pumpkin_api/wit_files/wit_world/imports/world.py +215 -0
  70. pumpkin_api/wit_files/world.wit +169 -0
  71. pumpkin_api_py-0.1.0.dev0.dist-info/METADATA +58 -0
  72. pumpkin_api_py-0.1.0.dev0.dist-info/RECORD +75 -0
  73. pumpkin_api_py-0.1.0.dev0.dist-info/WHEEL +4 -0
  74. pumpkin_api_py-0.1.0.dev0.dist-info/entry_points.txt +2 -0
  75. pumpkin_api_py-0.1.0.dev0.dist-info/licenses/LICENSE +677 -0
@@ -0,0 +1,434 @@
1
+ # This file is automatically generated by componentize-py
2
+ # It is not intended for manual editing.
3
+ from typing import TypeVar, Generic, Union, Optional, Protocol, Tuple, List, Any, Self, Callable
4
+ from types import TracebackType
5
+ from enum import Flag, Enum, auto
6
+ from dataclasses import dataclass
7
+ from abc import abstractmethod
8
+ import weakref
9
+
10
+ from componentize_py_types import Result, Ok, Err, Some
11
+ from ..imports import common
12
+ from ..imports import text
13
+ from ..imports import world
14
+ from ..imports import player
15
+
16
+ class EventPriority(Enum):
17
+ HIGHEST = 0
18
+ HIGH = 1
19
+ NORMAL = 2
20
+ LOW = 3
21
+ LOWEST = 4
22
+
23
+ @dataclass
24
+ class PlayerJoinEventData:
25
+ player: player.Player
26
+ join_message: text.TextComponent
27
+ cancelled: bool
28
+
29
+ @dataclass
30
+ class PlayerLeaveEventData:
31
+ player: player.Player
32
+ leave_message: text.TextComponent
33
+ cancelled: bool
34
+
35
+ @dataclass
36
+ class PlayerLoginEventData:
37
+ player: player.Player
38
+ kick_message: text.TextComponent
39
+ cancelled: bool
40
+
41
+ @dataclass
42
+ class PlayerChatEventData:
43
+ player: player.Player
44
+ message: str
45
+ recipients: List[player.Player]
46
+ cancelled: bool
47
+
48
+ @dataclass
49
+ class PlayerCommandSendEventData:
50
+ player: player.Player
51
+ command: str
52
+ cancelled: bool
53
+
54
+ @dataclass
55
+ class PlayerPermissionCheckEventData:
56
+ player: player.Player
57
+ permission: str
58
+ permission_result: bool
59
+
60
+ @dataclass
61
+ class PlayerMoveEventData:
62
+ player: player.Player
63
+ from_position: Tuple[float, float, float]
64
+ to_position: Tuple[float, float, float]
65
+ cancelled: bool
66
+
67
+ @dataclass
68
+ class PlayerTeleportEventData:
69
+ player: player.Player
70
+ from_position: Tuple[float, float, float]
71
+ to_position: Tuple[float, float, float]
72
+ cancelled: bool
73
+
74
+ @dataclass
75
+ class PlayerChangeWorldEventData:
76
+ player: player.Player
77
+ previous_world: world.World
78
+ new_world: world.World
79
+ position: Tuple[float, float, float]
80
+ yaw: float
81
+ pitch: float
82
+ cancelled: bool
83
+
84
+ @dataclass
85
+ class PlayerExpChangeEventData:
86
+ player: player.Player
87
+ amount: int
88
+
89
+ @dataclass
90
+ class PlayerItemHeldEventData:
91
+ player: player.Player
92
+ previous_slot: int
93
+ new_slot: int
94
+ cancelled: bool
95
+
96
+ @dataclass
97
+ class PlayerChangedMainHandEventData:
98
+ player: player.Player
99
+ main_hand: common.Hand
100
+
101
+ @dataclass
102
+ class PlayerGamemodeChangeEventData:
103
+ player: player.Player
104
+ previous_gamemode: common.GameMode
105
+ new_gamemode: common.GameMode
106
+ cancelled: bool
107
+
108
+ @dataclass
109
+ class PlayerCustomPayloadEventData:
110
+ player: player.Player
111
+ channel: str
112
+ data: bytes
113
+
114
+ class PlayerFishState(Enum):
115
+ FISHING = 0
116
+ CAUGHT_FISH = 1
117
+ CAUGHT_ENTITY = 2
118
+ IN_GROUND = 3
119
+ FAILED_ATTEMPT = 4
120
+ REEL_IN = 5
121
+ BITE = 6
122
+
123
+ @dataclass
124
+ class PlayerFishEventData:
125
+ player: player.Player
126
+ caught_uuid: Optional[str]
127
+ caught_type: str
128
+ hook_uuid: str
129
+ state: PlayerFishState
130
+ hand: common.Hand
131
+ exp_to_drop: int
132
+ cancelled: bool
133
+
134
+ @dataclass
135
+ class PlayerEggThrowEventData:
136
+ player: player.Player
137
+ egg_uuid: str
138
+ hatching: bool
139
+ num_hatches: int
140
+ hatching_type: str
141
+ cancelled: bool
142
+
143
+ class EntityInteractionAction(Enum):
144
+ INTERACT = 0
145
+ ATTACK = 1
146
+ INTERACT_AT = 2
147
+
148
+ class InteractAction(Enum):
149
+ LEFT_CLICK_BLOCK = 0
150
+ LEFT_CLICK_AIR = 1
151
+ RIGHT_CLICK_AIR = 2
152
+ RIGHT_CLICK_BLOCK = 3
153
+
154
+ @dataclass
155
+ class PlayerInteractEventData:
156
+ player: player.Player
157
+ action: InteractAction
158
+ clicked_pos: Optional[Tuple[int, int, int]]
159
+ item: common.ItemStack
160
+ block: str
161
+ cancelled: bool
162
+
163
+ @dataclass
164
+ class PlayerToggleSneakEventData:
165
+ player: player.Player
166
+ is_sneaking: bool
167
+ cancelled: bool
168
+
169
+ @dataclass
170
+ class PlayerToggleSprintEventData:
171
+ player: player.Player
172
+ is_sprinting: bool
173
+ cancelled: bool
174
+
175
+ @dataclass
176
+ class PlayerInteractUnknownEntityEventData:
177
+ player: player.Player
178
+ entity_id: int
179
+ action: EntityInteractionAction
180
+ cancelled: bool
181
+
182
+ @dataclass
183
+ class BlockRedstoneEventData:
184
+ target_world: world.World
185
+ state_id: int
186
+ block_position: Tuple[int, int, int]
187
+ old_current: int
188
+ new_current: int
189
+ cancelled: bool
190
+
191
+ @dataclass
192
+ class BlockBreakEventData:
193
+ player: Optional[player.Player]
194
+ block: str
195
+ block_position: Tuple[int, int, int]
196
+ exp: int
197
+ should_drop: bool
198
+ cancelled: bool
199
+
200
+ @dataclass
201
+ class BlockBurnEventData:
202
+ igniting_block: str
203
+ block: str
204
+ cancelled: bool
205
+
206
+ @dataclass
207
+ class BlockCanBuildEventData:
208
+ block_to_build: str
209
+ buildable: bool
210
+ player: player.Player
211
+ block: str
212
+ cancelled: bool
213
+
214
+ @dataclass
215
+ class BlockGrowEventData:
216
+ target_world: world.World
217
+ old_block: str
218
+ old_state_id: int
219
+ new_block: str
220
+ new_state_id: int
221
+ block_position: Tuple[int, int, int]
222
+ cancelled: bool
223
+
224
+ @dataclass
225
+ class BlockPlaceEventData:
226
+ player: player.Player
227
+ block_placed: str
228
+ block_placed_against: str
229
+ block_position: Tuple[int, int, int]
230
+ can_build: bool
231
+ cancelled: bool
232
+
233
+ @dataclass
234
+ class ServerCommandEventData:
235
+ command: str
236
+ cancelled: bool
237
+
238
+ @dataclass
239
+ class SpawnChangeEventData:
240
+ target_world: world.World
241
+ previous_position: Tuple[int, int, int]
242
+ previous_yaw: float
243
+ previous_pitch: float
244
+ new_position: Tuple[int, int, int]
245
+ new_yaw: float
246
+ new_pitch: float
247
+
248
+ @dataclass
249
+ class ServerBroadcastEventData:
250
+ message: text.TextComponent
251
+ sender: text.TextComponent
252
+ cancelled: bool
253
+
254
+ class EventType(Enum):
255
+ PLAYER_JOIN_EVENT = 0
256
+ PLAYER_LEAVE_EVENT = 1
257
+ PLAYER_LOGIN_EVENT = 2
258
+ PLAYER_CHAT_EVENT = 3
259
+ PLAYER_COMMAND_SEND_EVENT = 4
260
+ PLAYER_PERMISSION_CHECK_EVENT = 5
261
+ PLAYER_MOVE_EVENT = 6
262
+ PLAYER_TELEPORT_EVENT = 7
263
+ PLAYER_CHANGE_WORLD_EVENT = 8
264
+ PLAYER_EXP_CHANGE_EVENT = 9
265
+ PLAYER_ITEM_HELD_EVENT = 10
266
+ PLAYER_CHANGED_MAIN_HAND_EVENT = 11
267
+ PLAYER_GAMEMODE_CHANGE_EVENT = 12
268
+ PLAYER_CUSTOM_PAYLOAD_EVENT = 13
269
+ PLAYER_FISH_EVENT = 14
270
+ PLAYER_EGG_THROW_EVENT = 15
271
+ PLAYER_INTERACT_UNKNOWN_ENTITY_EVENT = 16
272
+ PLAYER_INTERACT_EVENT = 17
273
+ PLAYER_TOGGLE_SNEAK_EVENT = 18
274
+ PLAYER_TOGGLE_SPRINT_EVENT = 19
275
+ BLOCK_REDSTONE_EVENT = 20
276
+ BLOCK_BREAK_EVENT = 21
277
+ BLOCK_BURN_EVENT = 22
278
+ BLOCK_CAN_BUILD_EVENT = 23
279
+ BLOCK_GROW_EVENT = 24
280
+ BLOCK_PLACE_EVENT = 25
281
+ SERVER_COMMAND_EVENT = 26
282
+ SPAWN_CHANGE_EVENT = 27
283
+ SERVER_BROADCAST_EVENT = 28
284
+
285
+
286
+ @dataclass
287
+ class Event_PlayerJoinEvent:
288
+ value: PlayerJoinEventData
289
+
290
+
291
+ @dataclass
292
+ class Event_PlayerLeaveEvent:
293
+ value: PlayerLeaveEventData
294
+
295
+
296
+ @dataclass
297
+ class Event_PlayerLoginEvent:
298
+ value: PlayerLoginEventData
299
+
300
+
301
+ @dataclass
302
+ class Event_PlayerChatEvent:
303
+ value: PlayerChatEventData
304
+
305
+
306
+ @dataclass
307
+ class Event_PlayerCommandSendEvent:
308
+ value: PlayerCommandSendEventData
309
+
310
+
311
+ @dataclass
312
+ class Event_PlayerPermissionCheckEvent:
313
+ value: PlayerPermissionCheckEventData
314
+
315
+
316
+ @dataclass
317
+ class Event_PlayerMoveEvent:
318
+ value: PlayerMoveEventData
319
+
320
+
321
+ @dataclass
322
+ class Event_PlayerTeleportEvent:
323
+ value: PlayerTeleportEventData
324
+
325
+
326
+ @dataclass
327
+ class Event_PlayerChangeWorldEvent:
328
+ value: PlayerChangeWorldEventData
329
+
330
+
331
+ @dataclass
332
+ class Event_PlayerExpChangeEvent:
333
+ value: PlayerExpChangeEventData
334
+
335
+
336
+ @dataclass
337
+ class Event_PlayerItemHeldEvent:
338
+ value: PlayerItemHeldEventData
339
+
340
+
341
+ @dataclass
342
+ class Event_PlayerChangedMainHandEvent:
343
+ value: PlayerChangedMainHandEventData
344
+
345
+
346
+ @dataclass
347
+ class Event_PlayerGamemodeChangeEvent:
348
+ value: PlayerGamemodeChangeEventData
349
+
350
+
351
+ @dataclass
352
+ class Event_PlayerCustomPayloadEvent:
353
+ value: PlayerCustomPayloadEventData
354
+
355
+
356
+ @dataclass
357
+ class Event_PlayerFishEvent:
358
+ value: PlayerFishEventData
359
+
360
+
361
+ @dataclass
362
+ class Event_PlayerEggThrowEvent:
363
+ value: PlayerEggThrowEventData
364
+
365
+
366
+ @dataclass
367
+ class Event_PlayerInteractUnknownEntityEvent:
368
+ value: PlayerInteractUnknownEntityEventData
369
+
370
+
371
+ @dataclass
372
+ class Event_PlayerInteractEvent:
373
+ value: PlayerInteractEventData
374
+
375
+
376
+ @dataclass
377
+ class Event_PlayerToggleSneakEvent:
378
+ value: PlayerToggleSneakEventData
379
+
380
+
381
+ @dataclass
382
+ class Event_PlayerToggleSprintEvent:
383
+ value: PlayerToggleSprintEventData
384
+
385
+
386
+ @dataclass
387
+ class Event_BlockRedstoneEvent:
388
+ value: BlockRedstoneEventData
389
+
390
+
391
+ @dataclass
392
+ class Event_BlockBreakEvent:
393
+ value: BlockBreakEventData
394
+
395
+
396
+ @dataclass
397
+ class Event_BlockBurnEvent:
398
+ value: BlockBurnEventData
399
+
400
+
401
+ @dataclass
402
+ class Event_BlockCanBuildEvent:
403
+ value: BlockCanBuildEventData
404
+
405
+
406
+ @dataclass
407
+ class Event_BlockGrowEvent:
408
+ value: BlockGrowEventData
409
+
410
+
411
+ @dataclass
412
+ class Event_BlockPlaceEvent:
413
+ value: BlockPlaceEventData
414
+
415
+
416
+ @dataclass
417
+ class Event_ServerCommandEvent:
418
+ value: ServerCommandEventData
419
+
420
+
421
+ @dataclass
422
+ class Event_SpawnChangeEvent:
423
+ value: SpawnChangeEventData
424
+
425
+
426
+ @dataclass
427
+ class Event_ServerBroadcastEvent:
428
+ value: ServerBroadcastEventData
429
+
430
+
431
+ Event = Union[Event_PlayerJoinEvent, Event_PlayerLeaveEvent, Event_PlayerLoginEvent, Event_PlayerChatEvent, Event_PlayerCommandSendEvent, Event_PlayerPermissionCheckEvent, Event_PlayerMoveEvent, Event_PlayerTeleportEvent, Event_PlayerChangeWorldEvent, Event_PlayerExpChangeEvent, Event_PlayerItemHeldEvent, Event_PlayerChangedMainHandEvent, Event_PlayerGamemodeChangeEvent, Event_PlayerCustomPayloadEvent, Event_PlayerFishEvent, Event_PlayerEggThrowEvent, Event_PlayerInteractUnknownEntityEvent, Event_PlayerInteractEvent, Event_PlayerToggleSneakEvent, Event_PlayerToggleSprintEvent, Event_BlockRedstoneEvent, Event_BlockBreakEvent, Event_BlockBurnEvent, Event_BlockCanBuildEvent, Event_BlockGrowEvent, Event_BlockPlaceEvent, Event_ServerCommandEvent, Event_SpawnChangeEvent, Event_ServerBroadcastEvent]
432
+
433
+
434
+
@@ -0,0 +1,61 @@
1
+ # This file is automatically generated by componentize-py
2
+ # It is not intended for manual editing.
3
+ from typing import TypeVar, Generic, Union, Optional, Protocol, Tuple, List, Any, Self, Callable
4
+ from types import TracebackType
5
+ from enum import Flag, Enum, auto
6
+ from dataclasses import dataclass
7
+ from abc import abstractmethod
8
+ import weakref
9
+
10
+ from componentize_py_types import Result, Ok, Err, Some
11
+ from ..imports import common
12
+ from ..imports import text
13
+
14
+ class GuiType(Enum):
15
+ GENERIC_9X1 = 0
16
+ GENERIC_9X2 = 1
17
+ GENERIC_9X3 = 2
18
+ GENERIC_9X4 = 3
19
+ GENERIC_9X5 = 4
20
+ GENERIC_9X6 = 5
21
+ GENERIC_3X3 = 6
22
+ CRAFTER_3X3 = 7
23
+ ANVIL = 8
24
+ BEACON = 9
25
+ BLAST_FURNACE = 10
26
+ BREWING_STAND = 11
27
+ CRAFTING = 12
28
+ ENCHANTMENT = 13
29
+ FURNACE = 14
30
+ GRINDSTONE = 15
31
+ HOPPER = 16
32
+ LECTERN = 17
33
+ LOOM = 18
34
+ MERCHANT = 19
35
+ SHULKER_BOX = 20
36
+ SMITHING = 21
37
+ SMOKER = 22
38
+ CARTOGRAPHY_TABLE = 23
39
+ STONECUTTER = 24
40
+
41
+ class Gui:
42
+
43
+ def __init__(self, type: GuiType, title: text.TextComponent) -> None:
44
+ raise NotImplementedError
45
+
46
+ def set_item(self, slot: int, item: common.ItemStack) -> None:
47
+ raise NotImplementedError
48
+ def get_item(self, slot: int) -> Optional[common.ItemStack]:
49
+ raise NotImplementedError
50
+ def __enter__(self) -> Self:
51
+ """Returns self"""
52
+ return self
53
+
54
+ def __exit__(self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None) -> bool | None:
55
+ """
56
+ Release this resource.
57
+ """
58
+ raise NotImplementedError
59
+
60
+
61
+
@@ -0,0 +1,35 @@
1
+ # This file is automatically generated by componentize-py
2
+ # It is not intended for manual editing.
3
+ from typing import TypeVar, Generic, Union, Optional, Protocol, Tuple, List, Any, Self, Callable
4
+ from types import TracebackType
5
+ from enum import Flag, Enum, auto
6
+ from dataclasses import dataclass
7
+ from abc import abstractmethod
8
+ import weakref
9
+
10
+ from componentize_py_types import Result, Ok, Err, Some
11
+ from ..imports import common
12
+
13
+
14
+ def translate(key: str, locale: common.Locale) -> str:
15
+ """
16
+ Retrieves a translated string from the host.
17
+
18
+ # Arguments
19
+ * `key`: The namespaced translation key (e.g. `pumpkin:my_key`).
20
+ * `locale`: The target locale.
21
+
22
+ # Returns
23
+ The localized string, falling back to English or the key itself.
24
+ """
25
+ raise NotImplementedError
26
+ def load_translations(namespace: str, json: str, locale: common.Locale) -> None:
27
+ """
28
+ Loads custom translations from a JSON string.
29
+
30
+ # Arguments
31
+ * `namespace`: The namespace to associate these keys with.
32
+ * `json`: A JSON string containing a flat map of translations.
33
+ * `locale`: The target locale for these translations.
34
+ """
35
+ raise NotImplementedError
@@ -0,0 +1,30 @@
1
+ # This file is automatically generated by componentize-py
2
+ # It is not intended for manual editing.
3
+ from typing import TypeVar, Generic, Union, Optional, Protocol, Tuple, List, Any, Self, Callable
4
+ from types import TracebackType
5
+ from enum import Flag, Enum, auto
6
+ from dataclasses import dataclass
7
+ from abc import abstractmethod
8
+ import weakref
9
+
10
+ from componentize_py_types import Result, Ok, Err, Some
11
+
12
+
13
+ class Level(Enum):
14
+ TRACE = 0
15
+ DEBUG = 1
16
+ INFO = 2
17
+ WARN = 3
18
+ ERROR = 4
19
+
20
+
21
+ def log(level: Level, message: str) -> None:
22
+ """
23
+ log any general purpose message
24
+ """
25
+ raise NotImplementedError
26
+ def log_tracing(event: bytes) -> None:
27
+ """
28
+ This function is meant to be used by the tracing crate.
29
+ """
30
+ raise NotImplementedError
@@ -0,0 +1,71 @@
1
+ # This file is automatically generated by componentize-py
2
+ # It is not intended for manual editing.
3
+ from typing import TypeVar, Generic, Union, Optional, Protocol, Tuple, List, Any, Self, Callable
4
+ from types import TracebackType
5
+ from enum import Flag, Enum, auto
6
+ from dataclasses import dataclass
7
+ from abc import abstractmethod
8
+ import weakref
9
+
10
+ from componentize_py_types import Result, Ok, Err, Some
11
+
12
+
13
+ class PermissionLevel(Enum):
14
+ """
15
+ Represents the player's permission level
16
+
17
+ Permission levels determine the player's access to commands and server operations.
18
+ Each numeric level corresponds to a specific role:
19
+ - `Zero`: `normal`: Player can use basic commands.
20
+ - `One`: `moderator`: Player can bypass spawn protection.
21
+ - `Two`: `gamemaster`: Player or executor can use more commands and player can use command blocks.
22
+ - `Three`: `admin`: Player or executor can use commands related to multiplayer management.
23
+ - `Four`: `owner`: Player or executor can use all of the commands, including commands related to server management.
24
+ """
25
+ ZERO = 0
26
+ ONE = 1
27
+ TWO = 2
28
+ THREE = 3
29
+ FOUR = 4
30
+
31
+
32
+ @dataclass
33
+ class PermissionDefault_Deny:
34
+ pass
35
+
36
+
37
+ @dataclass
38
+ class PermissionDefault_Allow:
39
+ pass
40
+
41
+
42
+ @dataclass
43
+ class PermissionDefault_Op:
44
+ value: PermissionLevel
45
+
46
+
47
+ PermissionDefault = Union[PermissionDefault_Deny, PermissionDefault_Allow, PermissionDefault_Op]
48
+ """
49
+ Describes the default behavior for permissions
50
+ """
51
+
52
+
53
+ @dataclass
54
+ class PermissionChild:
55
+ """
56
+ A child permission entry
57
+ """
58
+ node: str
59
+ value: bool
60
+
61
+ @dataclass
62
+ class Permission:
63
+ """
64
+ Defines a permission node in the system
65
+ """
66
+ node: str
67
+ description: str
68
+ default: PermissionDefault
69
+ children: List[PermissionChild]
70
+
71
+