mirror of
https://github.com/Pumpkin-MC/Pumpkin.git
synced 2026-08-31 08:22:33 +00:00
feat(plugin-api): expose ItemStack, uuid, event and command arg types (#2526)
The item-stack, uuid, and event WIT modules are generated but were never re-exported from the plugin API, so plugin authors could not name ItemStack (needed to build GUI icons, /give, skulls) or construct a uuid. This adds them to the public re-exports, plus EventHandler/FromIntoEvent and the command Arg/ArgumentType/StringType helpers. Revives the change from #2325 (closed unmerged).
This commit is contained in:
@@ -44,7 +44,8 @@ pub mod scheduler;
|
||||
|
||||
pub mod command {
|
||||
pub use crate::wit::pumpkin::plugin::command::{
|
||||
Command, CommandError, CommandNode, CommandSender, ConsumedArgs,
|
||||
Arg, ArgumentType, Command, CommandError, CommandNode, CommandSender, ConsumedArgs,
|
||||
StringType,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -53,10 +54,16 @@ pub use wit::pumpkin::plugin::{
|
||||
context::{Context, Server},
|
||||
data_components, entity,
|
||||
entity_types::EntityType,
|
||||
gui, i18n, java_dialogs, java_packets, particles, permission, player, scoreboard, server, text,
|
||||
world,
|
||||
event::{self as events_wit, EventType},
|
||||
gui, i18n, item_stack, java_dialogs, java_packets, particles, permission, player, scoreboard,
|
||||
server, text, uuid, world,
|
||||
};
|
||||
|
||||
// Convenience re-exports of commonly-used plugin types so plugin authors can
|
||||
// name them directly (e.g. build an `ItemStack` for a GUI or `/give`).
|
||||
pub use events::{EventHandler, FromIntoEvent};
|
||||
pub use wit::pumpkin::plugin::item_stack::ItemStack;
|
||||
|
||||
pub mod java_dialog {
|
||||
pub use crate::wit::pumpkin::plugin::java_dialogs::{ActionButton, DialogBody, DialogType};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user