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,213 @@
1
+ # This file is automatically generated by componentize-py
2
+ # It is not intended for manual editing.
3
+ """
4
+ Provides common types and utilities used across the entire plugin API.
5
+ """
6
+ from typing import TypeVar, Generic, Union, Optional, Protocol, Tuple, List, Any, Self, Callable
7
+ from types import TracebackType
8
+ from enum import Flag, Enum, auto
9
+ from dataclasses import dataclass
10
+ from abc import abstractmethod
11
+ import weakref
12
+
13
+ from componentize_py_types import Result, Ok, Err, Some
14
+
15
+
16
+ class Hand(Enum):
17
+ """
18
+ Represents the hands of a player.
19
+ """
20
+ LEFT = 0
21
+ RIGHT = 1
22
+
23
+ class GameMode(Enum):
24
+ """
25
+ Represents the game modes available in Minecraft.
26
+ """
27
+ SURVIVAL = 0
28
+ CREATIVE = 1
29
+ ADVENTURE = 2
30
+ SPECTATOR = 3
31
+
32
+ class NamedColor(Enum):
33
+ """
34
+ The 16 base Minecraft colors.
35
+ """
36
+ BLACK = 0
37
+ DARK_BLUE = 1
38
+ DARK_GREEN = 2
39
+ DARK_AQUA = 3
40
+ DARK_RED = 4
41
+ DARK_PURPLE = 5
42
+ GOLD = 6
43
+ GRAY = 7
44
+ DARK_GRAY = 8
45
+ BLUE = 9
46
+ GREEN = 10
47
+ AQUA = 11
48
+ RED = 12
49
+ LIGHT_PURPLE = 13
50
+ YELLOW = 14
51
+ WHITE = 15
52
+
53
+ @dataclass
54
+ class RgbColor:
55
+ """
56
+ An RGB color represented by its red, green, and blue components.
57
+ """
58
+ r: int
59
+ g: int
60
+ b: int
61
+
62
+ @dataclass
63
+ class ArgbColor:
64
+ """
65
+ An ARGB color with alpha (transparency) channel.
66
+ """
67
+ a: int
68
+ r: int
69
+ g: int
70
+ b: int
71
+
72
+ @dataclass
73
+ class ItemStack:
74
+ """
75
+ Represents a stack of items with its type and count.
76
+ """
77
+ registry_key: str
78
+ count: int
79
+
80
+ class Locale(Enum):
81
+ """
82
+ All Minecraft-supported locales.
83
+ """
84
+ AF_ZA = 0
85
+ AR_SA = 1
86
+ AST_ES = 2
87
+ AZ_AZ = 3
88
+ BA_RU = 4
89
+ BAR = 5
90
+ BE_BY = 6
91
+ BG_BG = 7
92
+ BR_FR = 8
93
+ BRB = 9
94
+ BS_BA = 10
95
+ CA_ES = 11
96
+ CS_CZ = 12
97
+ CY_GB = 13
98
+ DA_DK = 14
99
+ DE_AT = 15
100
+ DE_CH = 16
101
+ DE_DE = 17
102
+ EL_GR = 18
103
+ EN_AU = 19
104
+ EN_CA = 20
105
+ EN_GB = 21
106
+ EN_NZ = 22
107
+ EN_PT = 23
108
+ EN_UD = 24
109
+ EN_US = 25
110
+ ENP = 26
111
+ ENWS = 27
112
+ EO_UY = 28
113
+ ES_AR = 29
114
+ ES_CL = 30
115
+ ES_EC = 31
116
+ ES_ES = 32
117
+ ES_MX = 33
118
+ ES_UY = 34
119
+ ES_VE = 35
120
+ ESAN = 36
121
+ ET_EE = 37
122
+ EU_ES = 38
123
+ FA_IR = 39
124
+ FI_FI = 40
125
+ FIL_PH = 41
126
+ FO_FO = 42
127
+ FR_CA = 43
128
+ FR_FR = 44
129
+ FRA_DE = 45
130
+ FUR_IT = 46
131
+ FY_NL = 47
132
+ GA_IE = 48
133
+ GD_GB = 49
134
+ GL_ES = 50
135
+ HAW_US = 51
136
+ HE_IL = 52
137
+ HI_IN = 53
138
+ HR_HR = 54
139
+ HU_HU = 55
140
+ HY_AM = 56
141
+ ID_ID = 57
142
+ IG_NG = 58
143
+ IO_EN = 59
144
+ IS_IS = 60
145
+ ISV = 61
146
+ IT_IT = 62
147
+ JA_JP = 63
148
+ JBO_EN = 64
149
+ KA_GE = 65
150
+ KK_KZ = 66
151
+ KN_IN = 67
152
+ KO_KR = 68
153
+ KSH = 69
154
+ KW_GB = 70
155
+ LA_LA = 71
156
+ LB_LU = 72
157
+ LI_LI = 73
158
+ LMO = 74
159
+ LO_LA = 75
160
+ LOL_US = 76
161
+ LT_LT = 77
162
+ LV_LV = 78
163
+ LZH = 79
164
+ MK_MK = 80
165
+ MN_MN = 81
166
+ MS_MY = 82
167
+ MT_MT = 83
168
+ NAH = 84
169
+ NDS_DE = 85
170
+ NL_BE = 86
171
+ NL_NL = 87
172
+ NN_NO = 88
173
+ NO_NO = 89
174
+ OC_FR = 90
175
+ OVD = 91
176
+ PL_PL = 92
177
+ PT_BR = 93
178
+ PT_PT = 94
179
+ QYA_AA = 95
180
+ RO_RO = 96
181
+ RPR = 97
182
+ RU_RU = 98
183
+ RY_UA = 99
184
+ SAH_SAH = 100
185
+ SE_NO = 101
186
+ SK_SK = 102
187
+ SL_SI = 103
188
+ SO_SO = 104
189
+ SQ_AL = 105
190
+ SR_CS = 106
191
+ SR_SP = 107
192
+ SV_SE = 108
193
+ SXU = 109
194
+ SZL = 110
195
+ TA_IN = 111
196
+ TH_TH = 112
197
+ TL_PH = 113
198
+ TLH_AA = 114
199
+ TOK = 115
200
+ TR_TR = 116
201
+ TT_RU = 117
202
+ UK_UA = 118
203
+ VAL_ES = 119
204
+ VEC_IT = 120
205
+ VI_VN = 121
206
+ YI_DE = 122
207
+ YO_NG = 123
208
+ ZH_CN = 124
209
+ ZH_HK = 125
210
+ ZH_TW = 126
211
+ ZLM_ARAB = 127
212
+
213
+
@@ -0,0 +1,70 @@
1
+ # This file is automatically generated by componentize-py
2
+ # It is not intended for manual editing.
3
+ """
4
+ The core context provided to a plugin during initialization and event handling.
5
+ """
6
+ from typing import TypeVar, Generic, Union, Optional, Protocol, Tuple, List, Any, Self, Callable
7
+ from types import TracebackType
8
+ from enum import Flag, Enum, auto
9
+ from dataclasses import dataclass
10
+ from abc import abstractmethod
11
+ import weakref
12
+
13
+ from componentize_py_types import Result, Ok, Err, Some
14
+ from ..imports import permission
15
+ from ..imports import event
16
+ from ..imports import server
17
+ from ..imports import command
18
+
19
+ class Context:
20
+ """
21
+ A contextual handle for plugin-related operations.
22
+ """
23
+
24
+ def register_event(self, handler_id: int, event_type: event.EventType, event_priority: event.EventPriority, blocking: bool) -> None:
25
+ """
26
+ Registers a handler for a specific event.
27
+
28
+ * `handler-id`: Unique ID for the event handler.
29
+ * `event-type`: The type of event to listen for.
30
+ * `event-priority`: When this handler should be called relative to others.
31
+ * `blocking`: Whether the event should wait for this handler to finish.
32
+ """
33
+ raise NotImplementedError
34
+ def register_command(self, command: command.Command, permission: str) -> None:
35
+ """
36
+ Registers a new command.
37
+
38
+ * `command`: The command definition.
39
+ * `permission`: The required permission node to execute this command.
40
+ """
41
+ raise NotImplementedError
42
+ def register_permission(self, permission: permission.Permission) -> None:
43
+ """
44
+ Registers a permission node with the server.
45
+
46
+ Raises: `componentize_py_types.Err(wit_world.imports.str)`
47
+ """
48
+ raise NotImplementedError
49
+ def get_data_folder(self) -> str:
50
+ """
51
+ Returns the path to the plugin's private data folder.
52
+ """
53
+ raise NotImplementedError
54
+ def get_server(self) -> server.Server:
55
+ """
56
+ Returns the global server instance.
57
+ """
58
+ raise NotImplementedError
59
+ def __enter__(self) -> Self:
60
+ """Returns self"""
61
+ return self
62
+
63
+ def __exit__(self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None) -> bool | None:
64
+ """
65
+ Release this resource.
66
+ """
67
+ raise NotImplementedError
68
+
69
+
70
+
@@ -0,0 +1,84 @@
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 BlockEntity:
14
+
15
+ def resource_location(self) -> str:
16
+ raise NotImplementedError
17
+ def get_position(self) -> Tuple[int, int, int]:
18
+ raise NotImplementedError
19
+ def get_id(self) -> int:
20
+ raise NotImplementedError
21
+ def is_dirty(self) -> bool:
22
+ """
23
+ write-nbt: func(nbt: nbt-compound);
24
+ from-nbt: func(nbt: nbt-compound, position: block-position) -> entity;
25
+ tick: func(world: simple-world);
26
+ write-internal: func(nbt: nbt-compound);
27
+ chunk-data-nbt: func() -> option<nbt-compound;
28
+ get-inventory: func() -> option<inventory>;
29
+ set-block-state: func(block-state: block-state-id);
30
+ on-block-replaced: func(world: simple-world, position: block-position);
31
+ """
32
+ raise NotImplementedError
33
+ def clear_dirty(self) -> None:
34
+ raise NotImplementedError
35
+ def __enter__(self) -> Self:
36
+ """Returns self"""
37
+ return self
38
+
39
+ def __exit__(self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None) -> bool | None:
40
+ """
41
+ Release this resource.
42
+ """
43
+ raise NotImplementedError
44
+
45
+
46
+ class CommandBlockEntity:
47
+
48
+ def get_block_entity(self) -> BlockEntity:
49
+ raise NotImplementedError
50
+ def last_output(self) -> str:
51
+ raise NotImplementedError
52
+ def track_output(self) -> bool:
53
+ raise NotImplementedError
54
+ def success_count(self) -> int:
55
+ raise NotImplementedError
56
+ def command(self) -> str:
57
+ raise NotImplementedError
58
+ def auto(self) -> bool:
59
+ raise NotImplementedError
60
+ def condition_met(self) -> bool:
61
+ raise NotImplementedError
62
+ def powered(self) -> bool:
63
+ raise NotImplementedError
64
+ def __enter__(self) -> Self:
65
+ """Returns self"""
66
+ return self
67
+
68
+ def __exit__(self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None) -> bool | None:
69
+ """
70
+ Release this resource.
71
+ """
72
+ raise NotImplementedError
73
+
74
+
75
+
76
+ @dataclass
77
+ class Entity_CommandBlockEntity:
78
+ value: CommandBlockEntity
79
+
80
+
81
+ Entity = Union[Entity_CommandBlockEntity]
82
+
83
+
84
+