pumpkin-api-py 0.1.0__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 (108) hide show
  1. componentize_py_async_support/__init__.py +570 -0
  2. componentize_py_async_support/futures.py +149 -0
  3. componentize_py_async_support/streams.py +345 -0
  4. componentize_py_runtime.pyi +40 -0
  5. componentize_py_types.py +32 -0
  6. poll_loop.py +440 -0
  7. pumpkin_api/__init__.py +41 -0
  8. pumpkin_api/build.py +68 -0
  9. pumpkin_api/impl.py +355 -0
  10. pumpkin_api/wit/advancement.wit +41 -0
  11. pumpkin_api/wit/attributes.wit +56 -0
  12. pumpkin_api/wit/bedrock-packets.wit +1709 -0
  13. pumpkin_api/wit/biomes.wit +72 -0
  14. pumpkin_api/wit/block-entity.wit +423 -0
  15. pumpkin_api/wit/boss-bar.wit +83 -0
  16. pumpkin_api/wit/command.wit +244 -0
  17. pumpkin_api/wit/common.wit +261 -0
  18. pumpkin_api/wit/context.wit +61 -0
  19. pumpkin_api/wit/damage-types.wit +57 -0
  20. pumpkin_api/wit/data-components.wit +117 -0
  21. pumpkin_api/wit/datapack.wit +54 -0
  22. pumpkin_api/wit/display.wit +171 -0
  23. pumpkin_api/wit/enchantments.wit +102 -0
  24. pumpkin_api/wit/entity-statuses.wit +68 -0
  25. pumpkin_api/wit/entity-types.wit +164 -0
  26. pumpkin_api/wit/entity.wit +1 -0
  27. pumpkin_api/wit/event.wit +2435 -0
  28. pumpkin_api/wit/forms.wit +51 -0
  29. pumpkin_api/wit/game-events.wit +67 -0
  30. pumpkin_api/wit/game-rules.wit +69 -0
  31. pumpkin_api/wit/gui.wit +39 -0
  32. pumpkin_api/wit/i18n.wit +21 -0
  33. pumpkin_api/wit/inventory.wit +78 -0
  34. pumpkin_api/wit/ipc.wit +7 -0
  35. pumpkin_api/wit/item-stack.wit +104 -0
  36. pumpkin_api/wit/java-dialogs.wit +155 -0
  37. pumpkin_api/wit/java-packets.wit +1838 -0
  38. pumpkin_api/wit/log.wit +14 -0
  39. pumpkin_api/wit/metadata.wit +19 -0
  40. pumpkin_api/wit/particles.wit +131 -0
  41. pumpkin_api/wit/permission.wit +46 -0
  42. pumpkin_api/wit/player.wit +1432 -0
  43. pumpkin_api/wit/plugin.wit +121 -0
  44. pumpkin_api/wit/potions.wit +52 -0
  45. pumpkin_api/wit/recipe.wit +88 -0
  46. pumpkin_api/wit/scheduler.wit +24 -0
  47. pumpkin_api/wit/scoreboard.wit +111 -0
  48. pumpkin_api/wit/screens.wit +31 -0
  49. pumpkin_api/wit/server.wit +286 -0
  50. pumpkin_api/wit/sounds.wit +1987 -0
  51. pumpkin_api/wit/statistics.wit +94 -0
  52. pumpkin_api/wit/status-effect.wit +54 -0
  53. pumpkin_api/wit/text.wit +68 -0
  54. pumpkin_api/wit/uuid.wit +16 -0
  55. pumpkin_api/wit/world.wit +1050 -0
  56. pumpkin_api_py-0.1.0.dist-info/METADATA +53 -0
  57. pumpkin_api_py-0.1.0.dist-info/RECORD +108 -0
  58. pumpkin_api_py-0.1.0.dist-info/WHEEL +4 -0
  59. pumpkin_api_py-0.1.0.dist-info/entry_points.txt +2 -0
  60. pumpkin_api_py-0.1.0.dist-info/licenses/LICENSE-APACHE +176 -0
  61. pumpkin_api_py-0.1.0.dist-info/licenses/LICENSE-MIT +21 -0
  62. wit_world/__init__.py +114 -0
  63. wit_world/exports/__init__.py +19 -0
  64. wit_world/exports/metadata.py +24 -0
  65. wit_world/imports/__init__.py +0 -0
  66. wit_world/imports/advancement.py +56 -0
  67. wit_world/imports/attributes.py +66 -0
  68. wit_world/imports/bedrock_packets.py +2413 -0
  69. wit_world/imports/biomes.py +81 -0
  70. wit_world/imports/block_entity.py +1353 -0
  71. wit_world/imports/boss_bar.py +137 -0
  72. wit_world/imports/command.py +705 -0
  73. wit_world/imports/common.py +335 -0
  74. wit_world/imports/context.py +91 -0
  75. wit_world/imports/damage_types.py +66 -0
  76. wit_world/imports/data_components.py +126 -0
  77. wit_world/imports/datapack.py +124 -0
  78. wit_world/imports/display.py +295 -0
  79. wit_world/imports/enchantments.py +129 -0
  80. wit_world/imports/entity_statuses.py +77 -0
  81. wit_world/imports/entity_types.py +173 -0
  82. wit_world/imports/event.py +3558 -0
  83. wit_world/imports/forms.py +98 -0
  84. wit_world/imports/game_events.py +76 -0
  85. wit_world/imports/game_rules.py +88 -0
  86. wit_world/imports/gui.py +81 -0
  87. wit_world/imports/i18n.py +35 -0
  88. wit_world/imports/inventory.py +159 -0
  89. wit_world/imports/ipc.py +20 -0
  90. wit_world/imports/item_stack.py +206 -0
  91. wit_world/imports/java_dialogs.py +208 -0
  92. wit_world/imports/java_packets.py +3560 -0
  93. wit_world/imports/logging.py +30 -0
  94. wit_world/imports/particles.py +140 -0
  95. wit_world/imports/permission.py +71 -0
  96. wit_world/imports/player.py +1753 -0
  97. wit_world/imports/potions.py +61 -0
  98. wit_world/imports/recipe.py +120 -0
  99. wit_world/imports/scheduler.py +44 -0
  100. wit_world/imports/scoreboard.py +167 -0
  101. wit_world/imports/screens.py +40 -0
  102. wit_world/imports/server.py +493 -0
  103. wit_world/imports/sounds.py +1996 -0
  104. wit_world/imports/statistics.py +103 -0
  105. wit_world/imports/status_effect.py +63 -0
  106. wit_world/imports/text.py +156 -0
  107. wit_world/imports/uuid.py +36 -0
  108. wit_world/imports/world.py +1640 -0
@@ -0,0 +1,244 @@
1
+ interface command {
2
+ use %world.{%world, entity};
3
+ use player.{player};
4
+ use block-entity.{command-block-entity};
5
+ use common.{position, block-pos, locale, game-mode};
6
+ use item-stack.{item-stack};
7
+ use server.{server, difficulty};
8
+ use text.{text-component};
9
+
10
+ variant command-error {
11
+ invalid-consumption(option<string>),
12
+ invalid-requirement,
13
+ permission-denied,
14
+ command-failed(text-component),
15
+ }
16
+
17
+ resource command-node {
18
+ literal: static func(name: string) -> command-node;
19
+ argument: static func(name: string, %type: argument-type) -> command-node;
20
+ then: func(node: command-node);
21
+ execute-with-handler-id: func(handler-id: u32);
22
+ suggest-with-handler-id: func(handler-id: u32);
23
+ require-with-handler-id: func(handler-id: u32);
24
+ }
25
+
26
+ record suggestion-request {
27
+ input: string,
28
+ cursor: u32,
29
+ start: u32,
30
+ remaining: string,
31
+ }
32
+
33
+ record command-suggestion {
34
+ value: string,
35
+ tooltip: option<text-component>,
36
+ }
37
+
38
+ record command-suggestions {
39
+ start: u32,
40
+ length: u32,
41
+ values: list<command-suggestion>,
42
+ }
43
+
44
+ variant argument-type {
45
+ %bool,
46
+ float(tuple<option<f32>, option<f32>>),
47
+ double(tuple<option<f64>, option<f64>>),
48
+ integer(tuple<option<s32>, option<s32>>),
49
+ long(tuple<option<s64>, option<s64>>),
50
+ %string(string-type),
51
+ entities,
52
+ entity,
53
+ players,
54
+ game-profile,
55
+ block-pos,
56
+ column-pos,
57
+ position3d,
58
+ position2d,
59
+ block-state,
60
+ block-predicate,
61
+ item,
62
+ item-predicate,
63
+ color,
64
+ component,
65
+ style,
66
+ message,
67
+ nbt-compound-tag,
68
+ nbt-tag,
69
+ nbt-path,
70
+ objective,
71
+ objective-criteria,
72
+ operation,
73
+ particle,
74
+ angle,
75
+ rotation,
76
+ scoreboard-slot,
77
+ score-holder(bool),
78
+ swizzle,
79
+ team,
80
+ item-slot,
81
+ resource-location,
82
+ mob-effect,
83
+ function,
84
+ entity-anchor,
85
+ int-range,
86
+ float-range,
87
+ dimension,
88
+ gamemode,
89
+ difficulty,
90
+ time(option<s32>),
91
+ %resource(string),
92
+ resource-or-tag(string),
93
+ resource-or-tag-key(string),
94
+ resource-key(string),
95
+ template-mirror,
96
+ template-rotation,
97
+ uuid,
98
+ }
99
+
100
+ record entity-argument {
101
+ single: bool,
102
+ players-only: bool,
103
+ }
104
+
105
+ variant command-sender-type {
106
+ rcon,
107
+ console,
108
+ player(player),
109
+ command-block(tuple<command-block-entity, %world>),
110
+ dummy,
111
+ }
112
+
113
+ enum permission-level {
114
+ zero,
115
+ one,
116
+ two,
117
+ three,
118
+ four,
119
+ }
120
+
121
+ resource command-sender {
122
+ get-command-sender-type: func() -> command-sender-type;
123
+ get-name: func() -> string;
124
+ send-message: func(text: text-component);
125
+ send-system-message: func(text: text-component);
126
+ send-error: func(text: text-component);
127
+ set-success-count: func(count: s32);
128
+ is-player: func() -> bool;
129
+ is-console: func() -> bool;
130
+ as-player: func() -> option<player>;
131
+ permission-level: func() -> permission-level;
132
+ has-permission-level: func(level: permission-level) -> bool;
133
+ has-permission: func(server: borrow<server>, node: string) -> bool;
134
+ position: func() -> option<position>;
135
+ %world: func() -> option<%world>;
136
+ get-locale: func() -> locale;
137
+ should-receive-feedback: func() -> bool;
138
+ should-broadcast-console-to-ops: func() -> bool;
139
+ should-track-output: func() -> bool;
140
+ }
141
+
142
+ enum string-type {
143
+ single-word,
144
+ quotable,
145
+ greedy,
146
+ }
147
+
148
+ enum suggestion-type {
149
+ ask-server,
150
+ all-recipes,
151
+ available-sounds,
152
+ available-biomes,
153
+ summonable-entities,
154
+ }
155
+
156
+ variant arg {
157
+ simple(string),
158
+ msg(string),
159
+ %bool(bool),
160
+ item(string),
161
+ item-predicate(string),
162
+ resource-location(string),
163
+ block(string),
164
+ block-predicate(string),
165
+ time(s32),
166
+ num(result<number, not-in-bounds>),
167
+ block-pos(block-pos),
168
+ pos3d(tuple<f64, f64, f64>),
169
+ pos2d(tuple<f64, f64>),
170
+ rotation(tuple<f32, bool, f32, bool>),
171
+ gamemode(game-mode),
172
+ difficulty(difficulty),
173
+ players(list<player>),
174
+ particle(string),
175
+ text-component(text-component),
176
+ bossbar-color(bossbar-color),
177
+ bossbar-style(bossbar-style),
178
+ sound-category(sound-category),
179
+ damage-type(string),
180
+ effect(string),
181
+ enchantment(string),
182
+ advancement(string),
183
+ entity-anchor(entity-anchor),
184
+ }
185
+
186
+ enum bossbar-color {
187
+ pink,
188
+ blue,
189
+ red,
190
+ green,
191
+ yellow,
192
+ purple,
193
+ white,
194
+ }
195
+
196
+ enum bossbar-style {
197
+ no-division,
198
+ notches6,
199
+ notches10,
200
+ notches12,
201
+ notches20,
202
+ }
203
+
204
+ enum sound-category {
205
+ master,
206
+ music,
207
+ records,
208
+ weather,
209
+ blocks,
210
+ hostile,
211
+ neutral,
212
+ players,
213
+ ambient,
214
+ voice,
215
+ }
216
+
217
+ enum entity-anchor {
218
+ eyes,
219
+ feet,
220
+ }
221
+
222
+ variant number {
223
+ float64(f64),
224
+ float32(f32),
225
+ int32(s32),
226
+ int64(s64),
227
+ }
228
+
229
+ variant not-in-bounds {
230
+ lower-bound(tuple<number, number>),
231
+ upper-bound(tuple<number, number>),
232
+ }
233
+
234
+ resource consumed-args {
235
+ get-value: func(key: string) -> arg;
236
+ }
237
+
238
+ resource command {
239
+ /// First name is primary, rest are aliases
240
+ constructor(names: list<string>, description: string);
241
+ then: func(node: command-node);
242
+ execute-with-handler-id: func(handler-id: u32);
243
+ }
244
+ }
@@ -0,0 +1,261 @@
1
+ /// Provides common types and utilities used across the entire plugin API.
2
+ interface common {
3
+ /// Serialized text component as a postcard byte array.
4
+ /// @deprecated Use the text-component resource from the text interface instead.
5
+ type raw-text-component = list<u8>;
6
+
7
+ /// Represents one entry in an NBT compound tag.
8
+ record nbt-entry {
9
+ key: string,
10
+ value: u32,
11
+ }
12
+
13
+ /// Represents a Minecraft NBT tag tree.
14
+ record nbt-tree {
15
+ root: u32,
16
+ tags: list<nbt-tag>,
17
+ }
18
+
19
+ /// Represents a Minecraft NBT tag.
20
+ variant nbt-tag {
21
+ byte(s8),
22
+ short(s16),
23
+ int(s32),
24
+ long(s64),
25
+ float(f32),
26
+ double(f64),
27
+ byte-array(list<s8>),
28
+ string-tag(string),
29
+ list-tag(list<u32>),
30
+ compound(list<nbt-entry>),
31
+ int-array(list<s32>),
32
+ long-array(list<s64>),
33
+ }
34
+
35
+ /// A position in the world grid (integers).
36
+ record block-pos {
37
+ x: s32,
38
+ y: s32,
39
+ z: s32,
40
+ }
41
+
42
+ /// A precise coordinate in the world (floats).
43
+ type position = tuple<f64, f64, f64>;
44
+
45
+ /// Represents the hands of a player.
46
+ enum hand {
47
+ left,
48
+ right,
49
+ }
50
+
51
+ /// Represents the game modes available in Minecraft.
52
+ enum game-mode {
53
+ survival,
54
+ creative,
55
+ adventure,
56
+ spectator,
57
+ }
58
+
59
+ /// The 16 base Minecraft colors.
60
+ enum named-color {
61
+ black,
62
+ dark-blue,
63
+ dark-green,
64
+ dark-aqua,
65
+ dark-red,
66
+ dark-purple,
67
+ gold,
68
+ gray,
69
+ dark-gray,
70
+ blue,
71
+ green,
72
+ aqua,
73
+ red,
74
+ light-purple,
75
+ yellow,
76
+ white,
77
+ }
78
+
79
+ /// An RGB color represented by its red, green, and blue components.
80
+ record rgb-color {
81
+ r: u8,
82
+ g: u8,
83
+ b: u8,
84
+ }
85
+
86
+ /// An ARGB color with alpha (transparency) channel.
87
+ record argb-color {
88
+ a: u8,
89
+ r: u8,
90
+ g: u8,
91
+ b: u8,
92
+ }
93
+
94
+ /// Represents the type of click interaction in a GUI.
95
+ enum click-type {
96
+ left,
97
+ right,
98
+ shift-left,
99
+ shift-right,
100
+ middle,
101
+ drop,
102
+ control-drop,
103
+ double-click,
104
+ number-key,
105
+ unknown,
106
+ }
107
+
108
+ /// Represents the various poses an entity can be in.
109
+ enum entity-pose {
110
+ standing,
111
+ fall-flying,
112
+ sleeping,
113
+ swimming,
114
+ spin-attack,
115
+ crouching,
116
+ long-jumping,
117
+ dying,
118
+ croaking,
119
+ using-tongue,
120
+ sitting,
121
+ roaring,
122
+ sniffing,
123
+ emerging,
124
+ digging,
125
+ sliding,
126
+ shooting,
127
+ inhaling,
128
+ }
129
+
130
+ /// All Minecraft-supported locales.
131
+ enum locale {
132
+ af-za,
133
+ ar-sa,
134
+ ast-es,
135
+ az-az,
136
+ ba-ru,
137
+ bar,
138
+ be-by,
139
+ bg-bg,
140
+ br-fr,
141
+ brb,
142
+ bs-ba,
143
+ ca-es,
144
+ cs-cz,
145
+ cy-gb,
146
+ da-dk,
147
+ de-at,
148
+ de-ch,
149
+ de-de,
150
+ el-gr,
151
+ en-au,
152
+ en-ca,
153
+ en-gb,
154
+ en-nz,
155
+ en-pt,
156
+ en-ud,
157
+ en-us,
158
+ enp,
159
+ enws,
160
+ eo-uy,
161
+ es-ar,
162
+ es-cl,
163
+ es-ec,
164
+ es-es,
165
+ es-mx,
166
+ es-uy,
167
+ es-ve,
168
+ esan,
169
+ et-ee,
170
+ eu-es,
171
+ fa-ir,
172
+ fi-fi,
173
+ fil-ph,
174
+ fo-fo,
175
+ fr-ca,
176
+ fr-fr,
177
+ fra-de,
178
+ fur-it,
179
+ fy-nl,
180
+ ga-ie,
181
+ gd-gb,
182
+ gl-es,
183
+ haw-us,
184
+ he-il,
185
+ hi-in,
186
+ hr-hr,
187
+ hu-hu,
188
+ hy-am,
189
+ id-id,
190
+ ig-ng,
191
+ io-en,
192
+ is-is,
193
+ isv,
194
+ it-it,
195
+ ja-jp,
196
+ jbo-en,
197
+ ka-ge,
198
+ kk-kz,
199
+ kn-in,
200
+ ko-kr,
201
+ ksh,
202
+ kw-gb,
203
+ la-la,
204
+ lb-lu,
205
+ li-li,
206
+ lmo,
207
+ lo-la,
208
+ lol-us,
209
+ lt-lt,
210
+ lv-lv,
211
+ lzh,
212
+ mk-mk,
213
+ mn-mn,
214
+ ms-my,
215
+ mt-mt,
216
+ nah,
217
+ nds-de,
218
+ nl-be,
219
+ nl-nl,
220
+ nn-no,
221
+ no-no,
222
+ oc-fr,
223
+ ovd,
224
+ pl-pl,
225
+ pt-br,
226
+ pt-pt,
227
+ qya-aa,
228
+ ro-ro,
229
+ rpr,
230
+ ru-ru,
231
+ ry-ua,
232
+ sah-sah,
233
+ se-no,
234
+ sk-sk,
235
+ sl-si,
236
+ so-so,
237
+ sq-al,
238
+ sr-cs,
239
+ sr-sp,
240
+ sv-se,
241
+ sxu,
242
+ szl,
243
+ ta-in,
244
+ th-th,
245
+ tl-ph,
246
+ tlh-aa,
247
+ tok,
248
+ tr-tr,
249
+ tt-ru,
250
+ uk-ua,
251
+ val-es,
252
+ vec-it,
253
+ vi-vn,
254
+ yi-de,
255
+ yo-ng,
256
+ zh-cn,
257
+ zh-hk,
258
+ zh-tw,
259
+ zlm-arab,
260
+ }
261
+ }
@@ -0,0 +1,61 @@
1
+ /// The core context provided to a plugin during initialization and event handling.
2
+ interface context {
3
+ use server.{server};
4
+ use event.{event-type, event-priority};
5
+ use command.{command};
6
+ use permission.{permission};
7
+
8
+ /// Verified marketplace metadata for signed plugins.
9
+ record marketplace-metadata {
10
+ /// The marketplace base URL where this plugin is registered.
11
+ marketplace-url: string,
12
+ /// The unique plugin ID on the marketplace.
13
+ plugin-id: s64,
14
+ /// The canonical plugin name.
15
+ plugin-name: string,
16
+ /// The semver version string of the plugin.
17
+ version: string,
18
+ /// Developer ID.
19
+ dev-id: s64,
20
+ /// Developer display name or username.
21
+ dev-name: string,
22
+ /// Whether this is a paid marketplace plugin.
23
+ is-paid: bool,
24
+ /// The buyer / licensee user ID (0 for free/open-source).
25
+ user-id: s64,
26
+ /// Unique license key issued to the buyer, if paid.
27
+ license-key: option<string>,
28
+ /// ISO-8601 timestamp of when this binary/license was issued.
29
+ issued-at: string,
30
+ }
31
+
32
+ /// A contextual handle for plugin-related operations.
33
+ resource context {
34
+ /// Registers a handler for a specific event.
35
+ ///
36
+ /// * `handler-id`: Unique ID for the event handler.
37
+ /// * `event-type`: The type of event to listen for.
38
+ /// * `event-priority`: When this handler should be called relative to others.
39
+ /// * `blocking`: Whether the event should wait for this handler to finish.
40
+ register-event: func(handler-id: u32, event-type: event-type, event-priority: event-priority, blocking: bool);
41
+
42
+ /// Registers a new command.
43
+ ///
44
+ /// * `command`: The command definition.
45
+ /// * `permission`: The required permission node to execute this command.
46
+ register-command: func(command: command, permission: string);
47
+
48
+ /// Registers a permission node with the server.
49
+ register-permission: func(permission: permission) -> result<_, string>;
50
+
51
+ /// Returns the path to the plugin's private data folder.
52
+ get-data-folder: func() -> string;
53
+
54
+ /// Returns the global server instance.
55
+ get-server: func() -> server;
56
+
57
+ /// Returns verified marketplace metadata if this plugin binary is signed, or none if unsigned.
58
+ get-marketplace-metadata: func() -> option<marketplace-metadata>;
59
+ }
60
+ }
61
+
@@ -0,0 +1,57 @@
1
+ package pumpkin:plugin@0.1.0;
2
+
3
+ interface damage-types {
4
+ enum damage-type {
5
+ arrow,
6
+ bad-respawn-point,
7
+ cactus,
8
+ campfire,
9
+ cramming,
10
+ dragon-breath,
11
+ drown,
12
+ dry-out,
13
+ ender-pearl,
14
+ explosion,
15
+ fall,
16
+ falling-anvil,
17
+ falling-block,
18
+ falling-stalactite,
19
+ fireball,
20
+ fireworks,
21
+ fly-into-wall,
22
+ freeze,
23
+ generic,
24
+ generic-kill,
25
+ hot-floor,
26
+ in-fire,
27
+ in-wall,
28
+ indirect-magic,
29
+ lava,
30
+ lightning-bolt,
31
+ mace-smash,
32
+ magic,
33
+ mob-attack,
34
+ mob-attack-no-aggro,
35
+ mob-projectile,
36
+ on-fire,
37
+ out-of-world,
38
+ outside-border,
39
+ player-attack,
40
+ player-explosion,
41
+ sonic-boom,
42
+ spear,
43
+ spit,
44
+ stalagmite,
45
+ starve,
46
+ sting,
47
+ sulfur-cube-hot,
48
+ sweet-berry-bush,
49
+ thorns,
50
+ thrown,
51
+ trident,
52
+ unattributed-fireball,
53
+ wind-charge,
54
+ wither,
55
+ wither-skull,
56
+ }
57
+ }