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.
- pumpkin_api/__init__.py +139 -0
- pumpkin_api/app.py +8 -0
- pumpkin_api/build.py +35 -0
- pumpkin_api/wit/componentize_py_async_support/__init__.py +529 -0
- pumpkin_api/wit/componentize_py_async_support/futures.py +93 -0
- pumpkin_api/wit/componentize_py_async_support/streams.py +189 -0
- pumpkin_api/wit/componentize_py_runtime.pyi +34 -0
- pumpkin_api/wit/componentize_py_types.py +19 -0
- pumpkin_api/wit/poll_loop.py +440 -0
- pumpkin_api/wit/wit_world/__init__.py +70 -0
- pumpkin_api/wit/wit_world/exports/__init__.py +19 -0
- pumpkin_api/wit/wit_world/exports/metadata.py +22 -0
- pumpkin_api/wit/wit_world/imports/__init__.py +0 -0
- pumpkin_api/wit/wit_world/imports/command.py +539 -0
- pumpkin_api/wit/wit_world/imports/common.py +213 -0
- pumpkin_api/wit/wit_world/imports/context.py +70 -0
- pumpkin_api/wit/wit_world/imports/entity.py +84 -0
- pumpkin_api/wit/wit_world/imports/event.py +434 -0
- pumpkin_api/wit/wit_world/imports/gui.py +61 -0
- pumpkin_api/wit/wit_world/imports/i18n.py +35 -0
- pumpkin_api/wit/wit_world/imports/logging.py +30 -0
- pumpkin_api/wit/wit_world/imports/permission.py +71 -0
- pumpkin_api/wit/wit_world/imports/player.py +350 -0
- pumpkin_api/wit/wit_world/imports/scheduler.py +44 -0
- pumpkin_api/wit/wit_world/imports/scoreboard.py +95 -0
- pumpkin_api/wit/wit_world/imports/server.py +75 -0
- pumpkin_api/wit/wit_world/imports/text.py +89 -0
- pumpkin_api/wit/wit_world/imports/world.py +215 -0
- pumpkin_api/wit_files/command.wit +189 -0
- pumpkin_api/wit_files/common.wit +201 -0
- pumpkin_api/wit_files/componentize_py_async_support/__init__.py +529 -0
- pumpkin_api/wit_files/componentize_py_async_support/futures.py +93 -0
- pumpkin_api/wit_files/componentize_py_async_support/streams.py +189 -0
- pumpkin_api/wit_files/componentize_py_runtime.pyi +34 -0
- pumpkin_api/wit_files/componentize_py_types.py +19 -0
- pumpkin_api/wit_files/context.wit +33 -0
- pumpkin_api/wit_files/entity.wit +36 -0
- pumpkin_api/wit_files/event.wit +311 -0
- pumpkin_api/wit_files/gui.wit +38 -0
- pumpkin_api/wit_files/i18n.wit +21 -0
- pumpkin_api/wit_files/log.wit +14 -0
- pumpkin_api/wit_files/metadata.wit +15 -0
- pumpkin_api/wit_files/permission.wit +46 -0
- pumpkin_api/wit_files/player.wit +172 -0
- pumpkin_api/wit_files/plugin.wit +61 -0
- pumpkin_api/wit_files/poll_loop.py +440 -0
- pumpkin_api/wit_files/scheduler.wit +24 -0
- pumpkin_api/wit_files/scoreboard.wit +72 -0
- pumpkin_api/wit_files/server.wit +41 -0
- pumpkin_api/wit_files/text.wit +41 -0
- pumpkin_api/wit_files/wit_world/__init__.py +70 -0
- pumpkin_api/wit_files/wit_world/exports/__init__.py +19 -0
- pumpkin_api/wit_files/wit_world/exports/metadata.py +22 -0
- pumpkin_api/wit_files/wit_world/imports/__init__.py +0 -0
- pumpkin_api/wit_files/wit_world/imports/command.py +539 -0
- pumpkin_api/wit_files/wit_world/imports/common.py +213 -0
- pumpkin_api/wit_files/wit_world/imports/context.py +70 -0
- pumpkin_api/wit_files/wit_world/imports/entity.py +84 -0
- pumpkin_api/wit_files/wit_world/imports/event.py +434 -0
- pumpkin_api/wit_files/wit_world/imports/gui.py +61 -0
- pumpkin_api/wit_files/wit_world/imports/i18n.py +35 -0
- pumpkin_api/wit_files/wit_world/imports/logging.py +30 -0
- pumpkin_api/wit_files/wit_world/imports/permission.py +71 -0
- pumpkin_api/wit_files/wit_world/imports/player.py +350 -0
- pumpkin_api/wit_files/wit_world/imports/scheduler.py +44 -0
- pumpkin_api/wit_files/wit_world/imports/scoreboard.py +95 -0
- pumpkin_api/wit_files/wit_world/imports/server.py +75 -0
- pumpkin_api/wit_files/wit_world/imports/text.py +89 -0
- pumpkin_api/wit_files/wit_world/imports/world.py +215 -0
- pumpkin_api/wit_files/world.wit +169 -0
- pumpkin_api_py-0.1.0.dev0.dist-info/METADATA +58 -0
- pumpkin_api_py-0.1.0.dev0.dist-info/RECORD +75 -0
- pumpkin_api_py-0.1.0.dev0.dist-info/WHEEL +4 -0
- pumpkin_api_py-0.1.0.dev0.dist-info/entry_points.txt +2 -0
- pumpkin_api_py-0.1.0.dev0.dist-info/licenses/LICENSE +677 -0
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
# This file is automatically generated by componentize-py
|
|
2
|
+
# It is not intended for manual editing.
|
|
3
|
+
"""
|
|
4
|
+
Represents a player connected to the Minecraft server.
|
|
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 common
|
|
15
|
+
from ..imports import permission
|
|
16
|
+
from ..imports import text
|
|
17
|
+
from ..imports import gui
|
|
18
|
+
from ..imports import world
|
|
19
|
+
|
|
20
|
+
@dataclass
|
|
21
|
+
class PlayerAbilities:
|
|
22
|
+
"""
|
|
23
|
+
Various abilities a player can have.
|
|
24
|
+
"""
|
|
25
|
+
invulnerable: bool
|
|
26
|
+
flying: bool
|
|
27
|
+
allow_flying: bool
|
|
28
|
+
creative: bool
|
|
29
|
+
allow_modify_world: bool
|
|
30
|
+
fly_speed: float
|
|
31
|
+
walk_speed: float
|
|
32
|
+
|
|
33
|
+
class Player:
|
|
34
|
+
"""
|
|
35
|
+
A handle to a player on the server.
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
def get_id(self) -> str:
|
|
39
|
+
"""
|
|
40
|
+
Returns the player's unique UUID as a string.
|
|
41
|
+
"""
|
|
42
|
+
raise NotImplementedError
|
|
43
|
+
def get_name(self) -> str:
|
|
44
|
+
"""
|
|
45
|
+
Returns the player's username.
|
|
46
|
+
"""
|
|
47
|
+
raise NotImplementedError
|
|
48
|
+
def get_position(self) -> Tuple[float, float, float]:
|
|
49
|
+
"""
|
|
50
|
+
Basic state
|
|
51
|
+
Returns the player's current position in the world.
|
|
52
|
+
"""
|
|
53
|
+
raise NotImplementedError
|
|
54
|
+
def get_yaw(self) -> float:
|
|
55
|
+
"""
|
|
56
|
+
Returns the player's current yaw (horizontal rotation).
|
|
57
|
+
"""
|
|
58
|
+
raise NotImplementedError
|
|
59
|
+
def get_pitch(self) -> float:
|
|
60
|
+
"""
|
|
61
|
+
Returns the player's current pitch (vertical rotation).
|
|
62
|
+
"""
|
|
63
|
+
raise NotImplementedError
|
|
64
|
+
def get_world(self) -> world.World:
|
|
65
|
+
"""
|
|
66
|
+
Returns the world the player is currently in.
|
|
67
|
+
"""
|
|
68
|
+
raise NotImplementedError
|
|
69
|
+
def get_gamemode(self) -> common.GameMode:
|
|
70
|
+
"""
|
|
71
|
+
Returns the player's current game mode.
|
|
72
|
+
"""
|
|
73
|
+
raise NotImplementedError
|
|
74
|
+
def set_gamemode(self, mode: common.GameMode) -> bool:
|
|
75
|
+
"""
|
|
76
|
+
Changes the player's game mode. Returns true if successful.
|
|
77
|
+
"""
|
|
78
|
+
raise NotImplementedError
|
|
79
|
+
def get_locale(self) -> str:
|
|
80
|
+
"""
|
|
81
|
+
Returns the player's locale (e.g., "en_us").
|
|
82
|
+
"""
|
|
83
|
+
raise NotImplementedError
|
|
84
|
+
def get_ping(self) -> int:
|
|
85
|
+
"""
|
|
86
|
+
Returns the player's current ping in milliseconds.
|
|
87
|
+
"""
|
|
88
|
+
raise NotImplementedError
|
|
89
|
+
def get_permission_level(self) -> permission.PermissionLevel:
|
|
90
|
+
"""
|
|
91
|
+
Permissions & metadata
|
|
92
|
+
Returns the player's permission level (0-4).
|
|
93
|
+
"""
|
|
94
|
+
raise NotImplementedError
|
|
95
|
+
def set_permission_level(self, level: permission.PermissionLevel) -> None:
|
|
96
|
+
"""
|
|
97
|
+
Sets the player's permission level.
|
|
98
|
+
"""
|
|
99
|
+
raise NotImplementedError
|
|
100
|
+
def has_permission(self, node: str) -> bool:
|
|
101
|
+
"""
|
|
102
|
+
Checks if the player has a specific permission node.
|
|
103
|
+
"""
|
|
104
|
+
raise NotImplementedError
|
|
105
|
+
def get_display_name(self) -> text.TextComponent:
|
|
106
|
+
"""
|
|
107
|
+
Returns the player's display name, which may include formatting.
|
|
108
|
+
"""
|
|
109
|
+
raise NotImplementedError
|
|
110
|
+
def send_system_message(self, text: text.TextComponent, overlay: bool) -> None:
|
|
111
|
+
"""
|
|
112
|
+
Messaging & titles
|
|
113
|
+
Sends a system message to the player's chat.
|
|
114
|
+
"""
|
|
115
|
+
raise NotImplementedError
|
|
116
|
+
def show_title(self, text: text.TextComponent) -> None:
|
|
117
|
+
"""
|
|
118
|
+
Shows a large title on the player's screen.
|
|
119
|
+
"""
|
|
120
|
+
raise NotImplementedError
|
|
121
|
+
def show_subtitle(self, text: text.TextComponent) -> None:
|
|
122
|
+
"""
|
|
123
|
+
Shows a smaller subtitle on the player's screen.
|
|
124
|
+
"""
|
|
125
|
+
raise NotImplementedError
|
|
126
|
+
def show_actionbar(self, text: text.TextComponent) -> None:
|
|
127
|
+
"""
|
|
128
|
+
Shows a message in the action bar area.
|
|
129
|
+
"""
|
|
130
|
+
raise NotImplementedError
|
|
131
|
+
def send_title_animation(self, fade_in: int, stay: int, fade_out: int) -> None:
|
|
132
|
+
"""
|
|
133
|
+
Sets the fade-in, stay, and fade-out times for titles.
|
|
134
|
+
"""
|
|
135
|
+
raise NotImplementedError
|
|
136
|
+
def teleport(self, position: Tuple[float, float, float], yaw: Optional[float], pitch: Optional[float], world: world.World) -> None:
|
|
137
|
+
"""
|
|
138
|
+
Teleport & kick
|
|
139
|
+
Teleports the player to a position in a world.
|
|
140
|
+
"""
|
|
141
|
+
raise NotImplementedError
|
|
142
|
+
def teleport_world(self, world_ref: world.World, position: Tuple[float, float, float], yaw: Optional[float], pitch: Optional[float]) -> None:
|
|
143
|
+
"""
|
|
144
|
+
Teleports the player to another world at a specific position.
|
|
145
|
+
"""
|
|
146
|
+
raise NotImplementedError
|
|
147
|
+
def kick(self, message: text.TextComponent) -> None:
|
|
148
|
+
"""
|
|
149
|
+
Kicks the player from the server with the specified reason.
|
|
150
|
+
"""
|
|
151
|
+
raise NotImplementedError
|
|
152
|
+
def respawn(self) -> None:
|
|
153
|
+
"""
|
|
154
|
+
Forces the player to respawn.
|
|
155
|
+
"""
|
|
156
|
+
raise NotImplementedError
|
|
157
|
+
def open_gui(self, gui_ref: gui.Gui) -> None:
|
|
158
|
+
"""
|
|
159
|
+
Opens a GUI for the player.
|
|
160
|
+
"""
|
|
161
|
+
raise NotImplementedError
|
|
162
|
+
def ban(self, reason: Optional[text.TextComponent]) -> None:
|
|
163
|
+
"""
|
|
164
|
+
Bans the player with an optional reason.
|
|
165
|
+
"""
|
|
166
|
+
raise NotImplementedError
|
|
167
|
+
def ban_ip(self, reason: Optional[text.TextComponent]) -> None:
|
|
168
|
+
"""
|
|
169
|
+
Bans the player's IP address with an optional reason.
|
|
170
|
+
"""
|
|
171
|
+
raise NotImplementedError
|
|
172
|
+
def get_selected_slot(self) -> int:
|
|
173
|
+
"""
|
|
174
|
+
Inventory
|
|
175
|
+
Returns the index of the currently selected hotbar slot (0-8).
|
|
176
|
+
"""
|
|
177
|
+
raise NotImplementedError
|
|
178
|
+
def get_item_in_hand(self, hand: common.Hand) -> Optional[common.ItemStack]:
|
|
179
|
+
"""
|
|
180
|
+
Returns the item currently in the specified hand.
|
|
181
|
+
"""
|
|
182
|
+
raise NotImplementedError
|
|
183
|
+
def get_inventory_item(self, slot: int) -> Optional[common.ItemStack]:
|
|
184
|
+
"""
|
|
185
|
+
Returns the item in the specified inventory slot.
|
|
186
|
+
"""
|
|
187
|
+
raise NotImplementedError
|
|
188
|
+
def get_health(self) -> float:
|
|
189
|
+
"""
|
|
190
|
+
Status
|
|
191
|
+
Returns the player's current health.
|
|
192
|
+
"""
|
|
193
|
+
raise NotImplementedError
|
|
194
|
+
def set_health(self, health: float) -> None:
|
|
195
|
+
"""
|
|
196
|
+
Sets the player's current health.
|
|
197
|
+
"""
|
|
198
|
+
raise NotImplementedError
|
|
199
|
+
def get_max_health(self) -> float:
|
|
200
|
+
"""
|
|
201
|
+
Returns the player's maximum health.
|
|
202
|
+
"""
|
|
203
|
+
raise NotImplementedError
|
|
204
|
+
def set_max_health(self, max_health: float) -> None:
|
|
205
|
+
"""
|
|
206
|
+
Sets the player's maximum health.
|
|
207
|
+
"""
|
|
208
|
+
raise NotImplementedError
|
|
209
|
+
def get_food_level(self) -> int:
|
|
210
|
+
"""
|
|
211
|
+
Returns the player's food level (0-20).
|
|
212
|
+
"""
|
|
213
|
+
raise NotImplementedError
|
|
214
|
+
def set_food_level(self, food_level: int) -> None:
|
|
215
|
+
"""
|
|
216
|
+
Sets the player's food level.
|
|
217
|
+
"""
|
|
218
|
+
raise NotImplementedError
|
|
219
|
+
def get_saturation(self) -> float:
|
|
220
|
+
"""
|
|
221
|
+
Returns the player's food saturation level.
|
|
222
|
+
"""
|
|
223
|
+
raise NotImplementedError
|
|
224
|
+
def set_saturation(self, saturation: float) -> None:
|
|
225
|
+
"""
|
|
226
|
+
Sets the player's food saturation level.
|
|
227
|
+
"""
|
|
228
|
+
raise NotImplementedError
|
|
229
|
+
def get_exhaustion(self) -> float:
|
|
230
|
+
"""
|
|
231
|
+
Returns the player's food exhaustion level.
|
|
232
|
+
"""
|
|
233
|
+
raise NotImplementedError
|
|
234
|
+
def set_exhaustion(self, exhaustion: float) -> None:
|
|
235
|
+
"""
|
|
236
|
+
Sets the player's food exhaustion level.
|
|
237
|
+
"""
|
|
238
|
+
raise NotImplementedError
|
|
239
|
+
def get_absorption(self) -> float:
|
|
240
|
+
"""
|
|
241
|
+
Returns the player's current absorption amount.
|
|
242
|
+
"""
|
|
243
|
+
raise NotImplementedError
|
|
244
|
+
def set_absorption(self, absorption: float) -> None:
|
|
245
|
+
"""
|
|
246
|
+
Sets the player's current absorption amount.
|
|
247
|
+
"""
|
|
248
|
+
raise NotImplementedError
|
|
249
|
+
def get_experience_level(self) -> int:
|
|
250
|
+
"""
|
|
251
|
+
Returns the player's total experience level.
|
|
252
|
+
"""
|
|
253
|
+
raise NotImplementedError
|
|
254
|
+
def get_experience_progress(self) -> float:
|
|
255
|
+
"""
|
|
256
|
+
Returns the player's progress toward the next level (0.0 to 1.0).
|
|
257
|
+
"""
|
|
258
|
+
raise NotImplementedError
|
|
259
|
+
def get_experience_points(self) -> int:
|
|
260
|
+
"""
|
|
261
|
+
Returns the total experience points the player has.
|
|
262
|
+
"""
|
|
263
|
+
raise NotImplementedError
|
|
264
|
+
def set_experience_level(self, level: int) -> None:
|
|
265
|
+
"""
|
|
266
|
+
Sets the player's total experience level.
|
|
267
|
+
"""
|
|
268
|
+
raise NotImplementedError
|
|
269
|
+
def set_experience_progress(self, progress: float) -> None:
|
|
270
|
+
"""
|
|
271
|
+
Sets the player's progress toward the next level.
|
|
272
|
+
"""
|
|
273
|
+
raise NotImplementedError
|
|
274
|
+
def set_experience_points(self, points: int) -> None:
|
|
275
|
+
"""
|
|
276
|
+
Sets the player's total experience points.
|
|
277
|
+
"""
|
|
278
|
+
raise NotImplementedError
|
|
279
|
+
def add_experience_levels(self, levels: int) -> None:
|
|
280
|
+
"""
|
|
281
|
+
Adds experience levels to the player.
|
|
282
|
+
"""
|
|
283
|
+
raise NotImplementedError
|
|
284
|
+
def add_experience_points(self, points: int) -> None:
|
|
285
|
+
"""
|
|
286
|
+
Adds experience points to the player.
|
|
287
|
+
"""
|
|
288
|
+
raise NotImplementedError
|
|
289
|
+
def is_sneaking(self) -> bool:
|
|
290
|
+
"""
|
|
291
|
+
Returns whether the player is currently sneaking.
|
|
292
|
+
"""
|
|
293
|
+
raise NotImplementedError
|
|
294
|
+
def set_sneaking(self, sneaking: bool) -> None:
|
|
295
|
+
"""
|
|
296
|
+
Sets whether the player is currently sneaking.
|
|
297
|
+
"""
|
|
298
|
+
raise NotImplementedError
|
|
299
|
+
def is_sprinting(self) -> bool:
|
|
300
|
+
"""
|
|
301
|
+
Returns whether the player is currently sprinting.
|
|
302
|
+
"""
|
|
303
|
+
raise NotImplementedError
|
|
304
|
+
def set_sprinting(self, sprinting: bool) -> None:
|
|
305
|
+
"""
|
|
306
|
+
Sets whether the player is currently sprinting.
|
|
307
|
+
"""
|
|
308
|
+
raise NotImplementedError
|
|
309
|
+
def is_on_ground(self) -> bool:
|
|
310
|
+
"""
|
|
311
|
+
Returns whether the player is currently on the ground.
|
|
312
|
+
"""
|
|
313
|
+
raise NotImplementedError
|
|
314
|
+
def is_flying(self) -> bool:
|
|
315
|
+
"""
|
|
316
|
+
Returns whether the player is currently flying.
|
|
317
|
+
"""
|
|
318
|
+
raise NotImplementedError
|
|
319
|
+
def set_flying(self, flying: bool) -> None:
|
|
320
|
+
"""
|
|
321
|
+
Sets whether the player should be flying.
|
|
322
|
+
"""
|
|
323
|
+
raise NotImplementedError
|
|
324
|
+
def get_abilities(self) -> PlayerAbilities:
|
|
325
|
+
"""
|
|
326
|
+
Returns the player's current abilities.
|
|
327
|
+
"""
|
|
328
|
+
raise NotImplementedError
|
|
329
|
+
def set_abilities(self, abilities: PlayerAbilities) -> None:
|
|
330
|
+
"""
|
|
331
|
+
Updates the player's abilities.
|
|
332
|
+
"""
|
|
333
|
+
raise NotImplementedError
|
|
334
|
+
def get_ip(self) -> str:
|
|
335
|
+
"""
|
|
336
|
+
Returns the player's IP address.
|
|
337
|
+
"""
|
|
338
|
+
raise NotImplementedError
|
|
339
|
+
def __enter__(self) -> Self:
|
|
340
|
+
"""Returns self"""
|
|
341
|
+
return self
|
|
342
|
+
|
|
343
|
+
def __exit__(self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None) -> bool | None:
|
|
344
|
+
"""
|
|
345
|
+
Release this resource.
|
|
346
|
+
"""
|
|
347
|
+
raise NotImplementedError
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# This file is automatically generated by componentize-py
|
|
2
|
+
# It is not intended for manual editing.
|
|
3
|
+
"""
|
|
4
|
+
Provides functionality to schedule tasks to be executed later on the server.
|
|
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
|
+
|
|
17
|
+
def schedule_delayed_task(handler_id: int, delay_ticks: int) -> int:
|
|
18
|
+
"""
|
|
19
|
+
Schedules a task to be executed once after the specified number of ticks.
|
|
20
|
+
|
|
21
|
+
* `handler-id`: The unique ID of the handler to call when the task executes.
|
|
22
|
+
* `delay-ticks`: The number of game ticks to wait before execution (20 ticks = 1 second).
|
|
23
|
+
|
|
24
|
+
Returns a unique task ID that can be used to cancel the task.
|
|
25
|
+
"""
|
|
26
|
+
raise NotImplementedError
|
|
27
|
+
def schedule_repeating_task(handler_id: int, delay_ticks: int, period_ticks: int) -> int:
|
|
28
|
+
"""
|
|
29
|
+
Schedules a task to be executed repeatedly.
|
|
30
|
+
|
|
31
|
+
* `handler-id`: The unique ID of the handler to call when the task executes.
|
|
32
|
+
* `delay-ticks`: The number of game ticks to wait before the first execution.
|
|
33
|
+
* `period-ticks`: The number of game ticks between subsequent executions.
|
|
34
|
+
|
|
35
|
+
Returns a unique task ID that can be used to cancel the task.
|
|
36
|
+
"""
|
|
37
|
+
raise NotImplementedError
|
|
38
|
+
def cancel_task(task_id: int) -> None:
|
|
39
|
+
"""
|
|
40
|
+
Cancels a scheduled task if it hasn't finished yet.
|
|
41
|
+
|
|
42
|
+
* `task-id`: The ID of the task to cancel.
|
|
43
|
+
"""
|
|
44
|
+
raise NotImplementedError
|
|
@@ -0,0 +1,95 @@
|
|
|
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 RenderType(Enum):
|
|
15
|
+
INTEGER = 0
|
|
16
|
+
HEARTS = 1
|
|
17
|
+
|
|
18
|
+
class DisplaySlot(Enum):
|
|
19
|
+
PLAYER_LIST = 0
|
|
20
|
+
SIDEBAR = 1
|
|
21
|
+
BELOW_NAME = 2
|
|
22
|
+
SIDEBAR_TEAM_BLACK = 3
|
|
23
|
+
SIDEBAR_TEAM_DARK_BLUE = 4
|
|
24
|
+
SIDEBAR_TEAM_DARK_GREEN = 5
|
|
25
|
+
SIDEBAR_TEAM_DARK_AQUA = 6
|
|
26
|
+
SIDEBAR_TEAM_DARK_RED = 7
|
|
27
|
+
SIDEBAR_TEAM_DARK_PURPLE = 8
|
|
28
|
+
SIDEBAR_TEAM_GOLD = 9
|
|
29
|
+
SIDEBAR_TEAM_GRAY = 10
|
|
30
|
+
SIDEBAR_TEAM_DARK_GRAY = 11
|
|
31
|
+
SIDEBAR_TEAM_BLUE = 12
|
|
32
|
+
SIDEBAR_TEAM_GREEN = 13
|
|
33
|
+
SIDEBAR_TEAM_AQUA = 14
|
|
34
|
+
SIDEBAR_TEAM_RED = 15
|
|
35
|
+
SIDEBAR_TEAM_LIGHT_PURPLE = 16
|
|
36
|
+
SIDEBAR_TEAM_YELLOW = 17
|
|
37
|
+
SIDEBAR_TEAM_WHITE = 18
|
|
38
|
+
|
|
39
|
+
class NametagVisibility(Enum):
|
|
40
|
+
ALWAYS = 0
|
|
41
|
+
NEVER = 1
|
|
42
|
+
HIDE_FOR_OTHER_TEAMS = 2
|
|
43
|
+
HIDE_FOR_OWN_TEAM = 3
|
|
44
|
+
|
|
45
|
+
class CollisionRule(Enum):
|
|
46
|
+
ALWAYS = 0
|
|
47
|
+
NEVER = 1
|
|
48
|
+
PUSH_OTHER_TEAMS = 2
|
|
49
|
+
PUSH_OWN_TEAM = 3
|
|
50
|
+
|
|
51
|
+
@dataclass
|
|
52
|
+
class TeamSettings:
|
|
53
|
+
display_name: text.TextComponent
|
|
54
|
+
friendly_fire: bool
|
|
55
|
+
see_friendly_invisibles: bool
|
|
56
|
+
nametag_visibility: NametagVisibility
|
|
57
|
+
collision_rule: CollisionRule
|
|
58
|
+
color: common.NamedColor
|
|
59
|
+
prefix: text.TextComponent
|
|
60
|
+
suffix: text.TextComponent
|
|
61
|
+
|
|
62
|
+
class Scoreboard:
|
|
63
|
+
|
|
64
|
+
def add_objective(self, name: str, display_name: text.TextComponent, render_type: RenderType) -> None:
|
|
65
|
+
raise NotImplementedError
|
|
66
|
+
def remove_objective(self, name: str) -> None:
|
|
67
|
+
raise NotImplementedError
|
|
68
|
+
def set_display_slot(self, slot: DisplaySlot, objective_name: str) -> None:
|
|
69
|
+
raise NotImplementedError
|
|
70
|
+
def update_score(self, entity_name: str, objective_name: str, value: int) -> None:
|
|
71
|
+
raise NotImplementedError
|
|
72
|
+
def remove_score(self, entity_name: str, objective_name: str) -> None:
|
|
73
|
+
raise NotImplementedError
|
|
74
|
+
def create_team(self, name: str, settings: TeamSettings) -> None:
|
|
75
|
+
raise NotImplementedError
|
|
76
|
+
def remove_team(self, name: str) -> None:
|
|
77
|
+
raise NotImplementedError
|
|
78
|
+
def update_team(self, name: str, settings: TeamSettings) -> None:
|
|
79
|
+
raise NotImplementedError
|
|
80
|
+
def add_player_to_team(self, team_name: str, player_name: str) -> None:
|
|
81
|
+
raise NotImplementedError
|
|
82
|
+
def remove_player_from_team(self, team_name: str, player_name: str) -> None:
|
|
83
|
+
raise NotImplementedError
|
|
84
|
+
def __enter__(self) -> Self:
|
|
85
|
+
"""Returns self"""
|
|
86
|
+
return self
|
|
87
|
+
|
|
88
|
+
def __exit__(self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None) -> bool | None:
|
|
89
|
+
"""
|
|
90
|
+
Release this resource.
|
|
91
|
+
"""
|
|
92
|
+
raise NotImplementedError
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
@@ -0,0 +1,75 @@
|
|
|
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 player
|
|
12
|
+
|
|
13
|
+
class Difficulty(Enum):
|
|
14
|
+
"""
|
|
15
|
+
Represents the difficulty setting of a Minecraft server.
|
|
16
|
+
"""
|
|
17
|
+
PEACEFUL = 0
|
|
18
|
+
EASY = 1
|
|
19
|
+
NORMAL = 2
|
|
20
|
+
HARD = 3
|
|
21
|
+
|
|
22
|
+
class Server:
|
|
23
|
+
"""
|
|
24
|
+
Represents the global server instance.
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
def get_difficulty(self) -> Difficulty:
|
|
28
|
+
"""
|
|
29
|
+
Returns the current difficulty level of the server.
|
|
30
|
+
"""
|
|
31
|
+
raise NotImplementedError
|
|
32
|
+
def get_player_count(self) -> int:
|
|
33
|
+
"""
|
|
34
|
+
Returns the total number of players currently connected to the server.
|
|
35
|
+
"""
|
|
36
|
+
raise NotImplementedError
|
|
37
|
+
def get_mspt(self) -> float:
|
|
38
|
+
"""
|
|
39
|
+
Returns the rolling average Milliseconds Per Tick (MSPT).
|
|
40
|
+
A value below 50.0 is required for a stable 20 TPS.
|
|
41
|
+
"""
|
|
42
|
+
raise NotImplementedError
|
|
43
|
+
def get_tps(self) -> float:
|
|
44
|
+
"""
|
|
45
|
+
Returns the effective Ticks Per Second (TPS).
|
|
46
|
+
Ideal value is 20.0.
|
|
47
|
+
"""
|
|
48
|
+
raise NotImplementedError
|
|
49
|
+
def get_all_players(self) -> List[player.Player]:
|
|
50
|
+
"""
|
|
51
|
+
Returns a list of all online players across all worlds.
|
|
52
|
+
"""
|
|
53
|
+
raise NotImplementedError
|
|
54
|
+
def get_player_by_name(self, name: str) -> Optional[player.Player]:
|
|
55
|
+
"""
|
|
56
|
+
Searches for a player by their exact name.
|
|
57
|
+
"""
|
|
58
|
+
raise NotImplementedError
|
|
59
|
+
def get_player_by_uuid(self, id: str) -> Optional[player.Player]:
|
|
60
|
+
"""
|
|
61
|
+
Searches for a player by their UUID string.
|
|
62
|
+
"""
|
|
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
|
+
|
|
@@ -0,0 +1,89 @@
|
|
|
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
|
+
class TextComponent:
|
|
14
|
+
|
|
15
|
+
@classmethod
|
|
16
|
+
def text(cls, plain: str) -> Self:
|
|
17
|
+
raise NotImplementedError
|
|
18
|
+
@classmethod
|
|
19
|
+
def translate(cls, key: str, with_: List[Self]) -> Self:
|
|
20
|
+
raise NotImplementedError
|
|
21
|
+
def add_child(self, child: Self) -> None:
|
|
22
|
+
raise NotImplementedError
|
|
23
|
+
def add_text(self, text: str) -> None:
|
|
24
|
+
raise NotImplementedError
|
|
25
|
+
def get_text(self) -> str:
|
|
26
|
+
raise NotImplementedError
|
|
27
|
+
def encode(self) -> bytes:
|
|
28
|
+
raise NotImplementedError
|
|
29
|
+
def color_named(self, color: common.NamedColor) -> None:
|
|
30
|
+
"""
|
|
31
|
+
Style
|
|
32
|
+
"""
|
|
33
|
+
raise NotImplementedError
|
|
34
|
+
def color_rgb(self, color: common.RgbColor) -> None:
|
|
35
|
+
raise NotImplementedError
|
|
36
|
+
def bold(self, value: bool) -> None:
|
|
37
|
+
raise NotImplementedError
|
|
38
|
+
def italic(self, value: bool) -> None:
|
|
39
|
+
raise NotImplementedError
|
|
40
|
+
def underlined(self, value: bool) -> None:
|
|
41
|
+
raise NotImplementedError
|
|
42
|
+
def strikethrough(self, value: bool) -> None:
|
|
43
|
+
raise NotImplementedError
|
|
44
|
+
def obfuscated(self, value: bool) -> None:
|
|
45
|
+
raise NotImplementedError
|
|
46
|
+
def insertion(self, text: str) -> None:
|
|
47
|
+
"""
|
|
48
|
+
Text inserted into chat when shift-clicked
|
|
49
|
+
"""
|
|
50
|
+
raise NotImplementedError
|
|
51
|
+
def font(self, font: str) -> None:
|
|
52
|
+
raise NotImplementedError
|
|
53
|
+
def shadow_color(self, color: common.ArgbColor) -> None:
|
|
54
|
+
raise NotImplementedError
|
|
55
|
+
def click_open_url(self, url: str) -> None:
|
|
56
|
+
"""
|
|
57
|
+
Click events
|
|
58
|
+
"""
|
|
59
|
+
raise NotImplementedError
|
|
60
|
+
def click_run_command(self, command: str) -> None:
|
|
61
|
+
raise NotImplementedError
|
|
62
|
+
def click_suggest_command(self, command: str) -> None:
|
|
63
|
+
raise NotImplementedError
|
|
64
|
+
def click_copy_to_clipboard(self, text: str) -> None:
|
|
65
|
+
raise NotImplementedError
|
|
66
|
+
def hover_show_text(self, text: Self) -> None:
|
|
67
|
+
"""
|
|
68
|
+
Hover events
|
|
69
|
+
"""
|
|
70
|
+
raise NotImplementedError
|
|
71
|
+
def hover_show_item(self, item: str) -> None:
|
|
72
|
+
"""
|
|
73
|
+
Item data as SNBT string
|
|
74
|
+
"""
|
|
75
|
+
raise NotImplementedError
|
|
76
|
+
def hover_show_entity(self, entity_type: str, id: str, name: Optional[Self]) -> None:
|
|
77
|
+
raise NotImplementedError
|
|
78
|
+
def __enter__(self) -> Self:
|
|
79
|
+
"""Returns self"""
|
|
80
|
+
return self
|
|
81
|
+
|
|
82
|
+
def __exit__(self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None) -> bool | None:
|
|
83
|
+
"""
|
|
84
|
+
Release this resource.
|
|
85
|
+
"""
|
|
86
|
+
raise NotImplementedError
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|