pub struct FurnaceMenuKind {
container: ContainerRef,
kind: FurnaceKind,
input: Section,
fuel: Section,
result: Section,
player: PlayerInventorySections,
data: [DataSlot; 4],
}Expand description
State and shift-click behavior shared by all furnace-family menus.
Fields§
§container: ContainerRef§kind: FurnaceKind§input: Section§fuel: Section§result: Section§player: PlayerInventorySections§data: [DataSlot; 4]Implementations§
Source§impl FurnaceMenuKind
impl FurnaceMenuKind
fn update_data(&self, behavior: &mut MenuBehavior, guard: &ContainerLockGuard)
fn can_smelt(&self, stack: &ItemStack) -> bool
Trait Implementations§
Source§impl DowncastType for FurnaceMenuKind
impl DowncastType for FurnaceMenuKind
Source§const TYPE_KEY: DowncastTypeKey
const TYPE_KEY: DowncastTypeKey
The process-wide key for this concrete type.
Source§impl MenuKind for FurnaceMenuKind
impl MenuKind for FurnaceMenuKind
Source§fn still_valid(&self, _behavior: &MenuBehavior, player: &Player) -> bool
fn still_valid(&self, _behavior: &MenuBehavior, player: &Player) -> bool
Returns true if this menu is still valid for the player.
Source§fn on_open(
&mut self,
behavior: &mut MenuBehavior,
guard: &mut ContainerLockGuard,
_player: &Player,
)
fn on_open( &mut self, behavior: &mut MenuBehavior, guard: &mut ContainerLockGuard, _player: &Player, )
Runs after initial contents are built but before they’re sent, so
anything populated here appears in the first render.
Source§fn on_tick(
&mut self,
behavior: &mut MenuBehavior,
guard: &mut ContainerLockGuard,
_player: &Player,
)
fn on_tick( &mut self, behavior: &mut MenuBehavior, guard: &mut ContainerLockGuard, _player: &Player, )
Runs once per tick per viewer while open, before changes are synced.
Source§fn quick_move(
&mut self,
behavior: &mut MenuBehavior,
guard: &mut ContainerLockGuard,
slot_index: usize,
player: &Player,
) -> Option<ItemStack>
fn quick_move( &mut self, behavior: &mut MenuBehavior, guard: &mut ContainerLockGuard, slot_index: usize, player: &Player, ) -> Option<ItemStack>
Shift-click override. Return
Some to fully handle the quick-move, or
None to fall back to the route table.Source§fn can_take_item_for_pick_all(
&self,
_carried: &ItemStack,
slot_index: usize,
) -> bool
fn can_take_item_for_pick_all( &self, _carried: &ItemStack, slot_index: usize, ) -> bool
Returns true if an item may be taken from
slot_index during pickup-all.Source§fn slots_changed(
&mut self,
_behavior: &mut MenuBehavior,
_guard: &mut ContainerLockGuard,
_player: &Player,
)
fn slots_changed( &mut self, _behavior: &mut MenuBehavior, _guard: &mut ContainerLockGuard, _player: &Player, )
Recompute recipe-driven slots after a click touched a real slot.
Source§fn removed(&mut self, _behavior: &mut MenuBehavior, _player: &Player)
fn removed(&mut self, _behavior: &mut MenuBehavior, _player: &Player)
Extra cleanup on close beyond [
Menu::removed].Source§fn on_rename(
&mut self,
_behavior: &mut MenuBehavior,
_name: String,
_player: &Player,
)
fn on_rename( &mut self, _behavior: &mut MenuBehavior, _name: String, _player: &Player, )
Applies a rename from the client (anvil-style text input) and recomputes
any result. No-op for kinds without a rename input.
Source§fn on_slot_clicked(
&mut self,
_behavior: &mut MenuBehavior,
_guard: &mut ContainerLockGuard,
_click: Click,
_player: &Player,
) -> ClickOutcome
fn on_slot_clicked( &mut self, _behavior: &mut MenuBehavior, _guard: &mut ContainerLockGuard, _click: Click, _player: &Player, ) -> ClickOutcome
Runs for every non-drag click before default handling. Return
ClickOutcome::Consume to treat the slot as a button, or
ClickOutcome::Fallthrough for default handling.Source§fn on_drag(
&mut self,
_behavior: &mut MenuBehavior,
_guard: &mut ContainerLockGuard,
_action: QuickCraft,
_player: &Player,
) -> ClickOutcome
fn on_drag( &mut self, _behavior: &mut MenuBehavior, _guard: &mut ContainerLockGuard, _action: QuickCraft, _player: &Player, ) -> ClickOutcome
Runs for each drag phase before default handling. Return
ClickOutcome::Consume to cancel the drag.Source§fn can_drag_to(&self, _slot_index: usize) -> bool
fn can_drag_to(&self, _slot_index: usize) -> bool
Returns true if a drag may distribute items into
slot_index.Source§fn on_update_effects(
&mut self,
_behavior: &mut MenuBehavior,
_guard: &mut ContainerLockGuard,
_primary: Option<MobEffectRef>,
_secondary: Option<MobEffectRef>,
) -> bool
fn on_update_effects( &mut self, _behavior: &mut MenuBehavior, _guard: &mut ContainerLockGuard, _primary: Option<MobEffectRef>, _secondary: Option<MobEffectRef>, ) -> bool
Handles a beacon effect update from the client’s set-beacon packet.
Returns
false when the selection or payment is invalid.Auto Trait Implementations§
impl !RefUnwindSafe for FurnaceMenuKind
impl !UnwindSafe for FurnaceMenuKind
impl Freeze for FurnaceMenuKind
impl Send for FurnaceMenuKind
impl Sync for FurnaceMenuKind
impl Unpin for FurnaceMenuKind
impl UnsafeUnpin for FurnaceMenuKind
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
Mutably borrows from an owned value. Read more
Source§impl<T> Downcast for Twhere
T: ErasedType + ?Sized,
impl<T> Downcast for Twhere
T: ErasedType + ?Sized,
Source§fn is<T>(&self) -> boolwhere
T: DowncastType,
fn is<T>(&self) -> boolwhere
T: DowncastType,
Returns whether the erased value has concrete type
T.Source§fn downcast_ref<T>(&self) -> Option<&T>where
T: DowncastType,
fn downcast_ref<T>(&self) -> Option<&T>where
T: DowncastType,
Returns the erased value as
T when its key matches.Source§fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: DowncastType,
fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: DowncastType,
Returns the erased value as mutable
T when its key matches.Source§impl<T> ErasedType for Twhere
T: DowncastType,
impl<T> ErasedType for Twhere
T: DowncastType,
fn downcast_type_key(&self) -> DowncastTypeKey
fn downcast_data(&self) -> *const ()
fn downcast_data_mut(&mut self) -> *mut ()
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreWraps this value in an
Arc<SyncMutex<>>