pumpkin-api-py 0.1.0.dev2__tar.gz → 0.1.0.dev3__tar.gz

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 (28) hide show
  1. {pumpkin_api_py-0.1.0.dev2 → pumpkin_api_py-0.1.0.dev3}/PKG-INFO +1 -1
  2. {pumpkin_api_py-0.1.0.dev2 → pumpkin_api_py-0.1.0.dev3}/pyproject.toml +1 -1
  3. {pumpkin_api_py-0.1.0.dev2 → pumpkin_api_py-0.1.0.dev3}/wit/repo/pumpkin-plugin-wit/v0.1/common.wit +14 -0
  4. {pumpkin_api_py-0.1.0.dev2 → pumpkin_api_py-0.1.0.dev3}/wit/repo/pumpkin-plugin-wit/v0.1/event.wit +22 -1
  5. {pumpkin_api_py-0.1.0.dev2 → pumpkin_api_py-0.1.0.dev3}/wit/repo/pumpkin-plugin-wit/v0.1/gui.wit +13 -1
  6. {pumpkin_api_py-0.1.0.dev2 → pumpkin_api_py-0.1.0.dev3}/wit/repo/pumpkin-plugin-wit/v0.1/player.wit +33 -10
  7. {pumpkin_api_py-0.1.0.dev2 → pumpkin_api_py-0.1.0.dev3}/wit/repo/pumpkin-plugin-wit/v0.1/server.wit +18 -0
  8. {pumpkin_api_py-0.1.0.dev2 → pumpkin_api_py-0.1.0.dev3}/wit/repo/pumpkin-plugin-wit/v0.1/world.wit +38 -0
  9. {pumpkin_api_py-0.1.0.dev2 → pumpkin_api_py-0.1.0.dev3}/.gitignore +0 -0
  10. {pumpkin_api_py-0.1.0.dev2 → pumpkin_api_py-0.1.0.dev3}/LICENSE +0 -0
  11. {pumpkin_api_py-0.1.0.dev2 → pumpkin_api_py-0.1.0.dev3}/README.md +0 -0
  12. {pumpkin_api_py-0.1.0.dev2 → pumpkin_api_py-0.1.0.dev3}/hatch_build.py +0 -0
  13. {pumpkin_api_py-0.1.0.dev2 → pumpkin_api_py-0.1.0.dev3}/src/pumpkin_api/__init__.py +0 -0
  14. {pumpkin_api_py-0.1.0.dev2 → pumpkin_api_py-0.1.0.dev3}/src/pumpkin_api/build.py +0 -0
  15. {pumpkin_api_py-0.1.0.dev2 → pumpkin_api_py-0.1.0.dev3}/src/pumpkin_api/impl.py +0 -0
  16. {pumpkin_api_py-0.1.0.dev2 → pumpkin_api_py-0.1.0.dev3}/wit/repo/pumpkin-plugin-wit/v0.1/block-entity.wit +0 -0
  17. {pumpkin_api_py-0.1.0.dev2 → pumpkin_api_py-0.1.0.dev3}/wit/repo/pumpkin-plugin-wit/v0.1/boss-bar.wit +0 -0
  18. {pumpkin_api_py-0.1.0.dev2 → pumpkin_api_py-0.1.0.dev3}/wit/repo/pumpkin-plugin-wit/v0.1/command.wit +0 -0
  19. {pumpkin_api_py-0.1.0.dev2 → pumpkin_api_py-0.1.0.dev3}/wit/repo/pumpkin-plugin-wit/v0.1/context.wit +0 -0
  20. {pumpkin_api_py-0.1.0.dev2 → pumpkin_api_py-0.1.0.dev3}/wit/repo/pumpkin-plugin-wit/v0.1/entity.wit +0 -0
  21. {pumpkin_api_py-0.1.0.dev2 → pumpkin_api_py-0.1.0.dev3}/wit/repo/pumpkin-plugin-wit/v0.1/i18n.wit +0 -0
  22. {pumpkin_api_py-0.1.0.dev2 → pumpkin_api_py-0.1.0.dev3}/wit/repo/pumpkin-plugin-wit/v0.1/log.wit +0 -0
  23. {pumpkin_api_py-0.1.0.dev2 → pumpkin_api_py-0.1.0.dev3}/wit/repo/pumpkin-plugin-wit/v0.1/metadata.wit +0 -0
  24. {pumpkin_api_py-0.1.0.dev2 → pumpkin_api_py-0.1.0.dev3}/wit/repo/pumpkin-plugin-wit/v0.1/permission.wit +0 -0
  25. {pumpkin_api_py-0.1.0.dev2 → pumpkin_api_py-0.1.0.dev3}/wit/repo/pumpkin-plugin-wit/v0.1/plugin.wit +0 -0
  26. {pumpkin_api_py-0.1.0.dev2 → pumpkin_api_py-0.1.0.dev3}/wit/repo/pumpkin-plugin-wit/v0.1/scheduler.wit +0 -0
  27. {pumpkin_api_py-0.1.0.dev2 → pumpkin_api_py-0.1.0.dev3}/wit/repo/pumpkin-plugin-wit/v0.1/scoreboard.wit +0 -0
  28. {pumpkin_api_py-0.1.0.dev2 → pumpkin_api_py-0.1.0.dev3}/wit/repo/pumpkin-plugin-wit/v0.1/text.wit +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pumpkin-api-py
3
- Version: 0.1.0.dev2
3
+ Version: 0.1.0.dev3
4
4
  Summary: Pumpkin plugin API for Python
5
5
  Author: alex
6
6
  License-Expression: GPL-3.0-only
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "pumpkin-api-py"
3
- version = "0.1.0.dev2"
3
+ version = "0.1.0.dev3"
4
4
  description = "Pumpkin plugin API for Python"
5
5
  authors = [{name = "alex"}]
6
6
  license = "GPL-3.0-only"
@@ -67,6 +67,20 @@ interface common {
67
67
  count: u8,
68
68
  }
69
69
 
70
+ /// Represents the type of click interaction in a GUI.
71
+ enum click-type {
72
+ left,
73
+ right,
74
+ shift-left,
75
+ shift-right,
76
+ middle,
77
+ drop,
78
+ control-drop,
79
+ double-click,
80
+ number-key,
81
+ unknown,
82
+ }
83
+
70
84
  /// Represents the various poses an entity can be in.
71
85
  enum entity-pose {
72
86
  standing,
@@ -1,5 +1,5 @@
1
1
  interface event {
2
- use common.{block-position, game-mode, hand, item-stack, position};
2
+ use common.{block-position, game-mode, hand, item-stack, position, click-type};
3
3
  use player.{player};
4
4
  use text.{text-component};
5
5
  use %world.{%world};
@@ -179,6 +179,23 @@ interface event {
179
179
  cancelled: bool
180
180
  }
181
181
 
182
+ record inventory-click-event-data {
183
+ player: player,
184
+ window-type: option<string>,
185
+ click-type: click-type,
186
+ slot: s16,
187
+ raw-slot: s16,
188
+ clicked-item: option<item-stack>,
189
+ cursor: option<item-stack>,
190
+ hotbar-button: s32,
191
+ cancelled: bool
192
+ }
193
+
194
+ record inventory-close-event-data {
195
+ player: player,
196
+ window-type: option<string>
197
+ }
198
+
182
199
  record block-redstone-event-data {
183
200
  target-world: %world,
184
201
  state-id: u16,
@@ -272,6 +289,8 @@ interface event {
272
289
  player-toggle-sneak-event,
273
290
  player-toggle-flight-event,
274
291
  player-toggle-sprint-event,
292
+ inventory-click-event,
293
+ inventory-close-event,
275
294
  block-redstone-event,
276
295
  block-break-event,
277
296
  block-burn-event,
@@ -305,6 +324,8 @@ interface event {
305
324
  player-toggle-sneak-event(player-toggle-sneak-event-data),
306
325
  player-toggle-flight-event(player-toggle-flight-event-data),
307
326
  player-toggle-sprint-event(player-toggle-sprint-event-data),
327
+ inventory-click-event(inventory-click-event-data),
328
+ inventory-close-event(inventory-close-event-data),
308
329
  block-redstone-event(block-redstone-event-data),
309
330
  block-break-event(block-break-event-data),
310
331
  block-burn-event(block-burn-event-data),
@@ -1,6 +1,6 @@
1
1
  interface gui {
2
2
  use text.{text-component};
3
- use common.{item-stack};
3
+ use common.{item-stack, click-type};
4
4
 
5
5
  enum gui-type {
6
6
  generic-9x1,
@@ -46,5 +46,17 @@ interface gui {
46
46
 
47
47
  /// Clears all items from the GUI.
48
48
  clear-items: func();
49
+
50
+ /// Sets whether players can grab items out of the inventory.
51
+ set-allow-grab-items: func(allow: bool);
52
+
53
+ /// Returns whether players can grab items out of the inventory.
54
+ get-allow-grab-items: func() -> bool;
55
+
56
+ /// Sets whether players can put items into the inventory from their own.
57
+ set-allow-put-items: func(allow: bool);
58
+
59
+ /// Returns whether players can put items into the inventory from their own.
60
+ get-allow-put-items: func() -> bool;
49
61
  }
50
62
  }
@@ -25,6 +25,25 @@ interface player {
25
25
  walk-speed: f32,
26
26
  }
27
27
 
28
+ /// Represents a player's skin textures and metadata.
29
+ record player-skin {
30
+ /// The base64-encoded texture data (usually JSON containing skin/cape URLs).
31
+ value: string,
32
+ /// The optional signature for the texture data.
33
+ signature: option<string>,
34
+ }
35
+
36
+ /// Flags representing visible skin parts.
37
+ flags skin-parts {
38
+ cape,
39
+ jacket,
40
+ left-sleeve,
41
+ right-sleeve,
42
+ left-pants-leg,
43
+ right-pants-leg,
44
+ hat,
45
+ }
46
+
28
47
  /// A handle to a player on the server.
29
48
  resource player {
30
49
  /// Returns the player as an entity.
@@ -59,6 +78,12 @@ interface player {
59
78
  get-permission-level: func () -> permission-level;
60
79
  /// Sets the player's permission level.
61
80
  set-permission-level: func (level: permission-level);
81
+ /// Grants or denies a specific permission node for the player.
82
+ set-permission: func(node: string, value: bool);
83
+ /// Removes an explicitly set permission node from the player.
84
+ unset-permission: func(node: string);
85
+ /// Returns `Some(true)` if granted, `Some(false)` if denied, or `None` if not set.
86
+ has-permission-set: func (node: string) -> option<bool>;
62
87
  /// Checks if the player has a specific permission node.
63
88
  has-permission: func (node: string) -> bool;
64
89
  /// Returns the player's display name, which may include formatting.
@@ -162,16 +187,6 @@ interface player {
162
187
  /// Adds experience points to the player.
163
188
  add-experience-points: func(points: s32);
164
189
 
165
- /// Returns whether the player is currently sneaking.
166
- is-sneaking: func() -> bool;
167
- /// Sets whether the player is currently sneaking.
168
- set-sneaking: func(sneaking: bool);
169
- /// Returns whether the player is currently sprinting.
170
- is-sprinting: func() -> bool;
171
- /// Sets whether the player is currently sprinting.
172
- set-sprinting: func(sprinting: bool);
173
- /// Returns whether the player is currently on the ground.
174
- is-on-ground: func() -> bool;
175
190
  /// Returns whether the player is currently flying.
176
191
  is-flying: func() -> bool;
177
192
  /// Sets whether the player should be flying.
@@ -184,5 +199,13 @@ interface player {
184
199
 
185
200
  /// Returns the player's IP address.
186
201
  get-ip: func() -> string;
202
+
203
+ /// Returns the player's current skin textures.
204
+ get-skin: func() -> option<player-skin>;
205
+
206
+ /// Returns the currently visible skin parts.
207
+ get-skin-parts: func() -> skin-parts;
208
+ /// Sets which skin parts are visible.
209
+ set-skin-parts: func(parts: skin-parts);
187
210
  }
188
211
  }
@@ -16,6 +16,18 @@ interface server {
16
16
  hard,
17
17
  }
18
18
 
19
+ /// Represents the three main Minecraft dimensions.
20
+ enum dimension {
21
+ overworld,
22
+ nether,
23
+ end,
24
+ }
25
+
26
+ variant command-sender {
27
+ console,
28
+ player(player),
29
+ }
30
+
19
31
  /// Represents the global server instance.
20
32
  resource server {
21
33
  /// Returns the current difficulty level of the server.
@@ -47,6 +59,12 @@ interface server {
47
59
  /// Gets a world by its dimension name (e.g., "minecraft:overworld").
48
60
  get-world-by-name: func(name: string) -> option<%world>;
49
61
 
62
+ execute-command: func(command: string, sender: command-sender);
63
+
64
+ /// Creates or loads a world by its name and dimension.
65
+ /// If a world with the given name already exists, it will be returned.
66
+ create-world: func(name: string, dimension: dimension) -> %world;
67
+
50
68
  /// Broadcasts a system chat message to all players.
51
69
  broadcast: func(message: string);
52
70
 
@@ -114,10 +114,27 @@ interface %world {
114
114
  get-head-yaw: func() -> f32;
115
115
 
116
116
  is-on-ground: func() -> bool;
117
+
117
118
  is-sneaking: func() -> bool;
119
+ set-sneaking: func(sneaking: bool);
120
+
118
121
  is-sprinting: func() -> bool;
122
+ set-sprinting: func(sprinting: bool);
123
+
124
+ is-swimming: func() -> bool;
125
+ set-swimming: func(swimming: bool);
126
+
119
127
  is-invisible: func() -> bool;
128
+ set-invisible: func(invisible: bool);
129
+
120
130
  is-glowing: func() -> bool;
131
+ set-glowing: func(glowing: bool);
132
+
133
+ is-fall-flying: func() -> bool;
134
+ set-fall-flying: func(fall-flying: bool);
135
+
136
+ is-on-fire: func() -> bool;
137
+ set-on-fire: func(on-fire: bool);
121
138
 
122
139
  teleport: func(pos: position, world-ref: %world);
123
140
  set-velocity: func(velocity: position);
@@ -137,6 +154,27 @@ interface %world {
137
154
  set-fire-ticks: func(ticks: s32);
138
155
 
139
156
  remove: func();
157
+
158
+ /// Performs a raycast from the entity's eye position in its looking direction.
159
+ raycast: func(max-distance: f64, fluid-handling: bool) -> option<raycast-result>;
160
+ }
161
+
162
+ /// Result of a raycast operation.
163
+ record raycast-result {
164
+ /// The block position that was hit.
165
+ pos: block-pos,
166
+ /// The face of the block that was hit.
167
+ face: block-direction,
168
+ }
169
+
170
+ /// Represents a cardinal direction or block face.
171
+ enum block-direction {
172
+ down,
173
+ up,
174
+ north,
175
+ south,
176
+ west,
177
+ east,
140
178
  }
141
179
 
142
180
  /// Represents a Minecraft world (dimension).