pub struct InventoryClickEvent<'mc>(/* private fields */);Implementations§
Source§impl<'mc> InventoryClickEvent<'mc>
impl<'mc> InventoryClickEvent<'mc>
pub fn new( jni: &SharedJNIEnv<'mc>, view: impl Into<InventoryView<'mc>>, val_type: impl Into<InventoryTypeSlotType<'mc>>, slot: i32, click: impl Into<ClickType<'mc>>, action: impl Into<InventoryAction<'mc>>, key: Option<i32>, ) -> Result<InventoryClickEvent<'mc>, Box<dyn Error>>
Sourcepub fn slot_type(&self) -> Result<InventoryTypeSlotType<'mc>, Box<dyn Error>>
pub fn slot_type(&self) -> Result<InventoryTypeSlotType<'mc>, Box<dyn Error>>
Gets the type of slot that was clicked.
Sourcepub fn cursor(&self) -> Result<Option<ItemStack<'mc>>, Box<dyn Error>>
pub fn cursor(&self) -> Result<Option<ItemStack<'mc>>, Box<dyn Error>>
Gets the current ItemStack on the cursor.
Sourcepub fn current_item(&self) -> Result<Option<ItemStack<'mc>>, Box<dyn Error>>
pub fn current_item(&self) -> Result<Option<ItemStack<'mc>>, Box<dyn Error>>
Gets the ItemStack currently in the clicked slot.
Sourcepub fn is_right_click(&self) -> Result<bool, Box<dyn Error>>
pub fn is_right_click(&self) -> Result<bool, Box<dyn Error>>
Gets whether or not the ClickType for this event represents a right click.
Sourcepub fn is_left_click(&self) -> Result<bool, Box<dyn Error>>
pub fn is_left_click(&self) -> Result<bool, Box<dyn Error>>
Gets whether or not the ClickType for this event represents a left click.
Sourcepub fn is_shift_click(&self) -> Result<bool, Box<dyn Error>>
pub fn is_shift_click(&self) -> Result<bool, Box<dyn Error>>
Gets whether the ClickType for this event indicates that the key was pressed down when the click was made.
Sourcepub fn set_cursor(
&self,
stack: impl Into<ItemStack<'mc>>,
) -> Result<(), Box<dyn Error>>
👎Deprecated
pub fn set_cursor( &self, stack: impl Into<ItemStack<'mc>>, ) -> Result<(), Box<dyn Error>>
Sets the item on the cursor.
Sourcepub fn set_current_item(
&self,
stack: impl Into<ItemStack<'mc>>,
) -> Result<(), Box<dyn Error>>
pub fn set_current_item( &self, stack: impl Into<ItemStack<'mc>>, ) -> Result<(), Box<dyn Error>>
Sets the ItemStack currently in the clicked slot.
Sourcepub fn clicked_inventory(
&self,
) -> Result<Option<Inventory<'mc>>, Box<dyn Error>>
pub fn clicked_inventory( &self, ) -> Result<Option<Inventory<'mc>>, Box<dyn Error>>
Gets the inventory corresponding to the clicked slot.
Sourcepub fn slot(&self) -> Result<i32, Box<dyn Error>>
pub fn slot(&self) -> Result<i32, Box<dyn Error>>
The slot number that was clicked, ready for passing to {@link Inventory#getItem(int)}. Note that there may be two slots with the same slot number, since a view links two different inventories.
Sourcepub fn raw_slot(&self) -> Result<i32, Box<dyn Error>>
pub fn raw_slot(&self) -> Result<i32, Box<dyn Error>>
The raw slot number clicked, ready for passing to {@link InventoryView #getItem(int)} This slot number is unique for the view.
If the ClickType is NUMBER_KEY, this method will return the index of the pressed key (0-8).
Sourcepub fn action(&self) -> Result<InventoryAction<'mc>, Box<dyn Error>>
pub fn action(&self) -> Result<InventoryAction<'mc>, Box<dyn Error>>
Gets the InventoryAction that triggered this event.
This action cannot be changed, and represents what the normal outcome of the event will be. To change the behavior of this InventoryClickEvent, changes must be manually applied.
Sourcepub fn click(&self) -> Result<ClickType<'mc>, Box<dyn Error>>
pub fn click(&self) -> Result<ClickType<'mc>, Box<dyn Error>>
Gets the ClickType for this event.
This is insulated against changes to the inventory by other plugins.
pub fn handlers(&self) -> Result<HandlerList<'mc>, Box<dyn Error>>
pub fn handler_list( jni: &SharedJNIEnv<'mc>, ) -> Result<HandlerList<'mc>, Box<dyn Error>>
Sourcepub fn who_clicked(&self) -> Result<HumanEntity<'mc>, Box<dyn Error>>
pub fn who_clicked(&self) -> Result<HumanEntity<'mc>, Box<dyn Error>>
Gets the player who performed the click.
Sourcepub fn set_result(
&self,
new_result: impl Into<EventResult<'mc>>,
) -> Result<(), Box<dyn Error>>
pub fn set_result( &self, new_result: impl Into<EventResult<'mc>>, ) -> Result<(), Box<dyn Error>>
Sets the result of this event. This will change whether or not this event is considered cancelled.
Sourcepub fn result(&self) -> Result<EventResult<'mc>, Box<dyn Error>>
pub fn result(&self) -> Result<EventResult<'mc>, Box<dyn Error>>
Gets the {@link org.bukkit.event.Event.Result} of this event. The Result describes the behavior that will be applied to the inventory in relation to this event.
Sourcepub fn is_cancelled(&self) -> Result<bool, Box<dyn Error>>
pub fn is_cancelled(&self) -> Result<bool, Box<dyn Error>>
Gets whether or not this event is cancelled. This is based off of the Result value returned by {@link #getResult()}.Result.ALLOW and Result.DEFAULT will result in a returned value of false, but Result.DENY will result in a returned value of true.
{@inheritDoc}
Sourcepub fn set_cancelled(&self, to_cancel: bool) -> Result<(), Box<dyn Error>>
pub fn set_cancelled(&self, to_cancel: bool) -> Result<(), Box<dyn Error>>
Proxy method to {@link #setResult(org.bukkit.event.Event.Result)} for the Cancellable interface. {@link #setResult(org.bukkit.event.Event.Result)} is preferred, as it allows you to specify the Result beyond Result.DENY and Result.ALLOW.
{@inheritDoc}
pub fn instance_of(&self, other: impl Into<String>) -> Result<bool, Error>
Trait Implementations§
Source§impl<'mc> Into<InventoryClickEvent<'mc>> for CraftItemEvent<'mc>
impl<'mc> Into<InventoryClickEvent<'mc>> for CraftItemEvent<'mc>
Source§fn into(self) -> InventoryClickEvent<'mc>
fn into(self) -> InventoryClickEvent<'mc>
Source§impl<'mc> Into<InventoryClickEvent<'mc>> for InventoryCreativeEvent<'mc>
impl<'mc> Into<InventoryClickEvent<'mc>> for InventoryCreativeEvent<'mc>
Source§fn into(self) -> InventoryClickEvent<'mc>
fn into(self) -> InventoryClickEvent<'mc>
Source§impl<'mc> Into<InventoryClickEvent<'mc>> for SmithItemEvent<'mc>
impl<'mc> Into<InventoryClickEvent<'mc>> for SmithItemEvent<'mc>
Source§fn into(self) -> InventoryClickEvent<'mc>
fn into(self) -> InventoryClickEvent<'mc>
Source§impl<'mc> Into<InventoryInteractEvent<'mc>> for InventoryClickEvent<'mc>
impl<'mc> Into<InventoryInteractEvent<'mc>> for InventoryClickEvent<'mc>
Source§fn into(self) -> InventoryInteractEvent<'mc>
fn into(self) -> InventoryInteractEvent<'mc>
Source§impl<'mc> JNIInstantiatable<'mc> for InventoryClickEvent<'mc>
impl<'mc> JNIInstantiatable<'mc> for InventoryClickEvent<'mc>
Source§impl<'mc> JNIRaw<'mc> for InventoryClickEvent<'mc>
impl<'mc> JNIRaw<'mc> for InventoryClickEvent<'mc>
fn jni_ref(&self) -> SharedJNIEnv<'mc>
fn jni_object(&self) -> JObject<'mc>
Auto Trait Implementations§
impl<'mc> !Freeze for InventoryClickEvent<'mc>
impl<'mc> !RefUnwindSafe for InventoryClickEvent<'mc>
impl<'mc> !Send for InventoryClickEvent<'mc>
impl<'mc> !Sync for InventoryClickEvent<'mc>
impl<'mc> Unpin for InventoryClickEvent<'mc>
impl<'mc> UnwindSafe for InventoryClickEvent<'mc>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<D> OwoColorize for D
impl<D> OwoColorize for D
Source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Source§fn black(&self) -> FgColorDisplay<'_, Black, Self>
fn black(&self) -> FgColorDisplay<'_, Black, Self>
Source§fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
Source§fn red(&self) -> FgColorDisplay<'_, Red, Self>
fn red(&self) -> FgColorDisplay<'_, Red, Self>
Source§fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
Source§fn green(&self) -> FgColorDisplay<'_, Green, Self>
fn green(&self) -> FgColorDisplay<'_, Green, Self>
Source§fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
Source§fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
Source§fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
Source§fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
Source§fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
Source§fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
Source§fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
Source§fn white(&self) -> FgColorDisplay<'_, White, Self>
fn white(&self) -> FgColorDisplay<'_, White, Self>
Source§fn on_white(&self) -> BgColorDisplay<'_, White, Self>
fn on_white(&self) -> BgColorDisplay<'_, White, Self>
Source§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
Source§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
Source§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
Source§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
Source§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
Source§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
Source§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
Source§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
Source§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
Source§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
Source§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
Source§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
Source§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
Source§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
Source§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
Source§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
Source§fn bold(&self) -> BoldDisplay<'_, Self>
fn bold(&self) -> BoldDisplay<'_, Self>
Source§fn dimmed(&self) -> DimDisplay<'_, Self>
fn dimmed(&self) -> DimDisplay<'_, Self>
Source§fn italic(&self) -> ItalicDisplay<'_, Self>
fn italic(&self) -> ItalicDisplay<'_, Self>
Source§fn underline(&self) -> UnderlineDisplay<'_, Self>
fn underline(&self) -> UnderlineDisplay<'_, Self>
Source§fn blink(&self) -> BlinkDisplay<'_, Self>
fn blink(&self) -> BlinkDisplay<'_, Self>
Source§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
Source§fn reversed(&self) -> ReversedDisplay<'_, Self>
fn reversed(&self) -> ReversedDisplay<'_, Self>
Source§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
Source§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read moreSource§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read more