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,215 @@
|
|
|
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 text
|
|
12
|
+
from ..imports import scoreboard
|
|
13
|
+
|
|
14
|
+
class PistonBehavior(Enum):
|
|
15
|
+
"""
|
|
16
|
+
Defines how a block reacts when pushed by a piston.
|
|
17
|
+
"""
|
|
18
|
+
NORMAL = 0
|
|
19
|
+
DESTROY = 1
|
|
20
|
+
BLOCK = 2
|
|
21
|
+
IGNORE = 3
|
|
22
|
+
PUSH_ONLY = 4
|
|
23
|
+
|
|
24
|
+
class SoundCategory(Enum):
|
|
25
|
+
"""
|
|
26
|
+
Categories for sounds to control their volume independently.
|
|
27
|
+
"""
|
|
28
|
+
MASTER = 0
|
|
29
|
+
MUSIC = 1
|
|
30
|
+
RECORDS = 2
|
|
31
|
+
WEATHER = 3
|
|
32
|
+
BLOCKS = 4
|
|
33
|
+
HOSTILE = 5
|
|
34
|
+
NEUTRAL = 6
|
|
35
|
+
PLAYERS = 7
|
|
36
|
+
AMBIENT = 8
|
|
37
|
+
VOICE = 9
|
|
38
|
+
|
|
39
|
+
class ExplosionInteraction(Enum):
|
|
40
|
+
"""
|
|
41
|
+
Defines how an explosion interacts with blocks in the world.
|
|
42
|
+
"""
|
|
43
|
+
NONE = 0
|
|
44
|
+
BLOCK = 1
|
|
45
|
+
MOB = 2
|
|
46
|
+
TNT = 3
|
|
47
|
+
TRIGGER = 4
|
|
48
|
+
|
|
49
|
+
class BlockFlags(Flag):
|
|
50
|
+
"""
|
|
51
|
+
Flags used to control block updates and notifications.
|
|
52
|
+
"""
|
|
53
|
+
NOTIFY_NEIGHBORS = auto()
|
|
54
|
+
NOTIFY_LISTENERS = auto()
|
|
55
|
+
FORCE_STATE = auto()
|
|
56
|
+
SKIP_DROPS = auto()
|
|
57
|
+
MOVED = auto()
|
|
58
|
+
SKIP_REDSTONE_WIRE_STATE_REPLACEMENT = auto()
|
|
59
|
+
SKIP_BLOCK_ENTITY_REPLACED_CALLBACK = auto()
|
|
60
|
+
SKIP_BLOCK_ADDED_CALLBACK = auto()
|
|
61
|
+
|
|
62
|
+
@dataclass
|
|
63
|
+
class BlockState:
|
|
64
|
+
"""
|
|
65
|
+
Detailed information about a block's state.
|
|
66
|
+
"""
|
|
67
|
+
id: int
|
|
68
|
+
luminance: int
|
|
69
|
+
opacity: int
|
|
70
|
+
hardness: float
|
|
71
|
+
is_air: bool
|
|
72
|
+
is_liquid: bool
|
|
73
|
+
is_solid: bool
|
|
74
|
+
is_full_cube: bool
|
|
75
|
+
piston_behavior: PistonBehavior
|
|
76
|
+
has_random_ticks: bool
|
|
77
|
+
|
|
78
|
+
@dataclass
|
|
79
|
+
class BlockStateId:
|
|
80
|
+
"""
|
|
81
|
+
A simple wrapper for a block state ID.
|
|
82
|
+
"""
|
|
83
|
+
id: int
|
|
84
|
+
|
|
85
|
+
@dataclass
|
|
86
|
+
class BlockPos:
|
|
87
|
+
"""
|
|
88
|
+
A position in the world grid.
|
|
89
|
+
"""
|
|
90
|
+
x: int
|
|
91
|
+
y: int
|
|
92
|
+
z: int
|
|
93
|
+
|
|
94
|
+
class World:
|
|
95
|
+
"""
|
|
96
|
+
Represents a Minecraft world (dimension).
|
|
97
|
+
"""
|
|
98
|
+
|
|
99
|
+
def get_id(self) -> str:
|
|
100
|
+
"""
|
|
101
|
+
Returns the unique identifier of this world.
|
|
102
|
+
"""
|
|
103
|
+
raise NotImplementedError
|
|
104
|
+
def get_block_state_id(self, pos: BlockPos) -> int:
|
|
105
|
+
"""
|
|
106
|
+
Gets the block state ID at the specified position.
|
|
107
|
+
"""
|
|
108
|
+
raise NotImplementedError
|
|
109
|
+
def get_block_state(self, pos: BlockPos) -> BlockState:
|
|
110
|
+
"""
|
|
111
|
+
Gets detailed block state information at the specified position.
|
|
112
|
+
"""
|
|
113
|
+
raise NotImplementedError
|
|
114
|
+
def set_block_state(self, pos: BlockPos, state: int, update_flags: BlockFlags) -> None:
|
|
115
|
+
"""
|
|
116
|
+
Sets the block state at the specified position.
|
|
117
|
+
"""
|
|
118
|
+
raise NotImplementedError
|
|
119
|
+
def get_time_of_day(self) -> int:
|
|
120
|
+
"""
|
|
121
|
+
Returns the current time of day in ticks.
|
|
122
|
+
"""
|
|
123
|
+
raise NotImplementedError
|
|
124
|
+
def set_time_of_day(self, time: int) -> None:
|
|
125
|
+
"""
|
|
126
|
+
Sets the current time of day in ticks.
|
|
127
|
+
"""
|
|
128
|
+
raise NotImplementedError
|
|
129
|
+
def get_world_age(self) -> int:
|
|
130
|
+
"""
|
|
131
|
+
Returns the total age of the world in ticks.
|
|
132
|
+
"""
|
|
133
|
+
raise NotImplementedError
|
|
134
|
+
def get_dimension(self) -> str:
|
|
135
|
+
"""
|
|
136
|
+
Returns the dimension type (e.g., "minecraft:overworld").
|
|
137
|
+
"""
|
|
138
|
+
raise NotImplementedError
|
|
139
|
+
def get_top_block_y(self, x: int, z: int) -> int:
|
|
140
|
+
"""
|
|
141
|
+
Gets the highest non-air block Y coordinate at the specified X and Z.
|
|
142
|
+
"""
|
|
143
|
+
raise NotImplementedError
|
|
144
|
+
def get_motion_blocking_height(self, x: int, z: int) -> int:
|
|
145
|
+
"""
|
|
146
|
+
Gets the highest motion-blocking block Y coordinate.
|
|
147
|
+
"""
|
|
148
|
+
raise NotImplementedError
|
|
149
|
+
def is_raining(self) -> bool:
|
|
150
|
+
"""
|
|
151
|
+
Returns whether it is currently raining or snowing.
|
|
152
|
+
"""
|
|
153
|
+
raise NotImplementedError
|
|
154
|
+
def set_raining(self, raining: bool) -> None:
|
|
155
|
+
"""
|
|
156
|
+
Sets whether it should be raining or snowing.
|
|
157
|
+
"""
|
|
158
|
+
raise NotImplementedError
|
|
159
|
+
def is_thundering(self) -> bool:
|
|
160
|
+
"""
|
|
161
|
+
Returns whether there is currently a thunderstorm.
|
|
162
|
+
"""
|
|
163
|
+
raise NotImplementedError
|
|
164
|
+
def set_thundering(self, thundering: bool) -> None:
|
|
165
|
+
"""
|
|
166
|
+
Sets whether there should be a thunderstorm.
|
|
167
|
+
"""
|
|
168
|
+
raise NotImplementedError
|
|
169
|
+
def broadcast_system_message(self, message: text.TextComponent, overlay: bool) -> None:
|
|
170
|
+
"""
|
|
171
|
+
Broadcasts a system message to all players in this world.
|
|
172
|
+
"""
|
|
173
|
+
raise NotImplementedError
|
|
174
|
+
def get_scoreboard(self) -> scoreboard.Scoreboard:
|
|
175
|
+
"""
|
|
176
|
+
Returns the scoreboard associated with this world.
|
|
177
|
+
"""
|
|
178
|
+
raise NotImplementedError
|
|
179
|
+
def play_sound(self, sound: str, category: SoundCategory, pos: Tuple[float, float, float], volume: float, pitch: float) -> None:
|
|
180
|
+
"""
|
|
181
|
+
Plays a sound at the specified position for all players in the world.
|
|
182
|
+
"""
|
|
183
|
+
raise NotImplementedError
|
|
184
|
+
def spawn_particle(self, particle: str, pos: Tuple[float, float, float], offset: Tuple[float, float, float], max_speed: float, count: int) -> None:
|
|
185
|
+
"""
|
|
186
|
+
Spawns particles at the specified position.
|
|
187
|
+
"""
|
|
188
|
+
raise NotImplementedError
|
|
189
|
+
def create_explosion(self, pos: Tuple[float, float, float], power: float, create_fire: bool, interaction: ExplosionInteraction) -> None:
|
|
190
|
+
"""
|
|
191
|
+
Creates an explosion at the specified position.
|
|
192
|
+
"""
|
|
193
|
+
raise NotImplementedError
|
|
194
|
+
def get_sea_level(self) -> int:
|
|
195
|
+
"""
|
|
196
|
+
Returns the sea level of this world.
|
|
197
|
+
"""
|
|
198
|
+
raise NotImplementedError
|
|
199
|
+
def get_min_y(self) -> int:
|
|
200
|
+
"""
|
|
201
|
+
Returns the minimum Y coordinate (bottom of the world).
|
|
202
|
+
"""
|
|
203
|
+
raise NotImplementedError
|
|
204
|
+
def __enter__(self) -> Self:
|
|
205
|
+
"""Returns self"""
|
|
206
|
+
return self
|
|
207
|
+
|
|
208
|
+
def __exit__(self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None) -> bool | None:
|
|
209
|
+
"""
|
|
210
|
+
Release this resource.
|
|
211
|
+
"""
|
|
212
|
+
raise NotImplementedError
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
interface %world {
|
|
2
|
+
use common.{position};
|
|
3
|
+
use text.{text-component};
|
|
4
|
+
use scoreboard.{scoreboard};
|
|
5
|
+
|
|
6
|
+
/// Defines how a block reacts when pushed by a piston.
|
|
7
|
+
enum piston-behavior {
|
|
8
|
+
/// Normal behavior; the block can be pushed and pulled.
|
|
9
|
+
normal,
|
|
10
|
+
/// The block is destroyed when pushed.
|
|
11
|
+
destroy,
|
|
12
|
+
/// The block cannot be pushed or pulled.
|
|
13
|
+
block,
|
|
14
|
+
/// The block is ignored by pistons.
|
|
15
|
+
ignore,
|
|
16
|
+
/// The block can only be pushed, not pulled.
|
|
17
|
+
push-only
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/// Categories for sounds to control their volume independently.
|
|
21
|
+
enum sound-category {
|
|
22
|
+
master,
|
|
23
|
+
music,
|
|
24
|
+
records,
|
|
25
|
+
weather,
|
|
26
|
+
blocks,
|
|
27
|
+
hostile,
|
|
28
|
+
neutral,
|
|
29
|
+
players,
|
|
30
|
+
ambient,
|
|
31
|
+
voice,
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/// Defines how an explosion interacts with blocks in the world.
|
|
35
|
+
enum explosion-interaction {
|
|
36
|
+
/// No interaction with blocks.
|
|
37
|
+
none,
|
|
38
|
+
/// Blocks are destroyed and may drop loot.
|
|
39
|
+
block,
|
|
40
|
+
/// Interaction typical for mob-caused explosions.
|
|
41
|
+
mob,
|
|
42
|
+
/// Interaction typical for TNT explosions.
|
|
43
|
+
tnt,
|
|
44
|
+
/// Triggers specific block behaviors.
|
|
45
|
+
trigger,
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/// Flags used to control block updates and notifications.
|
|
49
|
+
flags block-flags {
|
|
50
|
+
/// Notifies neighbor blocks of the change.
|
|
51
|
+
notify-neighbors,
|
|
52
|
+
/// Notifies client listeners of the change.
|
|
53
|
+
notify-listeners,
|
|
54
|
+
/// Forces the block state even if it's the same.
|
|
55
|
+
force-state,
|
|
56
|
+
/// Skips dropping items when the block is removed.
|
|
57
|
+
skip-drops,
|
|
58
|
+
/// Indicates the block was moved (e.g., by a piston).
|
|
59
|
+
moved,
|
|
60
|
+
/// Skips state replacement for redstone wires.
|
|
61
|
+
skip-redstone-wire-state-replacement,
|
|
62
|
+
/// Skips the callback when a block entity is replaced.
|
|
63
|
+
skip-block-entity-replaced-callback,
|
|
64
|
+
/// Skips the callback when a block is added.
|
|
65
|
+
skip-block-added-callback,
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/// Detailed information about a block's state.
|
|
69
|
+
record block-state {
|
|
70
|
+
/// The internal numerical ID of the block state.
|
|
71
|
+
id: u16,
|
|
72
|
+
/// The light level emitted by this block (0-15).
|
|
73
|
+
luminance: u8,
|
|
74
|
+
/// How much light this block blocks.
|
|
75
|
+
opacity: u8,
|
|
76
|
+
/// The hardness of the block, determining mining speed.
|
|
77
|
+
hardness: f32,
|
|
78
|
+
/// Whether this block is considered air.
|
|
79
|
+
is-air: bool,
|
|
80
|
+
/// Whether this block is a liquid.
|
|
81
|
+
is-liquid: bool,
|
|
82
|
+
/// Whether this block is a solid.
|
|
83
|
+
is-solid: bool,
|
|
84
|
+
/// Whether this block occupies a full cube.
|
|
85
|
+
is-full-cube: bool,
|
|
86
|
+
/// How this block behaves when pushed by a piston.
|
|
87
|
+
piston-behavior: piston-behavior,
|
|
88
|
+
/// Whether this block receives random ticks.
|
|
89
|
+
has-random-ticks: bool,
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/// A simple wrapper for a block state ID.
|
|
93
|
+
record block-state-id {
|
|
94
|
+
id: u16,
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/// A position in the world grid.
|
|
98
|
+
record block-pos {
|
|
99
|
+
x: s32,
|
|
100
|
+
y: s32,
|
|
101
|
+
z: s32,
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/// Represents a Minecraft world (dimension).
|
|
105
|
+
resource %world {
|
|
106
|
+
/// Returns the unique identifier of this world.
|
|
107
|
+
get-id: func() -> string;
|
|
108
|
+
|
|
109
|
+
/// Gets the block state ID at the specified position.
|
|
110
|
+
get-block-state-id: func(pos: block-pos) -> u16;
|
|
111
|
+
|
|
112
|
+
/// Gets detailed block state information at the specified position.
|
|
113
|
+
get-block-state: func(pos: block-pos) -> block-state;
|
|
114
|
+
|
|
115
|
+
/// Sets the block state at the specified position.
|
|
116
|
+
set-block-state: func(pos: block-pos, state: u16, update-flags: block-flags);
|
|
117
|
+
|
|
118
|
+
/// Returns the current time of day in ticks.
|
|
119
|
+
get-time-of-day: func() -> u64;
|
|
120
|
+
|
|
121
|
+
/// Sets the current time of day in ticks.
|
|
122
|
+
set-time-of-day: func(time: u64);
|
|
123
|
+
|
|
124
|
+
/// Returns the total age of the world in ticks.
|
|
125
|
+
get-world-age: func() -> u64;
|
|
126
|
+
|
|
127
|
+
/// Returns the dimension type (e.g., "minecraft:overworld").
|
|
128
|
+
get-dimension: func() -> string;
|
|
129
|
+
|
|
130
|
+
/// Gets the highest non-air block Y coordinate at the specified X and Z.
|
|
131
|
+
get-top-block-y: func(x: s32, z: s32) -> s32;
|
|
132
|
+
|
|
133
|
+
/// Gets the highest motion-blocking block Y coordinate.
|
|
134
|
+
get-motion-blocking-height: func(x: s32, z: s32) -> s32;
|
|
135
|
+
|
|
136
|
+
/// Returns whether it is currently raining or snowing.
|
|
137
|
+
is-raining: func() -> bool;
|
|
138
|
+
|
|
139
|
+
/// Sets whether it should be raining or snowing.
|
|
140
|
+
set-raining: func(raining: bool);
|
|
141
|
+
|
|
142
|
+
/// Returns whether there is currently a thunderstorm.
|
|
143
|
+
is-thundering: func() -> bool;
|
|
144
|
+
|
|
145
|
+
/// Sets whether there should be a thunderstorm.
|
|
146
|
+
set-thundering: func(thundering: bool);
|
|
147
|
+
|
|
148
|
+
/// Broadcasts a system message to all players in this world.
|
|
149
|
+
broadcast-system-message: func(message: text-component, overlay: bool);
|
|
150
|
+
|
|
151
|
+
/// Returns the scoreboard associated with this world.
|
|
152
|
+
get-scoreboard: func() -> scoreboard;
|
|
153
|
+
|
|
154
|
+
/// Plays a sound at the specified position for all players in the world.
|
|
155
|
+
play-sound: func(sound: string, category: sound-category, pos: position, volume: f32, pitch: f32);
|
|
156
|
+
|
|
157
|
+
/// Spawns particles at the specified position.
|
|
158
|
+
spawn-particle: func(particle: string, pos: position, offset: position, max-speed: f32, count: s32);
|
|
159
|
+
|
|
160
|
+
/// Creates an explosion at the specified position.
|
|
161
|
+
create-explosion: func(pos: position, power: f32, create-fire: bool, interaction: explosion-interaction);
|
|
162
|
+
|
|
163
|
+
/// Returns the sea level of this world.
|
|
164
|
+
get-sea-level: func() -> s32;
|
|
165
|
+
|
|
166
|
+
/// Returns the minimum Y coordinate (bottom of the world).
|
|
167
|
+
get-min-y: func() -> s32;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pumpkin-api-py
|
|
3
|
+
Version: 0.1.0.dev0
|
|
4
|
+
Summary: Pumpkin plugin API for Python
|
|
5
|
+
Author: alex
|
|
6
|
+
License-Expression: GPL-3.0-only
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Requires-Python: >=3.9
|
|
9
|
+
Requires-Dist: componentize-py>=0.22.1
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
|
|
12
|
+
# Pumpkin Plugin API for Python
|
|
13
|
+
|
|
14
|
+
This package provides everything needed to write a Pumpkin server plugin compiled to WebAssembly using Python.
|
|
15
|
+
|
|
16
|
+
## Quick start
|
|
17
|
+
|
|
18
|
+
1. Install `pumpkin-api-py`:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
pip install pumpkin-api-py
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
2. Create your plugin (`main.py`):
|
|
25
|
+
|
|
26
|
+
```python
|
|
27
|
+
from pumpkin_api import (
|
|
28
|
+
Plugin, PluginMetadata, register_plugin,
|
|
29
|
+
server, event, command, text, context
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
class MyPlugin(Plugin):
|
|
33
|
+
def metadata(self) -> PluginMetadata:
|
|
34
|
+
return PluginMetadata(
|
|
35
|
+
name="my-plugin",
|
|
36
|
+
version="0.1.0",
|
|
37
|
+
authors=["you"],
|
|
38
|
+
description="An example plugin."
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
def on_load(self, ctx: context.Context) -> None:
|
|
42
|
+
print("Python plugin loaded!")
|
|
43
|
+
|
|
44
|
+
# Register an event handler
|
|
45
|
+
self.register_event(ctx, event.EventType.PLAYER_JOIN_EVENT, self.on_player_join)
|
|
46
|
+
|
|
47
|
+
def on_player_join(self, srv: server.Server, evt: event.PlayerJoinEventData) -> event.PlayerJoinEventData:
|
|
48
|
+
print(f"Player {evt.player.get_name()} joined!")
|
|
49
|
+
return evt
|
|
50
|
+
|
|
51
|
+
register_plugin(MyPlugin)
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
3. Build your plugin into a WebAssembly component:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
pumpkin-api-build main -o my_plugin.wasm
|
|
58
|
+
```
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
pumpkin_api/__init__.py,sha256=B7whsAeYUHbhw4oMIbIs9dj9fOMGfNNU_zVI8QHwGjw,5972
|
|
2
|
+
pumpkin_api/app.py,sha256=P1NMxEP38xqFwjexUilEE2XdLdLnAEMWubcMZZ9lCvE,196
|
|
3
|
+
pumpkin_api/build.py,sha256=4pIoca8Q9zUORrwaUBBY4VfwS65yCaLU9F3zkq2hbNM,1106
|
|
4
|
+
pumpkin_api/wit/componentize_py_runtime.pyi,sha256=3suTYQdRo3dzsP7919mJBuxuwNbUbjnQPiMcaXZs3ic,1109
|
|
5
|
+
pumpkin_api/wit/componentize_py_types.py,sha256=SWM0sddLchor0Un7py0s4j-2kZQylrdpWzxmLPDHBJQ,327
|
|
6
|
+
pumpkin_api/wit/poll_loop.py,sha256=KUBgZTycS3Ek-a-GPQebovucd2BumNe0c2XFwupKGHI,12181
|
|
7
|
+
pumpkin_api/wit/componentize_py_async_support/__init__.py,sha256=6oNtCh-j2CUbmKFePX_Z86syh3j0GolOgZKPp_-UVKA,17458
|
|
8
|
+
pumpkin_api/wit/componentize_py_async_support/futures.py,sha256=IxvS9w0VDoZmW-FJvLvn21N7JuaX7zKu0szWlJMw_S8,3388
|
|
9
|
+
pumpkin_api/wit/componentize_py_async_support/streams.py,sha256=2wu0y1V8gKXTTpH8f-ssOE-WMoJO44h600-osDGKGuc,6317
|
|
10
|
+
pumpkin_api/wit/wit_world/__init__.py,sha256=4RW1xv4VH-SlLre6CbsKDiTkVC-GpXZIbjXEbXCgS-Q,2294
|
|
11
|
+
pumpkin_api/wit/wit_world/exports/__init__.py,sha256=9ggL2rLOdD7paKC08JdDnPoSn277q-m16Hnyani8ZQk,569
|
|
12
|
+
pumpkin_api/wit/wit_world/exports/metadata.py,sha256=JvxfLBv7h7eJ8_oO-KwlkvORXElEWfgmCHUEEwwM2DI,579
|
|
13
|
+
pumpkin_api/wit/wit_world/imports/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
|
+
pumpkin_api/wit/wit_world/imports/command.py,sha256=EyUiz9S-Eef_tf1zLiZchbZj_ha7UcsRLxv4b6fqtSc,10502
|
|
15
|
+
pumpkin_api/wit/wit_world/imports/common.py,sha256=lqWiNc2M_LpPhjzz7IicvR3hNwxwYZSxV42wvQsJhbA,3505
|
|
16
|
+
pumpkin_api/wit/wit_world/imports/context.py,sha256=zxp4bKS8bFI0wFrJgBn8DFO8CoIGG0L4b7JcHYdZJSM,2452
|
|
17
|
+
pumpkin_api/wit/wit_world/imports/entity.py,sha256=UGkyAL4aPkanrqGHyvUkJccqDl-M1BlGkKD95Zo0J3M,2665
|
|
18
|
+
pumpkin_api/wit/wit_world/imports/event.py,sha256=5WOQIrgBBFkaDeadsUxGWZqbkR0VT3S7-Nn-Mj60CHA,9475
|
|
19
|
+
pumpkin_api/wit/wit_world/imports/gui.py,sha256=AUi8hnyhvi-XV9jJ2KYXHm60mWTZBjPorIXOTsNt244,1630
|
|
20
|
+
pumpkin_api/wit/wit_world/imports/i18n.py,sha256=gBG038CJr91bGuc7BSqR8xDmS15YT2sh6B3fWOnCIZk,1179
|
|
21
|
+
pumpkin_api/wit/wit_world/imports/logging.py,sha256=vVWjK9fDjj7tGKHwfsSWDTtyDFmyr4mSw5VhLSLwLS8,762
|
|
22
|
+
pumpkin_api/wit/wit_world/imports/permission.py,sha256=gijthLLFfZs0GVBVCsZwhnX3tMAQa8dozE934sqQ8xY,1770
|
|
23
|
+
pumpkin_api/wit/wit_world/imports/player.py,sha256=SIS_Hs7XFVCiONjCMYNoISKB-f6W18Ix3JF0X1_s9Z0,11170
|
|
24
|
+
pumpkin_api/wit/wit_world/imports/scheduler.py,sha256=sI7Axa6jSCvPg9DbeKjbRPSRQPMMUUXMN636gVjwACY,1625
|
|
25
|
+
pumpkin_api/wit/wit_world/imports/scoreboard.py,sha256=zixPPHtgRjJHUWtEBBncvVJnrg4DwlmdJnHZSwNSO1U,3030
|
|
26
|
+
pumpkin_api/wit/wit_world/imports/server.py,sha256=PI8y3QX0gaQV7IS8TlO9Q6_HYi6X9k0lDIzQme6mnWk,2280
|
|
27
|
+
pumpkin_api/wit/wit_world/imports/text.py,sha256=QJej3ya2GDsQF2_5xbCcKe6sKsxSGC2TNzEAAjPFVA0,3031
|
|
28
|
+
pumpkin_api/wit/wit_world/imports/world.py,sha256=KDO3ZjPpedn_RVlKdt7KQ2zaNjp_1uzjqMjnxQ8w5ow,6191
|
|
29
|
+
pumpkin_api/wit_files/command.wit,sha256=TsYDm78744fEK-_uEadRmG1pKPrJ-qVqYBTZWwpILyk,4636
|
|
30
|
+
pumpkin_api/wit_files/common.wit,sha256=hE54HtHBz1hjsi0Jm-eIyCUn_5KN5LQZqZqczyTNXYw,3587
|
|
31
|
+
pumpkin_api/wit_files/componentize_py_runtime.pyi,sha256=3suTYQdRo3dzsP7919mJBuxuwNbUbjnQPiMcaXZs3ic,1109
|
|
32
|
+
pumpkin_api/wit_files/componentize_py_types.py,sha256=SWM0sddLchor0Un7py0s4j-2kZQylrdpWzxmLPDHBJQ,327
|
|
33
|
+
pumpkin_api/wit_files/context.wit,sha256=-cFh8YUsXzfSDq26nIesYm4mjzPbtSh5jrpn_djScv8,1388
|
|
34
|
+
pumpkin_api/wit_files/entity.wit,sha256=AWPAlr0-LSpwVBYW_Iqbbjm8CN0zYFZMGIpVg6Uo4pc,1332
|
|
35
|
+
pumpkin_api/wit_files/event.wit,sha256=bUUmOBDVo71hbIsnxBxnmp_2Uq8HzlBoe-9xcVf8iYc,8193
|
|
36
|
+
pumpkin_api/wit_files/gui.wit,sha256=gushhk_4KDfNj1iMkGBV4Y8tgJXbX217ZATk5wXV6T8,791
|
|
37
|
+
pumpkin_api/wit_files/i18n.wit,sha256=eAeFkI2N-5MG4cc_-g0-mpOsX1BzF6clAZ603PvWweg,758
|
|
38
|
+
pumpkin_api/wit_files/log.wit,sha256=h7j6AO9uUKcWVC70j6GLC3vQXuy-CcICRqfIDmtXg0o,309
|
|
39
|
+
pumpkin_api/wit_files/metadata.wit,sha256=4FjTGcEDpmzfCWZD6Gu7dS_vtE9QjFNf-Z6-T9D8KOQ,418
|
|
40
|
+
pumpkin_api/wit_files/permission.wit,sha256=3LLdPwL0TcKvfp28ZFthdFOtXWKJgf0d1aEO95UM0b4,1653
|
|
41
|
+
pumpkin_api/wit_files/player.wit,sha256=V8eRoe3VyXwOnohAe7DNVBdbHHsgYdydy7MwUWvrYuo,7448
|
|
42
|
+
pumpkin_api/wit_files/plugin.wit,sha256=aX-8N216vWpHyttq3sQKJRY_YkAJInaxHKUBcenNTa8,2296
|
|
43
|
+
pumpkin_api/wit_files/poll_loop.py,sha256=KUBgZTycS3Ek-a-GPQebovucd2BumNe0c2XFwupKGHI,12181
|
|
44
|
+
pumpkin_api/wit_files/scheduler.wit,sha256=lBpuJQwnreK1JcfXtuD6WZzYJ62M1fpa0M4UZ7KFkPo,1176
|
|
45
|
+
pumpkin_api/wit_files/scoreboard.wit,sha256=pR7tcQeL3i9aWB7vFKYkHM4uQIyqIIGsRkGA22oJF-M,2009
|
|
46
|
+
pumpkin_api/wit_files/server.wit,sha256=NGxi4v-MfIEXtLg8vDe7mwNF_x8CylJ47qmyuUJ0-RY,1371
|
|
47
|
+
pumpkin_api/wit_files/text.wit,sha256=IjdNsXxTzxTEOsSuDMmfF0hFsA4kuKkANW7HvMypUU8,1375
|
|
48
|
+
pumpkin_api/wit_files/world.wit,sha256=uMbCXT36eb7MBuI34KRwWBdan9cl7EM2I_wB7CSkAqI,5759
|
|
49
|
+
pumpkin_api/wit_files/componentize_py_async_support/__init__.py,sha256=6oNtCh-j2CUbmKFePX_Z86syh3j0GolOgZKPp_-UVKA,17458
|
|
50
|
+
pumpkin_api/wit_files/componentize_py_async_support/futures.py,sha256=IxvS9w0VDoZmW-FJvLvn21N7JuaX7zKu0szWlJMw_S8,3388
|
|
51
|
+
pumpkin_api/wit_files/componentize_py_async_support/streams.py,sha256=2wu0y1V8gKXTTpH8f-ssOE-WMoJO44h600-osDGKGuc,6317
|
|
52
|
+
pumpkin_api/wit_files/wit_world/__init__.py,sha256=4RW1xv4VH-SlLre6CbsKDiTkVC-GpXZIbjXEbXCgS-Q,2294
|
|
53
|
+
pumpkin_api/wit_files/wit_world/exports/__init__.py,sha256=9ggL2rLOdD7paKC08JdDnPoSn277q-m16Hnyani8ZQk,569
|
|
54
|
+
pumpkin_api/wit_files/wit_world/exports/metadata.py,sha256=JvxfLBv7h7eJ8_oO-KwlkvORXElEWfgmCHUEEwwM2DI,579
|
|
55
|
+
pumpkin_api/wit_files/wit_world/imports/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
56
|
+
pumpkin_api/wit_files/wit_world/imports/command.py,sha256=EyUiz9S-Eef_tf1zLiZchbZj_ha7UcsRLxv4b6fqtSc,10502
|
|
57
|
+
pumpkin_api/wit_files/wit_world/imports/common.py,sha256=lqWiNc2M_LpPhjzz7IicvR3hNwxwYZSxV42wvQsJhbA,3505
|
|
58
|
+
pumpkin_api/wit_files/wit_world/imports/context.py,sha256=zxp4bKS8bFI0wFrJgBn8DFO8CoIGG0L4b7JcHYdZJSM,2452
|
|
59
|
+
pumpkin_api/wit_files/wit_world/imports/entity.py,sha256=UGkyAL4aPkanrqGHyvUkJccqDl-M1BlGkKD95Zo0J3M,2665
|
|
60
|
+
pumpkin_api/wit_files/wit_world/imports/event.py,sha256=5WOQIrgBBFkaDeadsUxGWZqbkR0VT3S7-Nn-Mj60CHA,9475
|
|
61
|
+
pumpkin_api/wit_files/wit_world/imports/gui.py,sha256=AUi8hnyhvi-XV9jJ2KYXHm60mWTZBjPorIXOTsNt244,1630
|
|
62
|
+
pumpkin_api/wit_files/wit_world/imports/i18n.py,sha256=gBG038CJr91bGuc7BSqR8xDmS15YT2sh6B3fWOnCIZk,1179
|
|
63
|
+
pumpkin_api/wit_files/wit_world/imports/logging.py,sha256=vVWjK9fDjj7tGKHwfsSWDTtyDFmyr4mSw5VhLSLwLS8,762
|
|
64
|
+
pumpkin_api/wit_files/wit_world/imports/permission.py,sha256=gijthLLFfZs0GVBVCsZwhnX3tMAQa8dozE934sqQ8xY,1770
|
|
65
|
+
pumpkin_api/wit_files/wit_world/imports/player.py,sha256=SIS_Hs7XFVCiONjCMYNoISKB-f6W18Ix3JF0X1_s9Z0,11170
|
|
66
|
+
pumpkin_api/wit_files/wit_world/imports/scheduler.py,sha256=sI7Axa6jSCvPg9DbeKjbRPSRQPMMUUXMN636gVjwACY,1625
|
|
67
|
+
pumpkin_api/wit_files/wit_world/imports/scoreboard.py,sha256=zixPPHtgRjJHUWtEBBncvVJnrg4DwlmdJnHZSwNSO1U,3030
|
|
68
|
+
pumpkin_api/wit_files/wit_world/imports/server.py,sha256=PI8y3QX0gaQV7IS8TlO9Q6_HYi6X9k0lDIzQme6mnWk,2280
|
|
69
|
+
pumpkin_api/wit_files/wit_world/imports/text.py,sha256=QJej3ya2GDsQF2_5xbCcKe6sKsxSGC2TNzEAAjPFVA0,3031
|
|
70
|
+
pumpkin_api/wit_files/wit_world/imports/world.py,sha256=KDO3ZjPpedn_RVlKdt7KQ2zaNjp_1uzjqMjnxQ8w5ow,6191
|
|
71
|
+
pumpkin_api_py-0.1.0.dev0.dist-info/METADATA,sha256=gmAHzN-EEry7eCc47Cuzk6XDIpHNr5JHQG7Es4J4aN0,1459
|
|
72
|
+
pumpkin_api_py-0.1.0.dev0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
|
|
73
|
+
pumpkin_api_py-0.1.0.dev0.dist-info/entry_points.txt,sha256=2gMHCntyTe9ev4VmwHLggE-UXhZj2U7BIT5DBoYd2sU,61
|
|
74
|
+
pumpkin_api_py-0.1.0.dev0.dist-info/licenses/LICENSE,sha256=1Oq26e5aRaugKmSso0nYTJB_TsOoAWtYhTgje1HgFqw,35122
|
|
75
|
+
pumpkin_api_py-0.1.0.dev0.dist-info/RECORD,,
|